From 697b667b37257409ba1de521ed26ec324f1383ea Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 1 Apr 2026 20:07:48 +0000 Subject: [PATCH] Configurations: 'specification/managednetworkfabric/ManagedNetworkFabric.ResourceManager.Management/tspconfig.yaml', API Version: 2025-07-15, SDK Release Type: stable, and CommitSHA: '1a3542f46375ced453982cf69f035d9a9a3924d5' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6094859 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../CHANGELOG.md | 727 + .../MANIFEST.in | 9 +- .../azure-mgmt-managednetworkfabric/README.md | 9 +- .../_meta.json | 11 - .../_metadata.json | 10 + .../apiview-properties.json | 859 + .../azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- .../mgmt/managednetworkfabric/__init__.py | 16 +- ...twork_fabric_mgmt_client.py => _client.py} | 125 +- .../managednetworkfabric/_configuration.py | 40 +- .../azure/mgmt/managednetworkfabric/_patch.py | 13 +- .../managednetworkfabric/_utils/__init__.py | 6 + .../managednetworkfabric/_utils/model_base.py | 1350 + .../serialization.py} | 695 +- .../mgmt/managednetworkfabric/_validation.py | 66 + .../mgmt/managednetworkfabric/_vendor.py | 30 - .../mgmt/managednetworkfabric/_version.py | 4 +- .../mgmt/managednetworkfabric/aio/__init__.py | 16 +- ...twork_fabric_mgmt_client.py => _client.py} | 130 +- .../aio/_configuration.py | 40 +- .../mgmt/managednetworkfabric/aio/_patch.py | 13 +- .../aio/operations/__init__.py | 70 +- .../_access_control_lists_operations.py | 1422 - .../_external_networks_operations.py | 1359 - .../_internal_networks_operations.py | 1612 - .../_internet_gateway_rules_operations.py | 914 - .../_internet_gateways_operations.py | 906 - .../operations/_ip_communities_operations.py | 888 - .../_ip_extended_communities_operations.py | 914 - .../aio/operations/_ip_prefixes_operations.py | 886 - .../_l2_isolation_domains_operations.py | 1413 - .../_l3_isolation_domains_operations.py | 1416 - .../operations/_neighbor_groups_operations.py | 891 - .../_network_device_skus_operations.py | 201 - .../operations/_network_devices_operations.py | 1738 - .../_network_fabric_controllers_operations.py | 909 - .../_network_fabric_skus_operations.py | 201 - .../operations/_network_fabrics_operations.py | 2533 - .../_network_interfaces_operations.py | 1103 - .../_network_packet_brokers_operations.py | 903 - .../operations/_network_racks_operations.py | 877 - .../_network_tap_rules_operations.py | 1419 - .../operations/_network_taps_operations.py | 1252 - ...ork_to_network_interconnects_operations.py | 1384 - .../aio/operations/_operations.py | 35198 ++++++++++++- .../aio/operations/_patch.py | 13 +- .../operations/_route_policies_operations.py | 1384 - .../managednetworkfabric/models/__init__.py | 1019 +- .../managednetworkfabric/models/_enums.py | 935 + ...anaged_network_fabric_mgmt_client_enums.py | 404 - .../managednetworkfabric/models/_models.py | 19846 ++++++++ .../models/_models_py3.py | 12550 ----- .../managednetworkfabric/models/_patch.py | 13 +- .../operations/__init__.py | 70 +- .../_access_control_lists_operations.py | 1700 - .../_external_networks_operations.py | 1618 - .../_internal_networks_operations.py | 1911 - .../_internet_gateway_rules_operations.py | 1100 - .../_internet_gateways_operations.py | 1082 - .../operations/_ip_communities_operations.py | 1072 - .../_ip_extended_communities_operations.py | 1100 - .../operations/_ip_prefixes_operations.py | 1066 - .../_l2_isolation_domains_operations.py | 1692 - .../_l3_isolation_domains_operations.py | 1695 - .../operations/_neighbor_groups_operations.py | 1069 - .../_network_device_skus_operations.py | 256 - .../operations/_network_devices_operations.py | 2053 - .../_network_fabric_controllers_operations.py | 1106 - .../_network_fabric_skus_operations.py | 256 - .../operations/_network_fabrics_operations.py | 3011 -- .../_network_interfaces_operations.py | 1302 - .../_network_packet_brokers_operations.py | 1089 - .../operations/_network_racks_operations.py | 1061 - .../_network_tap_rules_operations.py | 1694 - .../operations/_network_taps_operations.py | 1497 - ...ork_to_network_interconnects_operations.py | 1662 - .../operations/_operations.py | 40784 +++++++++++++++- .../managednetworkfabric/operations/_patch.py | 13 +- .../operations/_route_policies_operations.py | 1667 - ..._gen.py => access_control_lists_create.py} | 33 +- ..._control_lists_create_control_plane_acl.py | 81 + ..._gen.py => access_control_lists_delete.py} | 13 +- ...set_gen.py => access_control_lists_get.py} | 13 +- ...s_control_lists_list_by_resource_group.py} | 13 +- ...ess_control_lists_list_by_subscription.py} | 13 +- ..._gen.py => access_control_lists_resync.py} | 13 +- ..._gen.py => access_control_lists_update.py} | 31 +- ...trol_lists_update_administrative_state.py} | 13 +- ...s_control_lists_validate_configuration.py} | 13 +- ...set_gen.py => external_networks_create.py} | 45 +- .../external_networks_delete.py | 42 + ...xternal_networks_delete_maximum_set_gen.py | 41 - .../external_networks_get.py | 43 + .../external_networks_get_maximum_set_gen.py | 42 - ...l_networks_list_by_l3_isolation_domain.py} | 15 +- ...set_gen.py => external_networks_update.py} | 45 +- ...l_networks_update_administrative_state.py} | 17 +- ...etworks_update_bfd_administrative_state.py | 44 + ..._static_route_bfd_administrative_state.py} | 13 +- ...set_gen.py => internal_networks_create.py} | 45 +- ...set_gen.py => internal_networks_delete.py} | 15 +- ...um_set_gen.py => internal_networks_get.py} | 15 +- ...l_networks_list_by_l3_isolation_domain.py} | 15 +- ...set_gen.py => internal_networks_update.py} | 45 +- ...l_networks_update_administrative_state.py} | 15 +- ...etworks_update_bfd_administrative_state.py | 44 + ...etworks_update_bgp_administrative_state.py | 44 + ...gp_administrative_state_maximum_set_gen.py | 43 - ..._static_route_bfd_administrative_state.py} | 13 +- ...en.py => internet_gateway_rules_create.py} | 24 +- ...en.py => internet_gateway_rules_delete.py} | 13 +- ...t_gen.py => internet_gateway_rules_get.py} | 13 +- ...t_gateway_rules_list_by_resource_group.py} | 13 +- ...net_gateway_rules_list_by_subscription.py} | 13 +- ...en.py => internet_gateway_rules_update.py} | 15 +- ...set_gen.py => internet_gateways_create.py} | 17 +- ...set_gen.py => internet_gateways_delete.py} | 13 +- ...um_set_gen.py => internet_gateways_get.py} | 13 +- ...ternet_gateways_list_by_resource_group.py} | 13 +- ...internet_gateways_list_by_subscription.py} | 13 +- ...set_gen.py => internet_gateways_update.py} | 16 +- ...um_set_gen.py => ip_communities_create.py} | 16 +- ...um_set_gen.py => ip_communities_delete.py} | 13 +- ...ximum_set_gen.py => ip_communities_get.py} | 13 +- ... ip_communities_list_by_resource_group.py} | 13 +- ...=> ip_communities_list_by_subscription.py} | 13 +- ...um_set_gen.py => ip_communities_update.py} | 16 +- ...n.py => ip_extended_communities_create.py} | 16 +- ...n.py => ip_extended_communities_delete.py} | 13 +- ..._gen.py => ip_extended_communities_get.py} | 13 +- ...ded_communities_list_by_resource_group.py} | 13 +- ...ended_communities_list_by_subscription.py} | 13 +- ...n.py => ip_extended_communities_update.py} | 18 +- ...ximum_set_gen.py => ip_prefixes_create.py} | 16 +- ...ximum_set_gen.py => ip_prefixes_delete.py} | 13 +- ..._maximum_set_gen.py => ip_prefixes_get.py} | 13 +- ... => ip_prefixes_list_by_resource_group.py} | 13 +- ...py => ip_prefixes_list_by_subscription.py} | 13 +- ...ximum_set_gen.py => ip_prefixes_update.py} | 15 +- ...isolation_domains_commit_configuration.py} | 13 +- ..._gen.py => l2_isolation_domains_create.py} | 20 +- ..._gen.py => l2_isolation_domains_delete.py} | 15 +- ...set_gen.py => l2_isolation_domains_get.py} | 15 +- ...olation_domains_list_by_resource_group.py} | 13 +- ...isolation_domains_list_by_subscription.py} | 13 +- .../l2_isolation_domains_update.py | 52 + ...on_domains_update_administrative_state.py} | 15 +- ...solation_domains_update_maximum_set_gen.py | 42 - ...olation_domains_validate_configuration.py} | 13 +- ...isolation_domains_commit_configuration.py} | 13 +- ..._gen.py => l3_isolation_domains_create.py} | 32 +- ..._gen.py => l3_isolation_domains_delete.py} | 13 +- ...set_gen.py => l3_isolation_domains_get.py} | 13 +- ...olation_domains_list_by_resource_group.py} | 13 +- ...isolation_domains_list_by_subscription.py} | 13 +- ..._gen.py => l3_isolation_domains_update.py} | 35 +- ...on_domains_update_administrative_state.py} | 13 +- ...olation_domains_validate_configuration.py} | 13 +- ...m_set_gen.py => neighbor_groups_create.py} | 16 +- ...m_set_gen.py => neighbor_groups_delete.py} | 13 +- ...imum_set_gen.py => neighbor_groups_get.py} | 13 +- ...neighbor_groups_list_by_resource_group.py} | 13 +- ...> neighbor_groups_list_by_subscription.py} | 13 +- .../neighbor_groups_resync.py | 42 + ...m_set_gen.py => neighbor_groups_update.py} | 16 +- ...py => network_bootstrap_devices_create.py} | 21 +- .../network_bootstrap_devices_delete.py | 41 + .../network_bootstrap_devices_get.py | 42 + ...ootstrap_devices_list_by_resource_group.py | 42 + ..._bootstrap_devices_list_by_subscription.py | 40 + .../network_bootstrap_devices_reboot.py | 42 + ...bootstrap_devices_refresh_configuration.py | 42 + ...work_bootstrap_devices_resync_passwords.py | 42 + ...py => network_bootstrap_devices_update.py} | 20 +- ...rap_devices_update_administrative_state.py | 49 + .../network_bootstrap_devices_upgrade.py | 43 + .../network_bootstrap_interfaces_create.py | 52 + .../network_bootstrap_interfaces_delete.py | 42 + .../network_bootstrap_interfaces_get.py | 43 + ...rfaces_list_by_network_bootstrap_device.py | 43 + .../network_bootstrap_interfaces_update.py | 46 + ...interfaces_update_administrative_state.py} | 18 +- ..._set_gen.py => network_device_skus_get.py} | 13 +- ...twork_device_skus_list_by_subscription.py} | 13 +- .../network_devices_create.py | 65 + ...m_set_gen.py => network_devices_delete.py} | 13 +- ...imum_set_gen.py => network_devices_get.py} | 13 +- ...network_devices_list_by_resource_group.py} | 13 +- ...> network_devices_list_by_subscription.py} | 13 +- ...m_set_gen.py => network_devices_reboot.py} | 13 +- ... network_devices_refresh_configuration.py} | 13 +- .../network_devices_resync_certificates.py | 42 + ...twork_devices_resync_certificates_error.py | 42 + .../network_devices_resync_passwords.py | 42 + .../network_devices_resync_passwords_error.py | 42 + .../network_devices_run_ro_command.py | 43 + .../network_devices_run_rw_command.py | 46 + .../network_devices_update.py | 61 + ...rk_devices_update_administrative_state.py} | 13 +- ..._set_gen.py => network_devices_upgrade.py} | 17 +- ...y => network_fabric_controllers_create.py} | 22 +- ...y => network_fabric_controllers_delete.py} | 13 +- ...n.py => network_fabric_controllers_get.py} | 13 +- ...ric_controllers_list_by_resource_group.py} | 13 +- ...abric_controllers_list_by_subscription.py} | 13 +- ...y => network_fabric_controllers_update.py} | 22 +- ..._set_gen.py => network_fabric_skus_get.py} | 13 +- ...twork_fabric_skus_list_by_subscription.py} | 13 +- .../network_fabrics_arm_configuration_diff.py | 42 + .../network_fabrics_commit_batch_status.py | 43 + ...> network_fabrics_commit_configuration.py} | 15 +- ...m_set_gen.py => network_fabrics_create.py} | 58 +- ...m_set_gen.py => network_fabrics_delete.py} | 13 +- ..._gen.py => network_fabrics_deprovision.py} | 13 +- .../network_fabrics_discard_commit_batch.py | 43 + ...imum_set_gen.py => network_fabrics_get.py} | 13 +- ...gen.py => network_fabrics_get_topology.py} | 13 +- ...network_fabrics_list_by_resource_group.py} | 13 +- ...> network_fabrics_list_by_subscription.py} | 13 +- .../network_fabrics_lock_fabric.py | 43 + ...et_gen.py => network_fabrics_provision.py} | 13 +- ... network_fabrics_refresh_configuration.py} | 13 +- .../network_fabrics_resync_certificates.py | 42 + ...twork_fabrics_resync_certificates_error.py | 42 + ...ics_resync_certificates_partial_success.py | 42 + .../network_fabrics_resync_passwords.py | 42 + .../network_fabrics_resync_passwords_error.py | 42 + ...abrics_resync_passwords_partial_success.py | 42 + .../network_fabrics_rotate_certificates.py | 42 + ...twork_fabrics_rotate_certificates_error.py | 42 + ...ics_rotate_certificates_partial_success.py | 42 + .../network_fabrics_rotate_passwords.py | 42 + .../network_fabrics_rotate_passwords_error.py | 42 + ...abrics_rotate_passwords_partial_success.py | 42 + ...m_set_gen.py => network_fabrics_update.py} | 41 +- ...ate_infra_management_bfd_configuration.py} | 13 +- .../network_fabrics_update_qo_s.py | 43 + ..._workload_management_bfd_configuration.py} | 13 +- ..._set_gen.py => network_fabrics_upgrade.py} | 15 +- ...network_fabrics_validate_configuration.py} | 13 +- ...twork_fabrics_view_device_configuration.py | 42 + ...et_gen.py => network_interfaces_create.py} | 21 +- .../network_interfaces_delete.py | 42 + ...twork_interfaces_delete_maximum_set_gen.py | 41 - ...m_set_gen.py => network_interfaces_get.py} | 13 +- ...work_interfaces_list_by_network_device.py} | 13 +- ...et_gen.py => network_interfaces_update.py} | 15 +- ...interfaces_update_administrative_state.py} | 13 +- .../network_monitors_create.py | 67 + .../network_monitors_delete.py | 41 + .../generated_samples/network_monitors_get.py | 42 + ...network_monitors_list_by_resource_group.py | 42 + .../network_monitors_list_by_subscription.py | 40 + .../network_monitors_update.py | 64 + ...rk_monitors_update_administrative_state.py | 43 + ...en.py => network_packet_brokers_create.py} | 17 +- ...en.py => network_packet_brokers_delete.py} | 13 +- ...t_gen.py => network_packet_brokers_get.py} | 13 +- ..._packet_brokers_list_by_resource_group.py} | 13 +- ...rk_packet_brokers_list_by_subscription.py} | 13 +- ...en.py => network_packet_brokers_update.py} | 15 +- ...mum_set_gen.py => network_racks_create.py} | 16 +- ...mum_set_gen.py => network_racks_delete.py} | 13 +- ...aximum_set_gen.py => network_racks_get.py} | 13 +- ...> network_racks_list_by_resource_group.py} | 13 +- ... => network_racks_list_by_subscription.py} | 13 +- ...mum_set_gen.py => network_racks_update.py} | 15 +- ...set_gen.py => network_tap_rules_create.py} | 42 +- ...set_gen.py => network_tap_rules_delete.py} | 13 +- ...um_set_gen.py => network_tap_rules_get.py} | 13 +- ...twork_tap_rules_list_by_resource_group.py} | 13 +- ...network_tap_rules_list_by_subscription.py} | 13 +- ...set_gen.py => network_tap_rules_resync.py} | 13 +- ...set_gen.py => network_tap_rules_update.py} | 38 +- ...k_tap_rules_update_administrative_state.py | 49 + ...twork_tap_rules_validate_configuration.py} | 13 +- ...imum_set_gen.py => network_taps_create.py} | 18 +- ...imum_set_gen.py => network_taps_delete.py} | 13 +- ...maximum_set_gen.py => network_taps_get.py} | 13 +- ...=> network_taps_list_by_resource_group.py} | 13 +- ...y => network_taps_list_by_subscription.py} | 13 +- ...imum_set_gen.py => network_taps_resync.py} | 13 +- ...imum_set_gen.py => network_taps_update.py} | 17 +- ...twork_taps_update_administrative_state.py} | 13 +- ...etwork_to_network_interconnects_create.py} | 35 +- ...etwork_to_network_interconnects_delete.py} | 15 +- ...> network_to_network_interconnects_get.py} | 15 +- ...k_interconnects_list_by_network_fabric.py} | 15 +- ...etwork_to_network_interconnects_update.py} | 39 +- ...terconnects_update_administrative_state.py | 50 + ...nnects_update_bfd_administrative_state.py} | 19 +- ..._static_route_bfd_administrative_state.py} | 13 +- ...{list_operations.py => operations_list.py} | 11 +- ...=> route_policies_commit_configuration.py} | 13 +- ...um_set_gen.py => route_policies_create.py} | 18 +- ...um_set_gen.py => route_policies_delete.py} | 13 +- ...ximum_set_gen.py => route_policies_get.py} | 13 +- ... route_policies_list_by_resource_group.py} | 13 +- ...=> route_policies_list_by_subscription.py} | 13 +- ...um_set_gen.py => route_policies_update.py} | 19 +- ...e_policies_update_administrative_state.py} | 13 +- ... route_policies_validate_configuration.py} | 13 +- .../generated_tests/conftest.py | 39 + ..._fabric_access_control_lists_operations.py | 313 + ...c_access_control_lists_operations_async.py | 326 + ...ork_fabric_external_networks_operations.py | 241 + ...bric_external_networks_operations_async.py | 254 + ...ork_fabric_internal_networks_operations.py | 277 + ...bric_internal_networks_operations_async.py | 292 + ...abric_internet_gateway_rules_operations.py | 111 + ...internet_gateway_rules_operations_async.py | 118 + ...ork_fabric_internet_gateways_operations.py | 108 + ...bric_internet_gateways_operations_async.py | 115 + ...etwork_fabric_ip_communities_operations.py | 125 + ..._fabric_ip_communities_operations_async.py | 132 + ...bric_ip_extended_communities_operations.py | 112 + ...p_extended_communities_operations_async.py | 119 + ...d_network_fabric_ip_prefixes_operations.py | 128 + ...ork_fabric_ip_prefixes_operations_async.py | 135 + ..._fabric_l2_isolation_domains_operations.py | 161 + ...c_l2_isolation_domains_operations_async.py | 174 + ..._fabric_l3_isolation_domains_operations.py | 185 + ...c_l3_isolation_domains_operations_async.py | 198 + ...twork_fabric_neighbor_groups_operations.py | 134 + ...fabric_neighbor_groups_operations_async.py | 143 + ...ic_network_bootstrap_devices_operations.py | 183 + ...work_bootstrap_devices_operations_async.py | 200 + ...network_bootstrap_interfaces_operations.py | 119 + ...k_bootstrap_interfaces_operations_async.py | 128 + ...k_fabric_network_device_skus_operations.py | 37 + ...ic_network_device_skus_operations_async.py | 38 + ...twork_fabric_network_devices_operations.py | 253 + ...fabric_network_devices_operations_async.py | 276 + ...c_network_fabric_controllers_operations.py | 137 + ...ork_fabric_controllers_operations_async.py | 144 + ...k_fabric_network_fabric_skus_operations.py | 37 + ...ic_network_fabric_skus_operations_async.py | 38 + ...twork_fabric_network_fabrics_operations.py | 524 + ...fabric_network_fabrics_operations_async.py | 567 + ...rk_fabric_network_interfaces_operations.py | 132 + ...ric_network_interfaces_operations_async.py | 141 + ...work_fabric_network_monitors_operations.py | 148 + ...abric_network_monitors_operations_async.py | 165 + ...abric_network_packet_brokers_operations.py | 119 + ...network_packet_brokers_operations_async.py | 126 + ...network_fabric_network_racks_operations.py | 106 + ...k_fabric_network_racks_operations_async.py | 113 + ...ork_fabric_network_tap_rules_operations.py | 258 + ...bric_network_tap_rules_operations_async.py | 271 + ..._network_fabric_network_taps_operations.py | 165 + ...rk_fabric_network_taps_operations_async.py | 176 + ...ork_to_network_interconnects_operations.py | 231 + ..._network_interconnects_operations_async.py | 244 + .../test_managed_network_fabric_operations.py | 27 + ...managed_network_fabric_operations_async.py | 28 + ...etwork_fabric_route_policies_operations.py | 198 + ..._fabric_route_policies_operations_async.py | 211 + .../pyproject.toml | 82 + .../sdk_packaging.toml | 11 - .../azure-mgmt-managednetworkfabric/setup.py | 83 - .../tsp-location.yaml | 4 + 362 files changed, 114862 insertions(+), 73634 deletions(-) delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/_meta.json create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/_metadata.json create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/apiview-properties.json rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/{_managed_network_fabric_mgmt_client.py => _client.py} (70%) create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_utils/__init__.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_utils/model_base.py rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/{_serialization.py => _utils/serialization.py} (78%) create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_validation.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_vendor.py rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/{_managed_network_fabric_mgmt_client.py => _client.py} (70%) delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_access_control_lists_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_external_networks_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_internal_networks_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_internet_gateway_rules_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_internet_gateways_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_ip_communities_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_ip_extended_communities_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_ip_prefixes_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_l2_isolation_domains_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_l3_isolation_domains_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_neighbor_groups_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_device_skus_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_devices_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_fabric_controllers_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_fabric_skus_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_fabrics_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_interfaces_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_packet_brokers_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_racks_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_tap_rules_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_taps_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_to_network_interconnects_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_route_policies_operations.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/models/_enums.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/models/_managed_network_fabric_mgmt_client_enums.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/models/_models.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/models/_models_py3.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_access_control_lists_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_external_networks_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_internal_networks_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_internet_gateway_rules_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_internet_gateways_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_ip_communities_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_ip_extended_communities_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_ip_prefixes_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_l2_isolation_domains_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_l3_isolation_domains_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_neighbor_groups_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_device_skus_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_devices_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_fabric_controllers_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_fabric_skus_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_fabrics_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_interfaces_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_packet_brokers_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_racks_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_tap_rules_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_taps_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_to_network_interconnects_operations.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_route_policies_operations.py rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{access_control_lists_create_maximum_set_gen.py => access_control_lists_create.py} (75%) create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_create_control_plane_acl.py rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{access_control_lists_delete_maximum_set_gen.py => access_control_lists_delete.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{access_control_lists_get_maximum_set_gen.py => access_control_lists_get.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{access_control_lists_list_by_resource_group_maximum_set_gen.py => access_control_lists_list_by_resource_group.py} (74%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{access_control_lists_list_by_subscription_maximum_set_gen.py => access_control_lists_list_by_subscription.py} (73%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{access_control_lists_resync_maximum_set_gen.py => access_control_lists_resync.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{access_control_lists_update_maximum_set_gen.py => access_control_lists_update.py} (77%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{access_control_lists_update_administrative_state_maximum_set_gen.py => access_control_lists_update_administrative_state.py} (74%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{access_control_lists_validate_configuration_maximum_set_gen.py => access_control_lists_validate_configuration.py} (74%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{external_networks_create_maximum_set_gen.py => external_networks_create.py} (65%) create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_delete.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_delete_maximum_set_gen.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_get.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_get_maximum_set_gen.py rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{external_networks_list_by_l3_isolation_domain_maximum_set_gen.py => external_networks_list_by_l3_isolation_domain.py} (71%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{external_networks_update_maximum_set_gen.py => external_networks_update.py} (65%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{external_networks_update_administrative_state_maximum_set_gen.py => external_networks_update_administrative_state.py} (70%) create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_update_bfd_administrative_state.py rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{external_networks_update_static_route_bfd_administrative_state_maximum_set_gen.py => external_networks_update_static_route_bfd_administrative_state.py} (78%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{internal_networks_create_maximum_set_gen.py => internal_networks_create.py} (71%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{internal_networks_delete_maximum_set_gen.py => internal_networks_delete.py} (73%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{internal_networks_get_maximum_set_gen.py => internal_networks_get.py} (73%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{internal_networks_list_by_l3_isolation_domain_maximum_set_gen.py => internal_networks_list_by_l3_isolation_domain.py} (71%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{internal_networks_update_maximum_set_gen.py => internal_networks_update.py} (71%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{internal_networks_update_administrative_state_maximum_set_gen.py => internal_networks_update_administrative_state.py} (73%) create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_update_bfd_administrative_state.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_update_bgp_administrative_state.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_update_bgp_administrative_state_maximum_set_gen.py rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{internal_networks_update_static_route_bfd_administrative_state_maximum_set_gen.py => internal_networks_update_static_route_bfd_administrative_state.py} (78%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{internet_gateway_rules_create_maximum_set_gen.py => internet_gateway_rules_create.py} (67%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{internet_gateway_rules_delete_maximum_set_gen.py => internet_gateway_rules_delete.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{internet_gateway_rules_get_maximum_set_gen.py => internet_gateway_rules_get.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{internet_gateway_rules_list_by_resource_group_maximum_set_gen.py => internet_gateway_rules_list_by_resource_group.py} (74%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{internet_gateway_rules_list_by_subscription_maximum_set_gen.py => internet_gateway_rules_list_by_subscription.py} (73%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{internet_gateway_rules_update_maximum_set_gen.py => internet_gateway_rules_update.py} (73%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{internet_gateways_create_maximum_set_gen.py => internet_gateways_create.py} (80%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{internet_gateways_delete_maximum_set_gen.py => internet_gateways_delete.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{internet_gateways_get_maximum_set_gen.py => internet_gateways_get.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{internet_gateways_list_by_resource_group_maximum_set_gen.py => internet_gateways_list_by_resource_group.py} (74%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{internet_gateways_list_by_subscription_maximum_set_gen.py => internet_gateways_list_by_subscription.py} (73%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{internet_gateways_update_maximum_set_gen.py => internet_gateways_update.py} (77%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{ip_communities_create_maximum_set_gen.py => ip_communities_create.py} (79%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{ip_communities_delete_maximum_set_gen.py => ip_communities_delete.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{ip_communities_get_maximum_set_gen.py => ip_communities_get.py} (76%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{ip_communities_list_by_resource_group_maximum_set_gen.py => ip_communities_list_by_resource_group.py} (74%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{ip_communities_list_by_subscription_maximum_set_gen.py => ip_communities_list_by_subscription.py} (73%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{ip_communities_update_maximum_set_gen.py => ip_communities_update.py} (79%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{ip_extended_communities_create_maximum_set_gen.py => ip_extended_communities_create.py} (77%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{ip_extended_communities_delete_maximum_set_gen.py => ip_extended_communities_delete.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{ip_extended_communities_get_maximum_set_gen.py => ip_extended_communities_get.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{ip_extended_communities_list_by_resource_group_maximum_set_gen.py => ip_extended_communities_list_by_resource_group.py} (73%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{ip_extended_communities_list_by_subscription_maximum_set_gen.py => ip_extended_communities_list_by_subscription.py} (73%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{ip_extended_communities_update_maximum_set_gen.py => ip_extended_communities_update.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{ip_prefixes_create_maximum_set_gen.py => ip_prefixes_create.py} (80%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{ip_prefixes_delete_maximum_set_gen.py => ip_prefixes_delete.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{ip_prefixes_get_maximum_set_gen.py => ip_prefixes_get.py} (76%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{ip_prefixes_list_by_resource_group_maximum_set_gen.py => ip_prefixes_list_by_resource_group.py} (74%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{ip_prefixes_list_by_subscription_maximum_set_gen.py => ip_prefixes_list_by_subscription.py} (73%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{ip_prefixes_update_maximum_set_gen.py => ip_prefixes_update.py} (79%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{l2_isolation_domains_commit_configuration_maximum_set_gen.py => l2_isolation_domains_commit_configuration.py} (74%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{l2_isolation_domains_create_maximum_set_gen.py => l2_isolation_domains_create.py} (68%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{l2_isolation_domains_delete_maximum_set_gen.py => l2_isolation_domains_delete.py} (72%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{l2_isolation_domains_get_maximum_set_gen.py => l2_isolation_domains_get.py} (72%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{l2_isolation_domains_list_by_resource_group_maximum_set_gen.py => l2_isolation_domains_list_by_resource_group.py} (74%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{l2_isolation_domains_list_by_subscription_maximum_set_gen.py => l2_isolation_domains_list_by_subscription.py} (73%) create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_update.py rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{l2_isolation_domains_update_administrative_state_maximum_set_gen.py => l2_isolation_domains_update_administrative_state.py} (72%) delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_update_maximum_set_gen.py rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{l2_isolation_domains_validate_configuration_maximum_set_gen.py => l2_isolation_domains_validate_configuration.py} (74%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{l3_isolation_domains_commit_configuration_maximum_set_gen.py => l3_isolation_domains_commit_configuration.py} (74%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{l3_isolation_domains_create_maximum_set_gen.py => l3_isolation_domains_create.py} (64%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{l3_isolation_domains_delete_maximum_set_gen.py => l3_isolation_domains_delete.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{l3_isolation_domains_get_maximum_set_gen.py => l3_isolation_domains_get.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{l3_isolation_domains_list_by_resource_group_maximum_set_gen.py => l3_isolation_domains_list_by_resource_group.py} (74%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{l3_isolation_domains_list_by_subscription_maximum_set_gen.py => l3_isolation_domains_list_by_subscription.py} (73%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{l3_isolation_domains_update_maximum_set_gen.py => l3_isolation_domains_update.py} (62%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{l3_isolation_domains_update_administrative_state_maximum_set_gen.py => l3_isolation_domains_update_administrative_state.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{l3_isolation_domains_validate_configuration_maximum_set_gen.py => l3_isolation_domains_validate_configuration.py} (74%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{neighbor_groups_create_maximum_set_gen.py => neighbor_groups_create.py} (81%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{neighbor_groups_delete_maximum_set_gen.py => neighbor_groups_delete.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{neighbor_groups_get_maximum_set_gen.py => neighbor_groups_get.py} (76%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{neighbor_groups_list_by_resource_group_maximum_set_gen.py => neighbor_groups_list_by_resource_group.py} (74%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{neighbor_groups_list_by_subscription_maximum_set_gen.py => neighbor_groups_list_by_subscription.py} (73%) create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_resync.py rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{neighbor_groups_update_maximum_set_gen.py => neighbor_groups_update.py} (81%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_devices_create_maximum_set_gen.py => network_bootstrap_devices_create.py} (73%) create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_delete.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_get.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_list_by_resource_group.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_list_by_subscription.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_reboot.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_refresh_configuration.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_resync_passwords.py rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_devices_update_maximum_set_gen.py => network_bootstrap_devices_update.py} (72%) create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_update_administrative_state.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_upgrade.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_interfaces_create.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_interfaces_delete.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_interfaces_get.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_interfaces_list_by_network_bootstrap_device.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_interfaces_update.py rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_tap_rules_update_administrative_state_maximum_set_gen.py => network_bootstrap_interfaces_update_administrative_state.py} (68%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_device_skus_get_maximum_set_gen.py => network_device_skus_get.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_device_skus_list_by_subscription_maximum_set_gen.py => network_device_skus_list_by_subscription.py} (73%) create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_create.py rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_devices_delete_maximum_set_gen.py => network_devices_delete.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_devices_get_maximum_set_gen.py => network_devices_get.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_devices_list_by_resource_group_maximum_set_gen.py => network_devices_list_by_resource_group.py} (74%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_devices_list_by_subscription_maximum_set_gen.py => network_devices_list_by_subscription.py} (73%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_devices_reboot_maximum_set_gen.py => network_devices_reboot.py} (76%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_devices_refresh_configuration_maximum_set_gen.py => network_devices_refresh_configuration.py} (74%) create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_resync_certificates.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_resync_certificates_error.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_resync_passwords.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_resync_passwords_error.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_run_ro_command.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_run_rw_command.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_update.py rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_devices_update_administrative_state_maximum_set_gen.py => network_devices_update_administrative_state.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_devices_upgrade_maximum_set_gen.py => network_devices_upgrade.py} (71%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_fabric_controllers_create_maximum_set_gen.py => network_fabric_controllers_create.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_fabric_controllers_delete_maximum_set_gen.py => network_fabric_controllers_delete.py} (74%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_fabric_controllers_get_maximum_set_gen.py => network_fabric_controllers_get.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_fabric_controllers_list_by_resource_group_maximum_set_gen.py => network_fabric_controllers_list_by_resource_group.py} (73%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_fabric_controllers_list_by_subscription_maximum_set_gen.py => network_fabric_controllers_list_by_subscription.py} (72%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_fabric_controllers_update_maximum_set_gen.py => network_fabric_controllers_update.py} (76%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_fabric_skus_get_maximum_set_gen.py => network_fabric_skus_get.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_fabric_skus_list_by_subscription_maximum_set_gen.py => network_fabric_skus_list_by_subscription.py} (73%) create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_arm_configuration_diff.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_commit_batch_status.py rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_fabrics_commit_configuration_maximum_set_gen.py => network_fabrics_commit_configuration.py} (72%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_fabrics_create_maximum_set_gen.py => network_fabrics_create.py} (72%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_fabrics_delete_maximum_set_gen.py => network_fabrics_delete.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_fabrics_deprovision_maximum_set_gen.py => network_fabrics_deprovision.py} (75%) create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_discard_commit_batch.py rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_fabrics_get_maximum_set_gen.py => network_fabrics_get.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_fabrics_get_topology_maximum_set_gen.py => network_fabrics_get_topology.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_fabrics_list_by_resource_group_maximum_set_gen.py => network_fabrics_list_by_resource_group.py} (74%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_fabrics_list_by_subscription_maximum_set_gen.py => network_fabrics_list_by_subscription.py} (73%) create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_lock_fabric.py rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_fabrics_provision_maximum_set_gen.py => network_fabrics_provision.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_fabrics_refresh_configuration_maximum_set_gen.py => network_fabrics_refresh_configuration.py} (74%) create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_resync_certificates.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_resync_certificates_error.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_resync_certificates_partial_success.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_resync_passwords.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_resync_passwords_error.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_resync_passwords_partial_success.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_rotate_certificates.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_rotate_certificates_error.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_rotate_certificates_partial_success.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_rotate_passwords.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_rotate_passwords_error.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_rotate_passwords_partial_success.py rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_fabrics_update_maximum_set_gen.py => network_fabrics_update.py} (72%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_fabrics_update_infra_management_bfd_configuration_maximum_set_gen.py => network_fabrics_update_infra_management_bfd_configuration.py} (77%) create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_update_qo_s.py rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_fabrics_update_workload_management_bfd_configuration_maximum_set_gen.py => network_fabrics_update_workload_management_bfd_configuration.py} (77%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_fabrics_upgrade_maximum_set_gen.py => network_fabrics_upgrade.py} (74%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_fabrics_validate_configuration_maximum_set_gen.py => network_fabrics_validate_configuration.py} (75%) create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_view_device_configuration.py rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_interfaces_create_maximum_set_gen.py => network_interfaces_create.py} (73%) create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_delete.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_delete_maximum_set_gen.py rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_interfaces_get_maximum_set_gen.py => network_interfaces_get.py} (76%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_interfaces_list_by_network_device_maximum_set_gen.py => network_interfaces_list_by_network_device.py} (74%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_interfaces_update_maximum_set_gen.py => network_interfaces_update.py} (73%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_interfaces_update_administrative_state_maximum_set_gen.py => network_interfaces_update_administrative_state.py} (75%) create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_monitors_create.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_monitors_delete.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_monitors_get.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_monitors_list_by_resource_group.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_monitors_list_by_subscription.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_monitors_update.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_monitors_update_administrative_state.py rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_packet_brokers_create_maximum_set_gen.py => network_packet_brokers_create.py} (77%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_packet_brokers_delete_maximum_set_gen.py => network_packet_brokers_delete.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_packet_brokers_get_maximum_set_gen.py => network_packet_brokers_get.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_packet_brokers_list_by_resource_group_maximum_set_gen.py => network_packet_brokers_list_by_resource_group.py} (73%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_packet_brokers_list_by_subscription_maximum_set_gen.py => network_packet_brokers_list_by_subscription.py} (73%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_packet_brokers_update_maximum_set_gen.py => network_packet_brokers_update.py} (73%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_racks_create_maximum_set_gen.py => network_racks_create.py} (78%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_racks_delete_maximum_set_gen.py => network_racks_delete.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_racks_get_maximum_set_gen.py => network_racks_get.py} (76%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_racks_list_by_resource_group_maximum_set_gen.py => network_racks_list_by_resource_group.py} (74%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_racks_list_by_subscription_maximum_set_gen.py => network_racks_list_by_subscription.py} (73%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_racks_update_maximum_set_gen.py => network_racks_update.py} (73%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_tap_rules_create_maximum_set_gen.py => network_tap_rules_create.py} (71%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_tap_rules_delete_maximum_set_gen.py => network_tap_rules_delete.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_tap_rules_get_maximum_set_gen.py => network_tap_rules_get.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_tap_rules_list_by_resource_group_maximum_set_gen.py => network_tap_rules_list_by_resource_group.py} (74%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_tap_rules_list_by_subscription_maximum_set_gen.py => network_tap_rules_list_by_subscription.py} (73%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_tap_rules_resync_maximum_set_gen.py => network_tap_rules_resync.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_tap_rules_update_maximum_set_gen.py => network_tap_rules_update.py} (72%) create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_update_administrative_state.py rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_tap_rules_validate_configuration_maximum_set_gen.py => network_tap_rules_validate_configuration.py} (74%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_taps_create_maximum_set_gen.py => network_taps_create.py} (85%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_taps_delete_maximum_set_gen.py => network_taps_delete.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_taps_get_maximum_set_gen.py => network_taps_get.py} (76%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_taps_list_by_resource_group_maximum_set_gen.py => network_taps_list_by_resource_group.py} (74%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_taps_list_by_subscription_maximum_set_gen.py => network_taps_list_by_subscription.py} (73%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_taps_resync_maximum_set_gen.py => network_taps_resync.py} (76%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_taps_update_maximum_set_gen.py => network_taps_update.py} (84%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_taps_update_administrative_state_maximum_set_gen.py => network_taps_update_administrative_state.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_to_network_interconnects_create_maximum_set_gen.py => network_to_network_interconnects_create.py} (72%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_to_network_interconnects_delete_maximum_set_gen.py => network_to_network_interconnects_delete.py} (72%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_to_network_interconnects_get_maximum_set_gen.py => network_to_network_interconnects_get.py} (72%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_to_network_interconnects_list_by_network_fabric_maximum_set_gen.py => network_to_network_interconnects_list_by_network_fabric.py} (74%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_to_network_interconnects_update_maximum_set_gen.py => network_to_network_interconnects_update.py} (75%) create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_update_administrative_state.py rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_to_network_interconnects_update_administrative_state_maximum_set_gen.py => network_to_network_interconnects_update_bfd_administrative_state.py} (68%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{network_to_network_interconnects_update_npb_static_route_bfd_administrative_state_maximum_set_gen.py => network_to_network_interconnects_update_npb_static_route_bfd_administrative_state.py} (77%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{list_operations.py => operations_list.py} (80%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{route_policies_commit_configuration_maximum_set_gen.py => route_policies_commit_configuration.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{route_policies_create_maximum_set_gen.py => route_policies_create.py} (92%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{route_policies_delete_maximum_set_gen.py => route_policies_delete.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{route_policies_get_maximum_set_gen.py => route_policies_get.py} (76%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{route_policies_list_by_resource_group_maximum_set_gen.py => route_policies_list_by_resource_group.py} (74%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{route_policies_list_by_subscription_maximum_set_gen.py => route_policies_list_by_subscription.py} (73%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{route_policies_update_maximum_set_gen.py => route_policies_update.py} (91%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{route_policies_update_administrative_state_maximum_set_gen.py => route_policies_update_administrative_state.py} (75%) rename sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/{route_policies_validate_configuration_maximum_set_gen.py => route_policies_validate_configuration.py} (74%) create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/conftest.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_access_control_lists_operations.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_access_control_lists_operations_async.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_external_networks_operations.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_external_networks_operations_async.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_internal_networks_operations.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_internal_networks_operations_async.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_internet_gateway_rules_operations.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_internet_gateway_rules_operations_async.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_internet_gateways_operations.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_internet_gateways_operations_async.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_ip_communities_operations.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_ip_communities_operations_async.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_ip_extended_communities_operations.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_ip_extended_communities_operations_async.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_ip_prefixes_operations.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_ip_prefixes_operations_async.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_l2_isolation_domains_operations.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_l2_isolation_domains_operations_async.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_l3_isolation_domains_operations.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_l3_isolation_domains_operations_async.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_neighbor_groups_operations.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_neighbor_groups_operations_async.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_bootstrap_devices_operations.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_bootstrap_devices_operations_async.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_bootstrap_interfaces_operations.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_bootstrap_interfaces_operations_async.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_device_skus_operations.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_device_skus_operations_async.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_devices_operations.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_devices_operations_async.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_fabric_controllers_operations.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_fabric_controllers_operations_async.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_fabric_skus_operations.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_fabric_skus_operations_async.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_fabrics_operations.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_fabrics_operations_async.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_interfaces_operations.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_interfaces_operations_async.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_monitors_operations.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_monitors_operations_async.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_packet_brokers_operations.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_packet_brokers_operations_async.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_racks_operations.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_racks_operations_async.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_tap_rules_operations.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_tap_rules_operations_async.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_taps_operations.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_taps_operations_async.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_to_network_interconnects_operations.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_to_network_interconnects_operations_async.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_operations.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_operations_async.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_route_policies_operations.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_route_policies_operations_async.py delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/sdk_packaging.toml delete mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/setup.py create mode 100644 sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/tsp-location.yaml diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/CHANGELOG.md b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/CHANGELOG.md index 60e7ecde0525..2a4a145cbcff 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/CHANGELOG.md +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/CHANGELOG.md @@ -1,5 +1,732 @@ # Release History +## 2.0.0 (2026-04-01) + +### Features Added + + - Model `AccessControlList` added property `properties` + - Model `AccessControlListAction` added property `remark_comment` + - Model `AccessControlListAction` added property `police_rate_configuration` + - Model `AccessControlListMatchCondition` added property `protocol_neighbors` + - Model `AccessControlListMatchCondition` added property `icmp_configuration` + - Model `AccessControlListPatch` added property `properties` + - Model `AccessControlListPatchProperties` added property `default_action` + - Model `AccessControlListPatchProperties` added property `control_plane_acl_configuration` + - Model `AccessControlListPatchProperties` added property `acl_type` + - Model `AccessControlListPatchProperties` added property `device_role` + - Model `AccessControlListPatchProperties` added property `global_access_control_list_actions` + - Model `AccessControlListProperties` added property `default_action` + - Model `AccessControlListProperties` added property `acl_type` + - Model `AccessControlListProperties` added property `device_role` + - Model `AccessControlListProperties` added property `global_access_control_list_actions` + - Model `AccessControlListProperties` added property `last_operation` + - Model `AccessControlListProperties` added property `network_fabric_ids` + - Model `AccessControlListProperties` added property `control_plane_acl_configuration` + - Enum `AclActionType` added member `POLICE_RATE` + - Enum `AclActionType` added member `REMARK` + - Enum `AdministrativeState` added member `ENABLED_DEGRADED` + - Enum `AdministrativeState` added member `UNDER_MAINTENANCE` + - Model `BgpConfiguration` added property `bmp_configuration` + - Model `BgpConfiguration` added property `v4_over_v6_bgp_session` + - Model `BgpConfiguration` added property `v6_over_v4_bgp_session` + - Enum `ConfigurationState` added member `PENDING_ADMINISTRATIVE_UPDATE` + - Enum `ConfigurationState` added member `PENDING_COMMIT` + - Enum `ConfigurationState` added member `PROVISIONING` + - Enum `DeviceAdministrativeState` added member `DISABLE` + - Enum `DeviceAdministrativeState` added member `ENABLE` + - Enum `DeviceAdministrativeState` added member `UNDER_MAINTENANCE` + - Enum `DeviceAdministrativeState` added member `UNGRACEFUL_QUARANTINE` + - Enum `DeviceAdministrativeState` added member `UNGRACEFUL_RMA` + - Enum `EnableDisableState` added member `UNDER_MAINTENANCE` + - Model `ExternalNetwork` added property `properties` + - Model `ExternalNetworkPatchProperties` added property `network_to_network_interconnect_id` + - Model `ExternalNetworkPatchProperties` added property `static_route_configuration` + - Model `ExternalNetworkPatchPropertiesOptionAProperties` added property `bmp_configuration` + - Model `ExternalNetworkPatchPropertiesOptionAProperties` added property `v4_over_v6_bgp_session` + - Model `ExternalNetworkPatchPropertiesOptionAProperties` added property `v6_over_v4_bgp_session` + - Model `ExternalNetworkPatchPropertiesOptionAProperties` added property `native_ipv4_prefix_limit` + - Model `ExternalNetworkPatchPropertiesOptionAProperties` added property `native_ipv6_prefix_limit` + - Model `ExternalNetworkProperties` added property `static_route_configuration` + - Model `ExternalNetworkProperties` added property `last_operation` + - Model `ExternalNetworkProperties` added property `network_fabric_id` + - Model `ExternalNetworkPropertiesOptionAProperties` added property `bmp_configuration` + - Model `ExternalNetworkPropertiesOptionAProperties` added property `v4_over_v6_bgp_session` + - Model `ExternalNetworkPropertiesOptionAProperties` added property `v6_over_v4_bgp_session` + - Model `ExternalNetworkPropertiesOptionAProperties` added property `native_ipv4_prefix_limit` + - Model `ExternalNetworkPropertiesOptionAProperties` added property `native_ipv6_prefix_limit` + - Model `InternalNetwork` added property `properties` + - Model `InternalNetworkPatchProperties` added property `native_ipv4_prefix_limit` + - Model `InternalNetworkPatchProperties` added property `native_ipv6_prefix_limit` + - Model `InternalNetworkProperties` added property `native_ipv4_prefix_limit` + - Model `InternalNetworkProperties` added property `native_ipv6_prefix_limit` + - Model `InternalNetworkProperties` added property `last_operation` + - Model `InternalNetworkProperties` added property `network_fabric_id` + - Model `InternetGateway` added property `properties` + - Model `InternetGatewayProperties` added property `internet_gateway_type` + - Model `InternetGatewayProperties` added property `last_operation` + - Model `InternetGatewayRule` added property `properties` + - Model `InternetGatewayRuleProperties` added property `last_operation` + - Model `IpCommunity` added property `properties` + - Model `IpCommunityPatch` added property `properties` + - Model `IpCommunityProperties` added property `network_fabric_id` + - Model `IpCommunityProperties` added property `last_operation` + - Model `IpExtendedCommunity` added property `properties` + - Model `IpExtendedCommunityPatch` added property `properties` + - Model `IpExtendedCommunityProperties` added property `network_fabric_id` + - Model `IpExtendedCommunityProperties` added property `last_operation` + - Model `IpPrefix` added property `properties` + - Model `IpPrefixPatch` added property `properties` + - Model `IpPrefixProperties` added property `network_fabric_id` + - Model `IpPrefixProperties` added property `last_operation` + - Model `L2IsolationDomain` added property `properties` + - Model `L2IsolationDomain` added property `identity` + - Model `L2IsolationDomainPatch` added property `properties` + - Model `L2IsolationDomainPatch` added property `identity` + - Model `L2IsolationDomainPatchProperties` added property `extended_vlan` + - Model `L2IsolationDomainPatchProperties` added property `network_to_network_interconnect_id` + - Model `L2IsolationDomainProperties` added property `extended_vlan` + - Model `L2IsolationDomainProperties` added property `network_to_network_interconnect_id` + - Model `L2IsolationDomainProperties` added property `last_operation` + - Model `L3IsolationDomain` added property `properties` + - Model `L3IsolationDomain` added property `identity` + - Model `L3IsolationDomainPatch` added property `properties` + - Model `L3IsolationDomainPatch` added property `identity` + - Model `L3IsolationDomainPatchProperties` added property `static_route_route_policy` + - Model `L3IsolationDomainPatchProperties` added property `v4_route_prefix_limit` + - Model `L3IsolationDomainPatchProperties` added property `v6_route_prefix_limit` + - Model `L3IsolationDomainPatchProperties` added property `export_policy_configuration` + - Model `L3IsolationDomainProperties` added property `static_route_route_policy` + - Model `L3IsolationDomainProperties` added property `unique_rd_configuration` + - Model `L3IsolationDomainProperties` added property `v4_route_prefix_limit` + - Model `L3IsolationDomainProperties` added property `v6_route_prefix_limit` + - Model `L3IsolationDomainProperties` added property `last_operation` + - Model `L3IsolationDomainProperties` added property `export_policy_configuration` + - Enum `Layer4Protocol` added member `SCTP` + - Model `NeighborAddress` added property `bfd_administrative_state` + - Model `NeighborAddress` added property `bgp_administrative_state` + - Model `NeighborGroup` added property `properties` + - Model `NeighborGroup` added property `identity` + - Model `NeighborGroupPatch` added property `properties` + - Model `NeighborGroupPatch` added property `identity` + - Model `NeighborGroupProperties` added property `network_fabric_ids` + - Model `NeighborGroupProperties` added property `last_operation` + - Model `NeighborGroupProperties` added property `configuration_state` + - Model `NetworkDevice` added property `properties` + - Model `NetworkDevice` added property `identity` + - Model `NetworkDevicePatchParameters` added property `properties` + - Model `NetworkDevicePatchParameters` added property `identity` + - Model `NetworkDevicePatchParametersProperties` added property `identity_selector` + - Model `NetworkDeviceProperties` added property `identity_selector` + - Model `NetworkDeviceProperties` added property `rw_device_config` + - Model `NetworkDeviceProperties` added property `last_operation` + - Model `NetworkDeviceProperties` added property `secret_rotation_status` + - Model `NetworkDeviceProperties` added property `certificate_rotation_status` + - Model `NetworkDeviceProperties` added property `network_fabric_id` + - Model `NetworkFabric` added property `properties` + - Model `NetworkFabric` added property `identity` + - Model `NetworkFabricController` added property `properties` + - Model `NetworkFabricController` added property `identity` + - Model `NetworkFabricControllerPatch` added property `identity` + - Model `NetworkFabricControllerProperties` added property `last_operation` + - Model `NetworkFabricPatch` added property `properties` + - Model `NetworkFabricPatch` added property `identity` + - Model `NetworkFabricPatchProperties` added property `storage_account_configuration` + - Model `NetworkFabricPatchProperties` added property `hardware_alert_threshold` + - Model `NetworkFabricPatchProperties` added property `control_plane_acls` + - Model `NetworkFabricPatchProperties` added property `trusted_ip_prefixes` + - Model `NetworkFabricPatchProperties` added property `unique_rd_configuration` + - Model `NetworkFabricPatchProperties` added property `qos_configuration` + - Model `NetworkFabricPatchProperties` added property `feature_flags` + - Model `NetworkFabricPatchProperties` added property `authorized_transceiver` + - Model `NetworkFabricProperties` added property `storage_account_configuration` + - Model `NetworkFabricProperties` added property `fabric_locks` + - Model `NetworkFabricProperties` added property `hardware_alert_threshold` + - Model `NetworkFabricProperties` added property `control_plane_acls` + - Model `NetworkFabricProperties` added property `feature_flags` + - Model `NetworkFabricProperties` added property `trusted_ip_prefixes` + - Model `NetworkFabricProperties` added property `unique_rd_configuration` + - Model `NetworkFabricProperties` added property `storage_array_count` + - Model `NetworkFabricProperties` added property `active_commit_batches` + - Model `NetworkFabricProperties` added property `secret_rotation_summary` + - Model `NetworkFabricProperties` added property `last_operation` + - Model `NetworkFabricProperties` added property `authorized_transceiver` + - Model `NetworkFabricProperties` added property `qos_configuration` + - Model `NetworkInterface` added property `properties` + - Model `NetworkInterface` added property `identity` + - Model `NetworkInterfacePatchProperties` added property `additional_description` + - Model `NetworkInterfaceProperties` added property `description` + - Model `NetworkInterfaceProperties` added property `additional_description` + - Model `NetworkInterfaceProperties` added property `last_operation` + - Model `NetworkInterfaceProperties` added property `network_fabric_id` + - Model `NetworkInterfaceProperties` added property `configuration_state` + - Model `NetworkPacketBroker` added property `identity` + - Model `NetworkPacketBrokerPatch` added property `identity` + - Model `NetworkRack` added property `properties` + - Model `NetworkRackProperties` added property `last_operation` + - Model `NetworkRackProperties` added property `configuration_state` + - Model `NetworkTap` added property `properties` + - Model `NetworkTap` added property `identity` + - Model `NetworkTapPatch` added property `identity` + - Model `NetworkTapProperties` added property `network_fabric_ids` + - Model `NetworkTapProperties` added property `last_operation` + - Model `NetworkTapRule` added property `properties` + - Model `NetworkTapRule` added property `identity` + - Model `NetworkTapRulePatch` added property `properties` + - Model `NetworkTapRulePatch` added property `identity` + - Model `NetworkTapRulePatchProperties` added property `identity_selector` + - Model `NetworkTapRulePatchProperties` added property `global_network_tap_rule_actions` + - Model `NetworkTapRuleProperties` added property `identity_selector` + - Model `NetworkTapRuleProperties` added property `network_tap_ids` + - Model `NetworkTapRuleProperties` added property `global_network_tap_rule_actions` + - Model `NetworkTapRuleProperties` added property `last_operation` + - Model `NetworkTapRuleProperties` added property `network_fabric_ids` + - Model `OptionBLayer3Configuration` added property `pe_loopback_ip_address` + - Model `OptionBLayer3Configuration` added property `bmp_configuration` + - Model `OptionBLayer3Configuration` added property `prefix_limits` + - Enum `PortType` added member `BIDIRECTIONAL` + - Model `RoutePolicy` added property `properties` + - Model `RoutePolicyPatch` added property `properties` + - Model `RoutePolicyPatchableProperties` added property `default_action` + - Model `RoutePolicyProperties` added property `default_action` + - Model `RoutePolicyProperties` added property `last_operation` + - Model `RuleProperties` added property `condition` + - Model `RuleProperties` added property `destination_address_list` + - Model `RuleProperties` added property `source_address_list` + - Model `RuleProperties` added property `header_address_list` + - Enum `SourceDestinationType` added member `BIDIRECTIONAL` + - Model `StaticRouteConfiguration` added property `extension` + - Model `TerminalServerConfiguration` added property `secret_rotation_status` + - Added model `AccessControlListActionPatch` + - Added model `AccessControlListMatchConditionPatch` + - Added model `AccessControlListMatchConfigurationPatch` + - Added model `AccessControlListPortConditionPatch` + - Added enum `AclType` + - Added model `ActionIpCommunityPatchProperties` + - Added model `ActionIpExtendedCommunityPatchProperties` + - Added model `AggregateRoutePatchConfiguration` + - Added model `ArmConfigurationDiffOperationResponse` + - Added model `ArmConfigurationDiffResponseProperties` + - Added model `AuthorizedTransceiverPatchProperties` + - Added model `AuthorizedTransceiverProperties` + - Added model `BfdPatchConfiguration` + - Added enum `BgpAdministrativeState` + - Added model `BgpPatchConfiguration` + - Added model `BitRate` + - Added enum `BitRateUnit` + - Added model `BmpConfigurationPatchProperties` + - Added model `BmpConfigurationProperties` + - Added enum `BmpConfigurationState` + - Added enum `BmpExportPolicy` + - Added model `BmpExportPolicyPatchProperties` + - Added model `BmpExportPolicyProperties` + - Added enum `BmpMonitoredAddressFamily` + - Added model `BurstSize` + - Added enum `BurstSizeUnit` + - Added model `CertificateArchiveReference` + - Added model `CertificateRotationStatus` + - Added model `CommitBatchDetails` + - Added enum `CommitBatchState` + - Added model `CommitBatchStatusOperationResponse` + - Added model `CommitBatchStatusRequest` + - Added model `CommitBatchStatusResponseProperties` + - Added enum `CommitConfigurationPolicy` + - Added model `CommitConfigurationRequest` + - Added model `CommitConfigurationResponse` + - Added enum `CommitStage` + - Added model `CommonDynamicMatchConfigurationPatch` + - Added model `CommonErrorResponse` + - Added model `CommonMatchConditionsPatch` + - Added model `CommonPostActionResponseForDeviceROCommands` + - Added model `CommonPostActionResponseForDeviceROCommandsOperationStatusResult` + - Added model `ConditionalDefaultRouteProperties` + - Added model `ConnectedSubnetPatch` + - Added model `ConnectedSubnetRoutePolicyPatch` + - Added model `ControlPlanAclIpMatchCondition` + - Added model `ControlPlaneAclAction` + - Added model `ControlPlaneAclActionPatch` + - Added enum `ControlPlaneAclActionType` + - Added model `ControlPlaneAclIpMatchConditionPatch` + - Added model `ControlPlaneAclMatchCondition` + - Added model `ControlPlaneAclMatchConditionPatch` + - Added model `ControlPlaneAclMatchConfigurationPatchProperties` + - Added model `ControlPlaneAclMatchConfigurationProperties` + - Added model `ControlPlaneAclPatchProperties` + - Added model `ControlPlaneAclPortCondition` + - Added model `ControlPlaneAclPortMatchCondition` + - Added model `ControlPlaneAclPortMatchConditionPatch` + - Added enum `ControlPlaneAclPortMatchType` + - Added model `ControlPlaneAclProperties` + - Added model `ControlPlaneAclTtlMatchCondition` + - Added model `ControlPlaneAclTtlMatchConditionPatch` + - Added enum `ControlPlaneAclTtlMatchType` + - Added model `DestinationPatchProperties` + - Added model `DeviceRoCommand` + - Added enum `DeviceRole` + - Added model `DeviceRwCommand` + - Added model `DiscardCommitBatchOperationResponse` + - Added model `DiscardCommitBatchRequest` + - Added model `DiscardCommitBatchResponseProperties` + - Added model `ExportRoutePolicyInformationPatch` + - Added model `ExportRoutePolicyPatch` + - Added enum `ExtendedVlan` + - Added model `ExternalNetworkBmpPatchProperties` + - Added model `ExternalNetworkBmpProperties` + - Added enum `ExternalNetworkRouteType` + - Added model `ExternalNetworkStaticRouteConfiguration` + - Added model `ExternalNetworkStaticRoutePatchConfiguration` + - Added model `ExternalNetworkUpdateBfdAdministrativeStateRequest` + - Added model `ExternalNetworkUpdateBfdAdministrativeStateResponse` + - Added model `ExternalNetworkUpdateBfdAdministrativeStateResponseProperties` + - Added model `FabricLockProperties` + - Added model `FeatureFlagProperties` + - Added model `GetTopologyResponse` + - Added model `GetTopologyResponseProperties` + - Added model `GlobalAccessControlListActionPatchProperties` + - Added model `GlobalAccessControlListActionProperties` + - Added model `GlobalNetworkTapRuleActionPatchProperties` + - Added model `GlobalNetworkTapRuleActionProperties` + - Added model `HeaderAddressProperties` + - Added model `IcmpConfigurationPatchProperties` + - Added model `IcmpConfigurationProperties` + - Added model `IdentitySelector` + - Added model `IdentitySelectorPatch` + - Added model `ImportRoutePolicyInformationPatch` + - Added model `ImportRoutePolicyPatch` + - Added model `InternalNetworkBmpPatchProperties` + - Added model `InternalNetworkBmpProperties` + - Added enum `InternalNetworkRouteType` + - Added model `InternalNetworkUpdateBfdAdministrativeStateRequest` + - Added model `InternalNetworkUpdateBfdAdministrativeStateResponse` + - Added model `InternalNetworkUpdateBfdAdministrativeStateResponseProperties` + - Added model `InternalNetworkUpdateBgpAdministrativeStateRequest` + - Added model `InternalNetworkUpdateBgpAdministrativeStateResponse` + - Added model `InternalNetworkUpdateBgpAdministrativeStateResponseProperties` + - Added model `IpGroupPatchProperties` + - Added model `IpMatchConditionPatch` + - Added model `IsolationDomainPatchProperties` + - Added model `L3ExportRoutePolicyPatch` + - Added model `L3OptionBPatchProperties` + - Added model `L3UniqueRouteDistinguisherProperties` + - Added model `LastOperationProperties` + - Added model `Layer2ConfigurationPatch` + - Added model `Layer3IpPrefixPatchProperties` + - Added enum `LockConfigurationState` + - Added model `ManagedServiceIdentity` + - Added model `ManagedServiceIdentityPatch` + - Added enum `ManagedServiceIdentitySelectorType` + - Added enum `ManagedServiceIdentityType` + - Added model `ManagementNetworkPatchConfiguration` + - Added enum `MicroBfdState` + - Added enum `NNIDerivedUniqueRouteDistinguisherConfigurationState` + - Added model `NativeIpv4PrefixLimitPatchProperties` + - Added model `NativeIpv4PrefixLimitProperties` + - Added model `NativeIpv6PrefixLimitPatchProperties` + - Added model `NativeIpv6PrefixLimitProperties` + - Added model `NeighborAddressBfdAdministrativeStatus` + - Added model `NeighborAddressBgpAdministrativeStatus` + - Added model `NeighborAddressPatch` + - Added model `NeighborGroupDestinationPatch` + - Added model `NeighborGroupResyncResponse` + - Added model `NetworkBootstrapDevice` + - Added model `NetworkBootstrapDevicePatch` + - Added model `NetworkBootstrapDevicePatchProperties` + - Added model `NetworkBootstrapDeviceProperties` + - Added model `NetworkBootstrapDeviceRebootResponse` + - Added model `NetworkBootstrapDeviceRefreshConfigurationResponse` + - Added model `NetworkBootstrapDeviceResyncPasswordsResponse` + - Added model `NetworkBootstrapDeviceUpdateAdministrativeStateResponse` + - Added model `NetworkBootstrapDeviceUpgradeResponse` + - Added model `NetworkBootstrapInterface` + - Added model `NetworkBootstrapInterfacePatch` + - Added model `NetworkBootstrapInterfacePatchProperties` + - Added model `NetworkBootstrapInterfaceProperties` + - Added model `NetworkDeviceRefreshConfigurationResponse` + - Added model `NetworkDeviceResyncPasswordsResponse` + - Added model `NetworkDeviceRunRwCommandResponse` + - Added model `NetworkDeviceRwCommandResponseProperties` + - Added model `NetworkDeviceUpdateAdministrativeStateResponse` + - Added model `NetworkDeviceUpgradeRequest` + - Added model `NetworkDeviceUpgradeResponse` + - Added enum `NetworkFabricLockAction` + - Added model `NetworkFabricLockRequest` + - Added enum `NetworkFabricLockType` + - Added model `NetworkFabricResyncCertificatesResponse` + - Added model `NetworkFabricResyncPasswordsResponse` + - Added model `NetworkFabricRotateCertificatesResponse` + - Added model `NetworkFabricRotatePasswordsResponse` + - Added enum `NetworkFabricUpgradeAction` + - Added model `NetworkMonitor` + - Added model `NetworkMonitorPatch` + - Added model `NetworkMonitorPatchProperties` + - Added model `NetworkMonitorProperties` + - Added model `NetworkRackPatch` + - Added model `NetworkTapResyncResponse` + - Added model `NetworkTapRuleActionPatch` + - Added model `NetworkTapRuleMatchConditionPatch` + - Added model `NetworkTapRuleMatchConfigurationPatch` + - Added model `NetworkTapRuleResyncResponse` + - Added model `NniBmpPatchProperties` + - Added model `NniBmpProperties` + - Added model `NniStaticRouteConfiguration` + - Added model `NniStaticRoutePatchConfiguration` + - Added model `NniUpdateBfdAdministrativeStateRequest` + - Added model `NniUpdateBfdAdministrativeStateResponse` + - Added model `NniUpdateBfdAdministrativeStateResponseProperties` + - Added model `NpbStaticRouteConfigurationPatch` + - Added model `OperationStatusResult` + - Added model `OptionBLayer3ConfigurationPatchProperties` + - Added model `OptionBLayer3PrefixLimitPatchProperties` + - Added model `OptionBLayer3PrefixLimitProperties` + - Added model `PoliceRateConfigurationProperties` + - Added model `PortConditionPatch` + - Added model `PortGroupPatchProperties` + - Added model `PrefixLimitPatchProperties` + - Added model `PrefixLimitProperties` + - Added model `ProxyResourceBase` + - Added enum `QosConfigurationState` + - Added model `QosPatchProperties` + - Added model `QosProperties` + - Added model `RoutePolicyStatementPatchProperties` + - Added model `RoutePrefixLimitPatchProperties` + - Added model `RoutePrefixLimitProperties` + - Added model `RouteTargetPatchInformation` + - Added enum `RouteType` + - Added enum `RuleCondition` + - Added model `SecretArchiveReference` + - Added model `SecretRotationStatus` + - Added model `SecretRotationSummary` + - Added model `StatementActionPatchProperties` + - Added model `StatementConditionPatchProperties` + - Added model `StaticRoutePatchConfiguration` + - Added model `StaticRoutePatchProperties` + - Added model `StaticRouteRoutePolicy` + - Added model `StaticRouteRoutePolicyPatch` + - Added enum `StationConfigurationState` + - Added enum `StationConnectionMode` + - Added model `StationConnectionPatchProperties` + - Added model `StationConnectionProperties` + - Added model `StorageAccountConfiguration` + - Added model `StorageAccountPatchConfiguration` + - Added enum `SynchronizationStatus` + - Added model `TerminalServerPatchConfiguration` + - Added enum `UniqueRouteDistinguisherConfigurationState` + - Added model `UniqueRouteDistinguisherPatchProperties` + - Added model `UniqueRouteDistinguisherProperties` + - Added model `UpdateAdministrativeStateResponse` + - Added model `UpdateAdministrativeStateResponseProperties` + - Added model `UpgradeNetworkFabricProperties` + - Added model `UserAssignedIdentity` + - Added enum `V4OverV6BgpSessionState` + - Added enum `V6OverV4BgpSessionState` + - Added model `ViewDeviceConfigurationOperationResponse` + - Added model `ViewDeviceConfigurationResponseProperties` + - Added model `VlanGroupPatchProperties` + - Added model `VlanMatchConditionPatch` + - Added model `VpnOptionAPatchProperties` + - Added model `VpnOptionAProperties` + - Added model `VpnOptionBPatchProperties` + - Added model `VpnOptionBProperties` + - Model `ExternalNetworksOperations` added method `begin_update_bfd_administrative_state` + - Model `InternalNetworksOperations` added method `begin_update_bfd_administrative_state` + - Model `NeighborGroupsOperations` added method `begin_resync` + - Model `NetworkDevicesOperations` added method `begin_resync_certificates` + - Model `NetworkDevicesOperations` added method `begin_resync_passwords` + - Model `NetworkDevicesOperations` added method `begin_run_ro_command` + - Model `NetworkDevicesOperations` added method `begin_run_rw_command` + - Model `NetworkFabricsOperations` added method `begin_arm_configuration_diff` + - Model `NetworkFabricsOperations` added method `begin_commit_batch_status` + - Model `NetworkFabricsOperations` added method `begin_discard_commit_batch` + - Model `NetworkFabricsOperations` added method `begin_lock_fabric` + - Model `NetworkFabricsOperations` added method `begin_resync_certificates` + - Model `NetworkFabricsOperations` added method `begin_resync_passwords` + - Model `NetworkFabricsOperations` added method `begin_rotate_certificates` + - Model `NetworkFabricsOperations` added method `begin_rotate_passwords` + - Model `NetworkFabricsOperations` added method `begin_view_device_configuration` + - Model `NetworkToNetworkInterconnectsOperations` added method `begin_update_bfd_administrative_state` + - Added model `NetworkBootstrapDevicesOperations` + - Added model `NetworkBootstrapInterfacesOperations` + - Added model `NetworkMonitorsOperations` + +### Breaking Changes + + - Deleted or renamed client `ManagedNetworkFabricMgmtClient` + - Model `AccessControlList` deleted or renamed its instance variable `annotation` + - Model `AccessControlList` deleted or renamed its instance variable `configuration_type` + - Model `AccessControlList` deleted or renamed its instance variable `acls_url` + - Model `AccessControlList` deleted or renamed its instance variable `match_configurations` + - Model `AccessControlList` deleted or renamed its instance variable `dynamic_match_configurations` + - Model `AccessControlList` deleted or renamed its instance variable `last_synced_time` + - Model `AccessControlList` deleted or renamed its instance variable `configuration_state` + - Model `AccessControlList` deleted or renamed its instance variable `provisioning_state` + - Model `AccessControlList` deleted or renamed its instance variable `administrative_state` + - Model `AccessControlListPatch` deleted or renamed its instance variable `configuration_type` + - Model `AccessControlListPatch` deleted or renamed its instance variable `acls_url` + - Model `AccessControlListPatch` deleted or renamed its instance variable `match_configurations` + - Model `AccessControlListPatch` deleted or renamed its instance variable `dynamic_match_configurations` + - Model `AccessControlListPatch` deleted or renamed its instance variable `annotation` + - Model `ConnectedSubnetRoutePolicy` deleted or renamed its instance variable `export_route_policy_id` + - Model `ExternalNetwork` deleted or renamed its instance variable `annotation` + - Model `ExternalNetwork` deleted or renamed its instance variable `import_route_policy_id` + - Model `ExternalNetwork` deleted or renamed its instance variable `export_route_policy_id` + - Model `ExternalNetwork` deleted or renamed its instance variable `import_route_policy` + - Model `ExternalNetwork` deleted or renamed its instance variable `export_route_policy` + - Model `ExternalNetwork` deleted or renamed its instance variable `network_to_network_interconnect_id` + - Model `ExternalNetwork` deleted or renamed its instance variable `peering_option` + - Model `ExternalNetwork` deleted or renamed its instance variable `option_b_properties` + - Model `ExternalNetwork` deleted or renamed its instance variable `option_a_properties` + - Model `ExternalNetwork` deleted or renamed its instance variable `configuration_state` + - Model `ExternalNetwork` deleted or renamed its instance variable `provisioning_state` + - Model `ExternalNetwork` deleted or renamed its instance variable `administrative_state` + - Model `ExternalNetworkPatch` deleted or renamed its instance variable `annotation` + - Model `ExternalNetworkPatch` deleted or renamed its instance variable `import_route_policy_id` + - Model `ExternalNetworkPatch` deleted or renamed its instance variable `export_route_policy_id` + - Model `ExternalNetworkPatch` deleted or renamed its instance variable `import_route_policy` + - Model `ExternalNetworkPatch` deleted or renamed its instance variable `export_route_policy` + - Model `ExternalNetworkPatch` deleted or renamed its instance variable `peering_option` + - Model `ExternalNetworkPatch` deleted or renamed its instance variable `option_b_properties` + - Model `ExternalNetworkPatch` deleted or renamed its instance variable `option_a_properties` + - Model `ExternalNetworkPatchProperties` deleted or renamed its instance variable `import_route_policy_id` + - Model `ExternalNetworkPatchProperties` deleted or renamed its instance variable `export_route_policy_id` + - Model `ExternalNetworkProperties` deleted or renamed its instance variable `import_route_policy_id` + - Model `ExternalNetworkProperties` deleted or renamed its instance variable `export_route_policy_id` + - Model `InternalNetwork` deleted or renamed its instance variable `annotation` + - Model `InternalNetwork` deleted or renamed its instance variable `mtu` + - Model `InternalNetwork` deleted or renamed its instance variable `connected_i_pv4_subnets` + - Model `InternalNetwork` deleted or renamed its instance variable `connected_i_pv6_subnets` + - Model `InternalNetwork` deleted or renamed its instance variable `import_route_policy_id` + - Model `InternalNetwork` deleted or renamed its instance variable `export_route_policy_id` + - Model `InternalNetwork` deleted or renamed its instance variable `import_route_policy` + - Model `InternalNetwork` deleted or renamed its instance variable `export_route_policy` + - Model `InternalNetwork` deleted or renamed its instance variable `ingress_acl_id` + - Model `InternalNetwork` deleted or renamed its instance variable `egress_acl_id` + - Model `InternalNetwork` deleted or renamed its instance variable `is_monitoring_enabled` + - Model `InternalNetwork` deleted or renamed its instance variable `extension` + - Model `InternalNetwork` deleted or renamed its instance variable `vlan_id` + - Model `InternalNetwork` deleted or renamed its instance variable `bgp_configuration` + - Model `InternalNetwork` deleted or renamed its instance variable `static_route_configuration` + - Model `InternalNetwork` deleted or renamed its instance variable `configuration_state` + - Model `InternalNetwork` deleted or renamed its instance variable `provisioning_state` + - Model `InternalNetwork` deleted or renamed its instance variable `administrative_state` + - Model `InternalNetworkPatch` deleted or renamed its instance variable `annotation` + - Model `InternalNetworkPatch` deleted or renamed its instance variable `mtu` + - Model `InternalNetworkPatch` deleted or renamed its instance variable `connected_i_pv4_subnets` + - Model `InternalNetworkPatch` deleted or renamed its instance variable `connected_i_pv6_subnets` + - Model `InternalNetworkPatch` deleted or renamed its instance variable `import_route_policy_id` + - Model `InternalNetworkPatch` deleted or renamed its instance variable `export_route_policy_id` + - Model `InternalNetworkPatch` deleted or renamed its instance variable `import_route_policy` + - Model `InternalNetworkPatch` deleted or renamed its instance variable `export_route_policy` + - Model `InternalNetworkPatch` deleted or renamed its instance variable `ingress_acl_id` + - Model `InternalNetworkPatch` deleted or renamed its instance variable `egress_acl_id` + - Model `InternalNetworkPatch` deleted or renamed its instance variable `is_monitoring_enabled` + - Model `InternalNetworkPatch` deleted or renamed its instance variable `bgp_configuration` + - Model `InternalNetworkPatch` deleted or renamed its instance variable `static_route_configuration` + - Model `InternalNetworkPatchProperties` deleted or renamed its instance variable `import_route_policy_id` + - Model `InternalNetworkPatchProperties` deleted or renamed its instance variable `export_route_policy_id` + - Model `InternalNetworkProperties` deleted or renamed its instance variable `import_route_policy_id` + - Model `InternalNetworkProperties` deleted or renamed its instance variable `export_route_policy_id` + - Model `InternetGateway` deleted or renamed its instance variable `annotation` + - Model `InternetGateway` deleted or renamed its instance variable `internet_gateway_rule_id` + - Model `InternetGateway` deleted or renamed its instance variable `ipv4_address` + - Model `InternetGateway` deleted or renamed its instance variable `port` + - Model `InternetGateway` deleted or renamed its instance variable `type_properties_type` + - Model `InternetGateway` deleted or renamed its instance variable `network_fabric_controller_id` + - Model `InternetGateway` deleted or renamed its instance variable `provisioning_state` + - Model `InternetGatewayRule` deleted or renamed its instance variable `annotation` + - Model `InternetGatewayRule` deleted or renamed its instance variable `rule_properties` + - Model `InternetGatewayRule` deleted or renamed its instance variable `provisioning_state` + - Model `InternetGatewayRule` deleted or renamed its instance variable `internet_gateway_ids` + - Model `IpCommunity` deleted or renamed its instance variable `annotation` + - Model `IpCommunity` deleted or renamed its instance variable `ip_community_rules` + - Model `IpCommunity` deleted or renamed its instance variable `configuration_state` + - Model `IpCommunity` deleted or renamed its instance variable `provisioning_state` + - Model `IpCommunity` deleted or renamed its instance variable `administrative_state` + - Model `IpCommunityPatch` deleted or renamed its instance variable `ip_community_rules` + - Model `IpExtendedCommunity` deleted or renamed its instance variable `annotation` + - Model `IpExtendedCommunity` deleted or renamed its instance variable `ip_extended_community_rules` + - Model `IpExtendedCommunity` deleted or renamed its instance variable `configuration_state` + - Model `IpExtendedCommunity` deleted or renamed its instance variable `provisioning_state` + - Model `IpExtendedCommunity` deleted or renamed its instance variable `administrative_state` + - Model `IpExtendedCommunityPatch` deleted or renamed its instance variable `ip_extended_community_rules` + - Model `IpExtendedCommunityPatch` deleted or renamed its instance variable `annotation` + - Model `IpPrefix` deleted or renamed its instance variable `annotation` + - Model `IpPrefix` deleted or renamed its instance variable `ip_prefix_rules` + - Model `IpPrefix` deleted or renamed its instance variable `configuration_state` + - Model `IpPrefix` deleted or renamed its instance variable `provisioning_state` + - Model `IpPrefix` deleted or renamed its instance variable `administrative_state` + - Model `IpPrefixPatch` deleted or renamed its instance variable `annotation` + - Model `IpPrefixPatch` deleted or renamed its instance variable `ip_prefix_rules` + - Model `L2IsolationDomain` deleted or renamed its instance variable `annotation` + - Model `L2IsolationDomain` deleted or renamed its instance variable `network_fabric_id` + - Model `L2IsolationDomain` deleted or renamed its instance variable `vlan_id` + - Model `L2IsolationDomain` deleted or renamed its instance variable `mtu` + - Model `L2IsolationDomain` deleted or renamed its instance variable `configuration_state` + - Model `L2IsolationDomain` deleted or renamed its instance variable `provisioning_state` + - Model `L2IsolationDomain` deleted or renamed its instance variable `administrative_state` + - Model `L2IsolationDomainPatch` deleted or renamed its instance variable `annotation` + - Model `L2IsolationDomainPatch` deleted or renamed its instance variable `mtu` + - Model `L3IsolationDomain` deleted or renamed its instance variable `annotation` + - Model `L3IsolationDomain` deleted or renamed its instance variable `redistribute_connected_subnets` + - Model `L3IsolationDomain` deleted or renamed its instance variable `redistribute_static_routes` + - Model `L3IsolationDomain` deleted or renamed its instance variable `aggregate_route_configuration` + - Model `L3IsolationDomain` deleted or renamed its instance variable `connected_subnet_route_policy` + - Model `L3IsolationDomain` deleted or renamed its instance variable `network_fabric_id` + - Model `L3IsolationDomain` deleted or renamed its instance variable `configuration_state` + - Model `L3IsolationDomain` deleted or renamed its instance variable `provisioning_state` + - Model `L3IsolationDomain` deleted or renamed its instance variable `administrative_state` + - Model `L3IsolationDomainPatch` deleted or renamed its instance variable `annotation` + - Model `L3IsolationDomainPatch` deleted or renamed its instance variable `redistribute_connected_subnets` + - Model `L3IsolationDomainPatch` deleted or renamed its instance variable `redistribute_static_routes` + - Model `L3IsolationDomainPatch` deleted or renamed its instance variable `aggregate_route_configuration` + - Model `L3IsolationDomainPatch` deleted or renamed its instance variable `connected_subnet_route_policy` + - Model `NeighborGroup` deleted or renamed its instance variable `annotation` + - Model `NeighborGroup` deleted or renamed its instance variable `destination` + - Model `NeighborGroup` deleted or renamed its instance variable `network_tap_ids` + - Model `NeighborGroup` deleted or renamed its instance variable `network_tap_rule_ids` + - Model `NeighborGroup` deleted or renamed its instance variable `provisioning_state` + - Model `NeighborGroupPatch` deleted or renamed its instance variable `annotation` + - Model `NeighborGroupPatch` deleted or renamed its instance variable `destination` + - Model `NetworkDevice` deleted or renamed its instance variable `annotation` + - Model `NetworkDevice` deleted or renamed its instance variable `host_name` + - Model `NetworkDevice` deleted or renamed its instance variable `serial_number` + - Model `NetworkDevice` deleted or renamed its instance variable `version` + - Model `NetworkDevice` deleted or renamed its instance variable `network_device_sku` + - Model `NetworkDevice` deleted or renamed its instance variable `network_device_role` + - Model `NetworkDevice` deleted or renamed its instance variable `network_rack_id` + - Model `NetworkDevice` deleted or renamed its instance variable `management_ipv4_address` + - Model `NetworkDevice` deleted or renamed its instance variable `management_ipv6_address` + - Model `NetworkDevice` deleted or renamed its instance variable `configuration_state` + - Model `NetworkDevice` deleted or renamed its instance variable `provisioning_state` + - Model `NetworkDevice` deleted or renamed its instance variable `administrative_state` + - Model `NetworkDevicePatchParameters` deleted or renamed its instance variable `annotation` + - Model `NetworkDevicePatchParameters` deleted or renamed its instance variable `host_name` + - Model `NetworkDevicePatchParameters` deleted or renamed its instance variable `serial_number` + - Model `NetworkFabric` deleted or renamed its instance variable `annotation` + - Model `NetworkFabric` deleted or renamed its instance variable `network_fabric_sku` + - Model `NetworkFabric` deleted or renamed its instance variable `fabric_version` + - Model `NetworkFabric` deleted or renamed its instance variable `router_ids` + - Model `NetworkFabric` deleted or renamed its instance variable `network_fabric_controller_id` + - Model `NetworkFabric` deleted or renamed its instance variable `rack_count` + - Model `NetworkFabric` deleted or renamed its instance variable `server_count_per_rack` + - Model `NetworkFabric` deleted or renamed its instance variable `ipv4_prefix` + - Model `NetworkFabric` deleted or renamed its instance variable `ipv6_prefix` + - Model `NetworkFabric` deleted or renamed its instance variable `fabric_asn` + - Model `NetworkFabric` deleted or renamed its instance variable `terminal_server_configuration` + - Model `NetworkFabric` deleted or renamed its instance variable `management_network_configuration` + - Model `NetworkFabric` deleted or renamed its instance variable `racks` + - Model `NetworkFabric` deleted or renamed its instance variable `l2_isolation_domains` + - Model `NetworkFabric` deleted or renamed its instance variable `l3_isolation_domains` + - Model `NetworkFabric` deleted or renamed its instance variable `configuration_state` + - Model `NetworkFabric` deleted or renamed its instance variable `provisioning_state` + - Model `NetworkFabric` deleted or renamed its instance variable `administrative_state` + - Model `NetworkFabricController` deleted or renamed its instance variable `annotation` + - Model `NetworkFabricController` deleted or renamed its instance variable `infrastructure_express_route_connections` + - Model `NetworkFabricController` deleted or renamed its instance variable `workload_express_route_connections` + - Model `NetworkFabricController` deleted or renamed its instance variable `infrastructure_services` + - Model `NetworkFabricController` deleted or renamed its instance variable `workload_services` + - Model `NetworkFabricController` deleted or renamed its instance variable `managed_resource_group_configuration` + - Model `NetworkFabricController` deleted or renamed its instance variable `network_fabric_ids` + - Model `NetworkFabricController` deleted or renamed its instance variable `workload_management_network` + - Model `NetworkFabricController` deleted or renamed its instance variable `is_workload_management_network_enabled` + - Model `NetworkFabricController` deleted or renamed its instance variable `tenant_internet_gateway_ids` + - Model `NetworkFabricController` deleted or renamed its instance variable `ipv4_address_space` + - Model `NetworkFabricController` deleted or renamed its instance variable `ipv6_address_space` + - Model `NetworkFabricController` deleted or renamed its instance variable `nfc_sku` + - Model `NetworkFabricController` deleted or renamed its instance variable `provisioning_state` + - Model `NetworkFabricControllerProperties` deleted or renamed its instance variable `workload_management_network` + - Model `NetworkFabricPatch` deleted or renamed its instance variable `annotation` + - Model `NetworkFabricPatch` deleted or renamed its instance variable `rack_count` + - Model `NetworkFabricPatch` deleted or renamed its instance variable `server_count_per_rack` + - Model `NetworkFabricPatch` deleted or renamed its instance variable `ipv4_prefix` + - Model `NetworkFabricPatch` deleted or renamed its instance variable `ipv6_prefix` + - Model `NetworkFabricPatch` deleted or renamed its instance variable `fabric_asn` + - Model `NetworkFabricPatch` deleted or renamed its instance variable `terminal_server_configuration` + - Model `NetworkFabricPatch` deleted or renamed its instance variable `management_network_configuration` + - Model `NetworkInterface` deleted or renamed its instance variable `annotation` + - Model `NetworkInterface` deleted or renamed its instance variable `physical_identifier` + - Model `NetworkInterface` deleted or renamed its instance variable `connected_to` + - Model `NetworkInterface` deleted or renamed its instance variable `interface_type` + - Model `NetworkInterface` deleted or renamed its instance variable `ipv4_address` + - Model `NetworkInterface` deleted or renamed its instance variable `ipv6_address` + - Model `NetworkInterface` deleted or renamed its instance variable `provisioning_state` + - Model `NetworkInterface` deleted or renamed its instance variable `administrative_state` + - Model `NetworkInterfacePatch` deleted or renamed its instance variable `annotation` + - Model `NetworkRack` deleted or renamed its instance variable `annotation` + - Model `NetworkRack` deleted or renamed its instance variable `network_rack_type` + - Model `NetworkRack` deleted or renamed its instance variable `network_fabric_id` + - Model `NetworkRack` deleted or renamed its instance variable `network_devices` + - Model `NetworkRack` deleted or renamed its instance variable `provisioning_state` + - Model `NetworkTap` deleted or renamed its instance variable `annotation` + - Model `NetworkTap` deleted or renamed its instance variable `network_packet_broker_id` + - Model `NetworkTap` deleted or renamed its instance variable `source_tap_rule_id` + - Model `NetworkTap` deleted or renamed its instance variable `destinations` + - Model `NetworkTap` deleted or renamed its instance variable `polling_type` + - Model `NetworkTap` deleted or renamed its instance variable `configuration_state` + - Model `NetworkTap` deleted or renamed its instance variable `provisioning_state` + - Model `NetworkTap` deleted or renamed its instance variable `administrative_state` + - Model `NetworkTapRule` deleted or renamed its instance variable `annotation` + - Model `NetworkTapRule` deleted or renamed its instance variable `configuration_type` + - Model `NetworkTapRule` deleted or renamed its instance variable `tap_rules_url` + - Model `NetworkTapRule` deleted or renamed its instance variable `match_configurations` + - Model `NetworkTapRule` deleted or renamed its instance variable `dynamic_match_configurations` + - Model `NetworkTapRule` deleted or renamed its instance variable `network_tap_id` + - Model `NetworkTapRule` deleted or renamed its instance variable `polling_interval_in_seconds` + - Model `NetworkTapRule` deleted or renamed its instance variable `last_synced_time` + - Model `NetworkTapRule` deleted or renamed its instance variable `configuration_state` + - Model `NetworkTapRule` deleted or renamed its instance variable `provisioning_state` + - Model `NetworkTapRule` deleted or renamed its instance variable `administrative_state` + - Model `NetworkTapRulePatch` deleted or renamed its instance variable `annotation` + - Model `NetworkTapRulePatch` deleted or renamed its instance variable `configuration_type` + - Model `NetworkTapRulePatch` deleted or renamed its instance variable `tap_rules_url` + - Model `NetworkTapRulePatch` deleted or renamed its instance variable `match_configurations` + - Model `NetworkTapRulePatch` deleted or renamed its instance variable `dynamic_match_configurations` + - Model `RoutePolicy` deleted or renamed its instance variable `annotation` + - Model `RoutePolicy` deleted or renamed its instance variable `statements` + - Model `RoutePolicy` deleted or renamed its instance variable `network_fabric_id` + - Model `RoutePolicy` deleted or renamed its instance variable `address_family_type` + - Model `RoutePolicy` deleted or renamed its instance variable `configuration_state` + - Model `RoutePolicy` deleted or renamed its instance variable `provisioning_state` + - Model `RoutePolicy` deleted or renamed its instance variable `administrative_state` + - Model `RoutePolicyPatch` deleted or renamed its instance variable `statements` + - Deleted or renamed model `AccessControlListPatchableProperties` + - Deleted or renamed model `ExtendedLocation` + - Deleted or renamed model `ExtensionEnumProperty` + - Deleted or renamed model `ExternalNetworkPatchableProperties` + - Deleted or renamed model `ExternalNetworksList` + - Deleted or renamed model `InternalNetworkPatchableProperties` + - Deleted or renamed model `InternalNetworkPropertiesBgpConfiguration` + - Deleted or renamed model `InternalNetworkPropertiesStaticRouteConfiguration` + - Deleted or renamed model `InternalNetworksList` + - Deleted or renamed model `InternetGatewayPatchableProperties` + - Deleted or renamed model `IpCommunityAddOperationProperties` + - Deleted or renamed model `IpCommunityDeleteOperationProperties` + - Deleted or renamed model `IpCommunitySetOperationProperties` + - Deleted or renamed model `IpExtendedCommunityAddOperationProperties` + - Deleted or renamed model `IpExtendedCommunityDeleteOperationProperties` + - Deleted or renamed model `IpExtendedCommunityPatchableProperties` + - Deleted or renamed model `IpExtendedCommunitySetOperationProperties` + - Deleted or renamed model `IpPrefixPatchableProperties` + - Deleted or renamed model `L3IsolationDomainPatchableProperties` + - Deleted or renamed model `L3OptionAProperties` + - Deleted or renamed model `ManagementNetworkConfigurationPatchableProperties` + - Deleted or renamed model `NeighborGroupPatchableProperties` + - Deleted or renamed model `NetworkDevicePatchableProperties` + - Deleted or renamed model `NetworkFabricControllerPatchableProperties` + - Deleted or renamed model `NetworkFabricPatchableProperties` + - Deleted or renamed model `NetworkFabricPatchablePropertiesTerminalServerConfiguration` + - Deleted or renamed model `NetworkInterfacesList` + - Deleted or renamed model `NetworkTapPatchableParameters` + - Deleted or renamed model `NetworkTapPatchableParametersDestinationsItem` + - Deleted or renamed model `NetworkTapPropertiesDestinationsItem` + - Deleted or renamed model `NetworkTapRulePatchableProperties` + - Deleted or renamed model `NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration` + - Deleted or renamed model `NetworkToNetworkInterconnectsList` + - Deleted or renamed model `OptionAProperties` + - Deleted or renamed model `OptionBProperties` + - Deleted or renamed model `PollingIntervalInSeconds` + - Deleted or renamed model `TerminalServerPatchableProperties` + - Deleted or renamed model `VpnConfigurationPatchablePropertiesOptionAProperties` + - Deleted or renamed model `VpnConfigurationPropertiesOptionAProperties` + ## 1.0.0 (2023-07-19) ### Features Added diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/MANIFEST.in b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/MANIFEST.in index 456e86373690..34e5e51320d0 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/MANIFEST.in +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/MANIFEST.in @@ -1,8 +1,7 @@ -include _meta.json -recursive-include tests *.py *.json -recursive-include samples *.py *.md include *.md -include azure/__init__.py -include azure/mgmt/__init__.py include LICENSE include azure/mgmt/managednetworkfabric/py.typed +recursive-include tests *.py +recursive-include samples *.py *.md +include azure/__init__.py +include azure/mgmt/__init__.py diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/README.md b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/README.md index abcc24ac69be..781f32df5e21 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/README.md +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Python This is the Microsoft Azure Managednetworkfabric Management Client Library. -This package has been tested with Python 3.7+. +This package has been tested with Python 3.9+. For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). ## _Disclaimer_ @@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites -- Python 3.7+ is required to use this package. +- Python 3.9+ is required to use this package. - [Azure subscription](https://azure.microsoft.com/free/) ### Install the package @@ -24,7 +24,7 @@ pip install azure-identity ### Authentication -By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables. +By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. @@ -59,6 +59,3 @@ Code samples for this package can be found at: If you encounter any bugs or have suggestions, please file an issue in the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) section of the project. - - - diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/_meta.json b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/_meta.json deleted file mode 100644 index 06ea333b3f3a..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/_meta.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commit": "a89c3854f2d1cca8c996e00c97af3179ecb9dd72", - "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest": "3.9.2", - "use": [ - "@autorest/python@6.6.0", - "@autorest/modelerfour@4.24.3" - ], - "autorest_command": "autorest specification/managednetworkfabric/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.6.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", - "readme": "specification/managednetworkfabric/resource-manager/readme.md" -} \ No newline at end of file diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/_metadata.json b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/_metadata.json new file mode 100644 index 000000000000..12973aa40e9c --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/_metadata.json @@ -0,0 +1,10 @@ +{ + "apiVersion": "2025-07-15", + "apiVersions": { + "Microsoft.ManagedNetworkFabric": "2025-07-15" + }, + "commit": "1a3542f46375ced453982cf69f035d9a9a3924d5", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "typespec_src": "specification/managednetworkfabric/ManagedNetworkFabric.ResourceManager.Management", + "emitterVersion": "0.61.2" +} \ No newline at end of file diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/apiview-properties.json b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/apiview-properties.json new file mode 100644 index 000000000000..ea5679b25960 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/apiview-properties.json @@ -0,0 +1,859 @@ +{ + "CrossLanguagePackageId": "Microsoft.ManagedNetworkFabric", + "CrossLanguageDefinitionId": { + "azure.mgmt.managednetworkfabric.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", + "azure.mgmt.managednetworkfabric.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource", + "azure.mgmt.managednetworkfabric.models.AccessControlList": "Microsoft.ManagedNetworkFabric.AccessControlList", + "azure.mgmt.managednetworkfabric.models.AccessControlListAction": "Microsoft.ManagedNetworkFabric.AccessControlListAction", + "azure.mgmt.managednetworkfabric.models.AccessControlListActionPatch": "Microsoft.ManagedNetworkFabric.AccessControlListActionPatch", + "azure.mgmt.managednetworkfabric.models.CommonMatchConditions": "Microsoft.ManagedNetworkFabric.CommonMatchConditions", + "azure.mgmt.managednetworkfabric.models.AccessControlListMatchCondition": "Microsoft.ManagedNetworkFabric.AccessControlListMatchCondition", + "azure.mgmt.managednetworkfabric.models.CommonMatchConditionsPatch": "Microsoft.ManagedNetworkFabric.CommonMatchConditionsPatch", + "azure.mgmt.managednetworkfabric.models.AccessControlListMatchConditionPatch": "Microsoft.ManagedNetworkFabric.AccessControlListMatchConditionPatch", + "azure.mgmt.managednetworkfabric.models.AccessControlListMatchConfiguration": "Microsoft.ManagedNetworkFabric.AccessControlListMatchConfiguration", + "azure.mgmt.managednetworkfabric.models.AccessControlListMatchConfigurationPatch": "Microsoft.ManagedNetworkFabric.AccessControlListMatchConfigurationPatch", + "azure.mgmt.managednetworkfabric.models.TagsUpdate": "Microsoft.ManagedNetworkFabric.TagsUpdate", + "azure.mgmt.managednetworkfabric.models.AccessControlListPatch": "Microsoft.ManagedNetworkFabric.AccessControlListPatch", + "azure.mgmt.managednetworkfabric.models.AccessControlListPatchProperties": "Microsoft.ManagedNetworkFabric.AccessControlListPatchProperties", + "azure.mgmt.managednetworkfabric.models.PortCondition": "Microsoft.ManagedNetworkFabric.PortCondition", + "azure.mgmt.managednetworkfabric.models.AccessControlListPortCondition": "Microsoft.ManagedNetworkFabric.AccessControlListPortCondition", + "azure.mgmt.managednetworkfabric.models.PortConditionPatch": "Microsoft.ManagedNetworkFabric.PortConditionPatch", + "azure.mgmt.managednetworkfabric.models.AccessControlListPortConditionPatch": "Microsoft.ManagedNetworkFabric.AccessControlListPortConditionPatch", + "azure.mgmt.managednetworkfabric.models.AccessControlListProperties": "Microsoft.ManagedNetworkFabric.AccessControlListProperties", + "azure.mgmt.managednetworkfabric.models.ActionIpCommunityPatchProperties": "Microsoft.ManagedNetworkFabric.ActionIpCommunityPatchProperties", + "azure.mgmt.managednetworkfabric.models.ActionIpCommunityProperties": "Microsoft.ManagedNetworkFabric.ActionIpCommunityProperties", + "azure.mgmt.managednetworkfabric.models.ActionIpExtendedCommunityPatchProperties": "Microsoft.ManagedNetworkFabric.ActionIpExtendedCommunityPatchProperties", + "azure.mgmt.managednetworkfabric.models.ActionIpExtendedCommunityProperties": "Microsoft.ManagedNetworkFabric.ActionIpExtendedCommunityProperties", + "azure.mgmt.managednetworkfabric.models.AggregateRoute": "Microsoft.ManagedNetworkFabric.AggregateRoute", + "azure.mgmt.managednetworkfabric.models.AggregateRouteConfiguration": "Microsoft.ManagedNetworkFabric.AggregateRouteConfiguration", + "azure.mgmt.managednetworkfabric.models.AggregateRoutePatchConfiguration": "Microsoft.ManagedNetworkFabric.AggregateRoutePatchConfiguration", + "azure.mgmt.managednetworkfabric.models.AnnotationResource": "Microsoft.ManagedNetworkFabric.AnnotationResource", + "azure.mgmt.managednetworkfabric.models.ArmConfigurationDiffOperationResponse": "Microsoft.ManagedNetworkFabric.ArmConfigurationDiffOperationResponse", + "azure.mgmt.managednetworkfabric.models.ArmConfigurationDiffResponseProperties": "Microsoft.ManagedNetworkFabric.ArmConfigurationDiffResponseProperties", + "azure.mgmt.managednetworkfabric.models.AuthorizedTransceiverPatchProperties": "Microsoft.ManagedNetworkFabric.AuthorizedTransceiverPatchProperties", + "azure.mgmt.managednetworkfabric.models.AuthorizedTransceiverProperties": "Microsoft.ManagedNetworkFabric.AuthorizedTransceiverProperties", + "azure.mgmt.managednetworkfabric.models.BfdConfiguration": "Microsoft.ManagedNetworkFabric.BfdConfiguration", + "azure.mgmt.managednetworkfabric.models.BfdPatchConfiguration": "Microsoft.ManagedNetworkFabric.BfdPatchConfiguration", + "azure.mgmt.managednetworkfabric.models.BgpConfiguration": "Microsoft.ManagedNetworkFabric.BgpConfiguration", + "azure.mgmt.managednetworkfabric.models.BgpPatchConfiguration": "Microsoft.ManagedNetworkFabric.BgpPatchConfiguration", + "azure.mgmt.managednetworkfabric.models.BitRate": "Microsoft.ManagedNetworkFabric.BitRate", + "azure.mgmt.managednetworkfabric.models.BmpConfigurationPatchProperties": "Microsoft.ManagedNetworkFabric.BmpConfigurationPatchProperties", + "azure.mgmt.managednetworkfabric.models.BmpConfigurationProperties": "Microsoft.ManagedNetworkFabric.BmpConfigurationProperties", + "azure.mgmt.managednetworkfabric.models.BmpExportPolicyPatchProperties": "Microsoft.ManagedNetworkFabric.BmpExportPolicyPatchProperties", + "azure.mgmt.managednetworkfabric.models.BmpExportPolicyProperties": "Microsoft.ManagedNetworkFabric.BmpExportPolicyProperties", + "azure.mgmt.managednetworkfabric.models.BurstSize": "Microsoft.ManagedNetworkFabric.BurstSize", + "azure.mgmt.managednetworkfabric.models.CertificateArchiveReference": "Microsoft.ManagedNetworkFabric.CertificateArchiveReference", + "azure.mgmt.managednetworkfabric.models.CertificateRotationStatus": "Microsoft.ManagedNetworkFabric.CertificateRotationStatus", + "azure.mgmt.managednetworkfabric.models.CommitBatchDetails": "Microsoft.ManagedNetworkFabric.CommitBatchDetails", + "azure.mgmt.managednetworkfabric.models.CommitBatchStatusOperationResponse": "Microsoft.ManagedNetworkFabric.CommitBatchStatusOperationResponse", + "azure.mgmt.managednetworkfabric.models.CommitBatchStatusRequest": "Microsoft.ManagedNetworkFabric.CommitBatchStatusRequest", + "azure.mgmt.managednetworkfabric.models.CommitBatchStatusResponseProperties": "Microsoft.ManagedNetworkFabric.CommitBatchStatusResponseProperties", + "azure.mgmt.managednetworkfabric.models.CommitConfigurationRequest": "Microsoft.ManagedNetworkFabric.CommitConfigurationRequest", + "azure.mgmt.managednetworkfabric.models.CommitConfigurationResponse": "Microsoft.ManagedNetworkFabric.CommitConfigurationResponse", + "azure.mgmt.managednetworkfabric.models.CommonDynamicMatchConfiguration": "Microsoft.ManagedNetworkFabric.CommonDynamicMatchConfiguration", + "azure.mgmt.managednetworkfabric.models.CommonDynamicMatchConfigurationPatch": "Microsoft.ManagedNetworkFabric.CommonDynamicMatchConfigurationPatch", + "azure.mgmt.managednetworkfabric.models.CommonErrorResponse": "Microsoft.ManagedNetworkFabric.CommonErrorResponse", + "azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceROCommands": "Microsoft.ManagedNetworkFabric.CommonPostActionResponseForDeviceROCommands", + "azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceROCommandsOperationStatusResult": "Microsoft.ManagedNetworkFabric.CommonPostActionResponseForDeviceROCommandsOperationStatusResult", + "azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate": "Microsoft.ManagedNetworkFabric.CommonPostActionResponseForDeviceUpdate", + "azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate": "Microsoft.ManagedNetworkFabric.CommonPostActionResponseForStateUpdate", + "azure.mgmt.managednetworkfabric.models.ConditionalDefaultRouteProperties": "Microsoft.ManagedNetworkFabric.ConditionalDefaultRouteProperties", + "azure.mgmt.managednetworkfabric.models.ConnectedSubnet": "Microsoft.ManagedNetworkFabric.ConnectedSubnet", + "azure.mgmt.managednetworkfabric.models.ConnectedSubnetPatch": "Microsoft.ManagedNetworkFabric.ConnectedSubnetPatch", + "azure.mgmt.managednetworkfabric.models.ConnectedSubnetRoutePolicy": "Microsoft.ManagedNetworkFabric.ConnectedSubnetRoutePolicy", + "azure.mgmt.managednetworkfabric.models.ConnectedSubnetRoutePolicyPatch": "Microsoft.ManagedNetworkFabric.ConnectedSubnetRoutePolicyPatch", + "azure.mgmt.managednetworkfabric.models.ControllerServices": "Microsoft.ManagedNetworkFabric.ControllerServices", + "azure.mgmt.managednetworkfabric.models.ControlPlanAclIpMatchCondition": "Microsoft.ManagedNetworkFabric.ControlPlanAclIpMatchCondition", + "azure.mgmt.managednetworkfabric.models.ControlPlaneAclAction": "Microsoft.ManagedNetworkFabric.ControlPlaneAclAction", + "azure.mgmt.managednetworkfabric.models.ControlPlaneAclActionPatch": "Microsoft.ManagedNetworkFabric.ControlPlaneAclActionPatch", + "azure.mgmt.managednetworkfabric.models.ControlPlaneAclIpMatchConditionPatch": "Microsoft.ManagedNetworkFabric.ControlPlaneAclIpMatchConditionPatch", + "azure.mgmt.managednetworkfabric.models.ControlPlaneAclMatchCondition": "Microsoft.ManagedNetworkFabric.ControlPlaneAclMatchCondition", + "azure.mgmt.managednetworkfabric.models.ControlPlaneAclMatchConditionPatch": "Microsoft.ManagedNetworkFabric.ControlPlaneAclMatchConditionPatch", + "azure.mgmt.managednetworkfabric.models.ControlPlaneAclMatchConfigurationPatchProperties": "Microsoft.ManagedNetworkFabric.ControlPlaneAclMatchConfigurationPatchProperties", + "azure.mgmt.managednetworkfabric.models.ControlPlaneAclMatchConfigurationProperties": "Microsoft.ManagedNetworkFabric.ControlPlaneAclMatchConfigurationProperties", + "azure.mgmt.managednetworkfabric.models.ControlPlaneAclPatchProperties": "Microsoft.ManagedNetworkFabric.ControlPlaneAclPatchProperties", + "azure.mgmt.managednetworkfabric.models.ControlPlaneAclPortCondition": "Microsoft.ManagedNetworkFabric.ControlPlaneAclPortCondition", + "azure.mgmt.managednetworkfabric.models.ControlPlaneAclPortMatchCondition": "Microsoft.ManagedNetworkFabric.ControlPlaneAclPortMatchCondition", + "azure.mgmt.managednetworkfabric.models.ControlPlaneAclPortMatchConditionPatch": "Microsoft.ManagedNetworkFabric.ControlPlaneAclPortMatchConditionPatch", + "azure.mgmt.managednetworkfabric.models.ControlPlaneAclProperties": "Microsoft.ManagedNetworkFabric.ControlPlaneAclProperties", + "azure.mgmt.managednetworkfabric.models.ControlPlaneAclTtlMatchCondition": "Microsoft.ManagedNetworkFabric.ControlPlaneAclTtlMatchCondition", + "azure.mgmt.managednetworkfabric.models.ControlPlaneAclTtlMatchConditionPatch": "Microsoft.ManagedNetworkFabric.ControlPlaneAclTtlMatchConditionPatch", + "azure.mgmt.managednetworkfabric.models.DestinationPatchProperties": "Microsoft.ManagedNetworkFabric.DestinationPatchProperties", + "azure.mgmt.managednetworkfabric.models.DestinationProperties": "Microsoft.ManagedNetworkFabric.DestinationProperties", + "azure.mgmt.managednetworkfabric.models.DeviceInterfaceProperties": "Microsoft.ManagedNetworkFabric.DeviceInterfaceProperties", + "azure.mgmt.managednetworkfabric.models.DeviceRoCommand": "Microsoft.ManagedNetworkFabric.DeviceRoCommand", + "azure.mgmt.managednetworkfabric.models.DeviceRwCommand": "Microsoft.ManagedNetworkFabric.DeviceRwCommand", + "azure.mgmt.managednetworkfabric.models.DiscardCommitBatchOperationResponse": "Microsoft.ManagedNetworkFabric.DiscardCommitBatchOperationResponse", + "azure.mgmt.managednetworkfabric.models.DiscardCommitBatchRequest": "Microsoft.ManagedNetworkFabric.DiscardCommitBatchRequest", + "azure.mgmt.managednetworkfabric.models.DiscardCommitBatchResponseProperties": "Microsoft.ManagedNetworkFabric.DiscardCommitBatchResponseProperties", + "azure.mgmt.managednetworkfabric.models.EnableDisableOnResources": "Microsoft.ManagedNetworkFabric.EnableDisableOnResources", + "azure.mgmt.managednetworkfabric.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "azure.mgmt.managednetworkfabric.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "azure.mgmt.managednetworkfabric.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "azure.mgmt.managednetworkfabric.models.ExportRoutePolicy": "Microsoft.ManagedNetworkFabric.ExportRoutePolicy", + "azure.mgmt.managednetworkfabric.models.ExportRoutePolicyInformation": "Microsoft.ManagedNetworkFabric.ExportRoutePolicyInformation", + "azure.mgmt.managednetworkfabric.models.ExportRoutePolicyInformationPatch": "Microsoft.ManagedNetworkFabric.ExportRoutePolicyInformationPatch", + "azure.mgmt.managednetworkfabric.models.ExportRoutePolicyPatch": "Microsoft.ManagedNetworkFabric.ExportRoutePolicyPatch", + "azure.mgmt.managednetworkfabric.models.ExpressRouteConnectionInformation": "Microsoft.ManagedNetworkFabric.ExpressRouteConnectionInformation", + "azure.mgmt.managednetworkfabric.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource", + "azure.mgmt.managednetworkfabric.models.ExternalNetwork": "Microsoft.ManagedNetworkFabric.ExternalNetwork", + "azure.mgmt.managednetworkfabric.models.ExternalNetworkBmpPatchProperties": "Microsoft.ManagedNetworkFabric.ExternalNetworkBmpPatchProperties", + "azure.mgmt.managednetworkfabric.models.ExternalNetworkBmpProperties": "Microsoft.ManagedNetworkFabric.ExternalNetworkBmpProperties", + "azure.mgmt.managednetworkfabric.models.ExternalNetworkPatch": "Microsoft.ManagedNetworkFabric.ExternalNetworkPatch", + "azure.mgmt.managednetworkfabric.models.ExternalNetworkPatchProperties": "Microsoft.ManagedNetworkFabric.ExternalNetworkPatchProperties", + "azure.mgmt.managednetworkfabric.models.ExternalNetworkPatchPropertiesOptionAProperties": "Microsoft.ManagedNetworkFabric.ExternalNetworkPatchPropertiesOptionAProperties", + "azure.mgmt.managednetworkfabric.models.ExternalNetworkProperties": "Microsoft.ManagedNetworkFabric.ExternalNetworkProperties", + "azure.mgmt.managednetworkfabric.models.ExternalNetworkPropertiesOptionAProperties": "Microsoft.ManagedNetworkFabric.ExternalNetworkPropertiesOptionAProperties", + "azure.mgmt.managednetworkfabric.models.ExternalNetworkStaticRouteConfiguration": "Microsoft.ManagedNetworkFabric.ExternalNetworkStaticRouteConfiguration", + "azure.mgmt.managednetworkfabric.models.ExternalNetworkStaticRoutePatchConfiguration": "Microsoft.ManagedNetworkFabric.ExternalNetworkStaticRoutePatchConfiguration", + "azure.mgmt.managednetworkfabric.models.ExternalNetworkUpdateBfdAdministrativeStateRequest": "Microsoft.ManagedNetworkFabric.ExternalNetworkUpdateBfdAdministrativeStateRequest", + "azure.mgmt.managednetworkfabric.models.ExternalNetworkUpdateBfdAdministrativeStateResponse": "Microsoft.ManagedNetworkFabric.ExternalNetworkUpdateBfdAdministrativeStateResponse", + "azure.mgmt.managednetworkfabric.models.ExternalNetworkUpdateBfdAdministrativeStateResponseProperties": "Microsoft.ManagedNetworkFabric.ExternalNetworkUpdateBfdAdministrativeStateResponseProperties", + "azure.mgmt.managednetworkfabric.models.FabricLockProperties": "Microsoft.ManagedNetworkFabric.FabricLockProperties", + "azure.mgmt.managednetworkfabric.models.FeatureFlagProperties": "Microsoft.ManagedNetworkFabric.FeatureFlagProperties", + "azure.mgmt.managednetworkfabric.models.GetTopologyResponse": "Microsoft.ManagedNetworkFabric.GetTopologyResponse", + "azure.mgmt.managednetworkfabric.models.GetTopologyResponseProperties": "Microsoft.ManagedNetworkFabric.GetTopologyResponseProperties", + "azure.mgmt.managednetworkfabric.models.GlobalAccessControlListActionPatchProperties": "Microsoft.ManagedNetworkFabric.GlobalAccessControlListActionPatchProperties", + "azure.mgmt.managednetworkfabric.models.GlobalAccessControlListActionProperties": "Microsoft.ManagedNetworkFabric.GlobalAccessControlListActionProperties", + "azure.mgmt.managednetworkfabric.models.GlobalNetworkTapRuleActionPatchProperties": "Microsoft.ManagedNetworkFabric.GlobalNetworkTapRuleActionPatchProperties", + "azure.mgmt.managednetworkfabric.models.GlobalNetworkTapRuleActionProperties": "Microsoft.ManagedNetworkFabric.GlobalNetworkTapRuleActionProperties", + "azure.mgmt.managednetworkfabric.models.HeaderAddressProperties": "Microsoft.ManagedNetworkFabric.HeaderAddressProperties", + "azure.mgmt.managednetworkfabric.models.IcmpConfigurationPatchProperties": "Microsoft.ManagedNetworkFabric.IcmpConfigurationPatchProperties", + "azure.mgmt.managednetworkfabric.models.IcmpConfigurationProperties": "Microsoft.ManagedNetworkFabric.IcmpConfigurationProperties", + "azure.mgmt.managednetworkfabric.models.IdentitySelector": "Microsoft.ManagedNetworkFabric.IdentitySelector", + "azure.mgmt.managednetworkfabric.models.IdentitySelectorPatch": "Microsoft.ManagedNetworkFabric.IdentitySelectorPatch", + "azure.mgmt.managednetworkfabric.models.ImportRoutePolicy": "Microsoft.ManagedNetworkFabric.ImportRoutePolicy", + "azure.mgmt.managednetworkfabric.models.ImportRoutePolicyInformation": "Microsoft.ManagedNetworkFabric.ImportRoutePolicyInformation", + "azure.mgmt.managednetworkfabric.models.ImportRoutePolicyInformationPatch": "Microsoft.ManagedNetworkFabric.ImportRoutePolicyInformationPatch", + "azure.mgmt.managednetworkfabric.models.ImportRoutePolicyPatch": "Microsoft.ManagedNetworkFabric.ImportRoutePolicyPatch", + "azure.mgmt.managednetworkfabric.models.InternalNetwork": "Microsoft.ManagedNetworkFabric.InternalNetwork", + "azure.mgmt.managednetworkfabric.models.InternalNetworkBmpPatchProperties": "Microsoft.ManagedNetworkFabric.InternalNetworkBmpPatchProperties", + "azure.mgmt.managednetworkfabric.models.InternalNetworkBmpProperties": "Microsoft.ManagedNetworkFabric.InternalNetworkBmpProperties", + "azure.mgmt.managednetworkfabric.models.InternalNetworkPatch": "Microsoft.ManagedNetworkFabric.InternalNetworkPatch", + "azure.mgmt.managednetworkfabric.models.InternalNetworkPatchProperties": "Microsoft.ManagedNetworkFabric.InternalNetworkPatchProperties", + "azure.mgmt.managednetworkfabric.models.InternalNetworkProperties": "Microsoft.ManagedNetworkFabric.InternalNetworkProperties", + "azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBfdAdministrativeStateRequest": "Microsoft.ManagedNetworkFabric.InternalNetworkUpdateBfdAdministrativeStateRequest", + "azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBfdAdministrativeStateResponse": "Microsoft.ManagedNetworkFabric.InternalNetworkUpdateBfdAdministrativeStateResponse", + "azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBfdAdministrativeStateResponseProperties": "Microsoft.ManagedNetworkFabric.InternalNetworkUpdateBfdAdministrativeStateResponseProperties", + "azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBgpAdministrativeStateRequest": "Microsoft.ManagedNetworkFabric.InternalNetworkUpdateBgpAdministrativeStateRequest", + "azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBgpAdministrativeStateResponse": "Microsoft.ManagedNetworkFabric.InternalNetworkUpdateBgpAdministrativeStateResponse", + "azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBgpAdministrativeStateResponseProperties": "Microsoft.ManagedNetworkFabric.InternalNetworkUpdateBgpAdministrativeStateResponseProperties", + "azure.mgmt.managednetworkfabric.models.InternetGateway": "Microsoft.ManagedNetworkFabric.InternetGateway", + "azure.mgmt.managednetworkfabric.models.InternetGatewayPatch": "Microsoft.ManagedNetworkFabric.InternetGatewayPatch", + "azure.mgmt.managednetworkfabric.models.InternetGatewayPatchProperties": "Microsoft.ManagedNetworkFabric.InternetGatewayPatchProperties", + "azure.mgmt.managednetworkfabric.models.InternetGatewayProperties": "Microsoft.ManagedNetworkFabric.InternetGatewayProperties", + "azure.mgmt.managednetworkfabric.models.InternetGatewayRule": "Microsoft.ManagedNetworkFabric.InternetGatewayRule", + "azure.mgmt.managednetworkfabric.models.InternetGatewayRulePatch": "Microsoft.ManagedNetworkFabric.InternetGatewayRulePatch", + "azure.mgmt.managednetworkfabric.models.InternetGatewayRuleProperties": "Microsoft.ManagedNetworkFabric.InternetGatewayRuleProperties", + "azure.mgmt.managednetworkfabric.models.IpCommunity": "Microsoft.ManagedNetworkFabric.IpCommunity", + "azure.mgmt.managednetworkfabric.models.IpCommunityIdList": "Microsoft.ManagedNetworkFabric.IpCommunityIdList", + "azure.mgmt.managednetworkfabric.models.IpCommunityPatch": "Microsoft.ManagedNetworkFabric.IpCommunityPatch", + "azure.mgmt.managednetworkfabric.models.IpCommunityPatchableProperties": "Microsoft.ManagedNetworkFabric.IpCommunityPatchableProperties", + "azure.mgmt.managednetworkfabric.models.IpCommunityProperties": "Microsoft.ManagedNetworkFabric.IpCommunityProperties", + "azure.mgmt.managednetworkfabric.models.IpCommunityRule": "Microsoft.ManagedNetworkFabric.IpCommunityRule", + "azure.mgmt.managednetworkfabric.models.IpExtendedCommunity": "Microsoft.ManagedNetworkFabric.IpExtendedCommunity", + "azure.mgmt.managednetworkfabric.models.IpExtendedCommunityIdList": "Microsoft.ManagedNetworkFabric.IpExtendedCommunityIdList", + "azure.mgmt.managednetworkfabric.models.IpExtendedCommunityPatch": "Microsoft.ManagedNetworkFabric.IpExtendedCommunityPatch", + "azure.mgmt.managednetworkfabric.models.IpExtendedCommunityPatchProperties": "Microsoft.ManagedNetworkFabric.IpExtendedCommunityPatchProperties", + "azure.mgmt.managednetworkfabric.models.IpExtendedCommunityProperties": "Microsoft.ManagedNetworkFabric.IpExtendedCommunityProperties", + "azure.mgmt.managednetworkfabric.models.IpExtendedCommunityRule": "Microsoft.ManagedNetworkFabric.IpExtendedCommunityRule", + "azure.mgmt.managednetworkfabric.models.IpGroupPatchProperties": "Microsoft.ManagedNetworkFabric.IpGroupPatchProperties", + "azure.mgmt.managednetworkfabric.models.IpGroupProperties": "Microsoft.ManagedNetworkFabric.IpGroupProperties", + "azure.mgmt.managednetworkfabric.models.IpMatchCondition": "Microsoft.ManagedNetworkFabric.IpMatchCondition", + "azure.mgmt.managednetworkfabric.models.IpMatchConditionPatch": "Microsoft.ManagedNetworkFabric.IpMatchConditionPatch", + "azure.mgmt.managednetworkfabric.models.IpPrefix": "Microsoft.ManagedNetworkFabric.IpPrefix", + "azure.mgmt.managednetworkfabric.models.IpPrefixPatch": "Microsoft.ManagedNetworkFabric.IpPrefixPatch", + "azure.mgmt.managednetworkfabric.models.IpPrefixPatchProperties": "Microsoft.ManagedNetworkFabric.IpPrefixPatchProperties", + "azure.mgmt.managednetworkfabric.models.IpPrefixProperties": "Microsoft.ManagedNetworkFabric.IpPrefixProperties", + "azure.mgmt.managednetworkfabric.models.IpPrefixRule": "Microsoft.ManagedNetworkFabric.IpPrefixRule", + "azure.mgmt.managednetworkfabric.models.IsolationDomainPatchProperties": "Microsoft.ManagedNetworkFabric.IsolationDomainPatchProperties", + "azure.mgmt.managednetworkfabric.models.IsolationDomainProperties": "Microsoft.ManagedNetworkFabric.IsolationDomainProperties", + "azure.mgmt.managednetworkfabric.models.L2IsolationDomain": "Microsoft.ManagedNetworkFabric.L2IsolationDomain", + "azure.mgmt.managednetworkfabric.models.L2IsolationDomainPatch": "Microsoft.ManagedNetworkFabric.L2IsolationDomainPatch", + "azure.mgmt.managednetworkfabric.models.L2IsolationDomainPatchProperties": "Microsoft.ManagedNetworkFabric.L2IsolationDomainPatchProperties", + "azure.mgmt.managednetworkfabric.models.L2IsolationDomainProperties": "Microsoft.ManagedNetworkFabric.L2IsolationDomainProperties", + "azure.mgmt.managednetworkfabric.models.L3ExportRoutePolicy": "Microsoft.ManagedNetworkFabric.L3ExportRoutePolicy", + "azure.mgmt.managednetworkfabric.models.L3ExportRoutePolicyPatch": "Microsoft.ManagedNetworkFabric.L3ExportRoutePolicyPatch", + "azure.mgmt.managednetworkfabric.models.L3IsolationDomain": "Microsoft.ManagedNetworkFabric.L3IsolationDomain", + "azure.mgmt.managednetworkfabric.models.L3IsolationDomainPatch": "Microsoft.ManagedNetworkFabric.L3IsolationDomainPatch", + "azure.mgmt.managednetworkfabric.models.L3IsolationDomainPatchProperties": "Microsoft.ManagedNetworkFabric.L3IsolationDomainPatchProperties", + "azure.mgmt.managednetworkfabric.models.L3IsolationDomainProperties": "Microsoft.ManagedNetworkFabric.L3IsolationDomainProperties", + "azure.mgmt.managednetworkfabric.models.L3OptionBPatchProperties": "Microsoft.ManagedNetworkFabric.L3OptionBPatchProperties", + "azure.mgmt.managednetworkfabric.models.L3OptionBProperties": "Microsoft.ManagedNetworkFabric.L3OptionBProperties", + "azure.mgmt.managednetworkfabric.models.L3UniqueRouteDistinguisherProperties": "Microsoft.ManagedNetworkFabric.L3UniqueRouteDistinguisherProperties", + "azure.mgmt.managednetworkfabric.models.LastOperationProperties": "Microsoft.ManagedNetworkFabric.LastOperationProperties", + "azure.mgmt.managednetworkfabric.models.Layer2Configuration": "Microsoft.ManagedNetworkFabric.Layer2Configuration", + "azure.mgmt.managednetworkfabric.models.Layer2ConfigurationPatch": "Microsoft.ManagedNetworkFabric.Layer2ConfigurationPatch", + "azure.mgmt.managednetworkfabric.models.Layer3IpPrefixPatchProperties": "Microsoft.ManagedNetworkFabric.Layer3IpPrefixPatchProperties", + "azure.mgmt.managednetworkfabric.models.Layer3IpPrefixProperties": "Microsoft.ManagedNetworkFabric.Layer3IpPrefixProperties", + "azure.mgmt.managednetworkfabric.models.ManagedResourceGroupConfiguration": "Microsoft.ManagedNetworkFabric.ManagedResourceGroupConfiguration", + "azure.mgmt.managednetworkfabric.models.ManagedServiceIdentity": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity", + "azure.mgmt.managednetworkfabric.models.ManagedServiceIdentityPatch": "Microsoft.ManagedNetworkFabric.ManagedServiceIdentityPatch", + "azure.mgmt.managednetworkfabric.models.ManagementNetworkConfigurationProperties": "Microsoft.ManagedNetworkFabric.ManagementNetworkConfigurationProperties", + "azure.mgmt.managednetworkfabric.models.ManagementNetworkPatchConfiguration": "Microsoft.ManagedNetworkFabric.ManagementNetworkPatchConfiguration", + "azure.mgmt.managednetworkfabric.models.NativeIpv4PrefixLimitPatchProperties": "Microsoft.ManagedNetworkFabric.NativeIpv4PrefixLimitPatchProperties", + "azure.mgmt.managednetworkfabric.models.NativeIpv4PrefixLimitProperties": "Microsoft.ManagedNetworkFabric.NativeIpv4PrefixLimitProperties", + "azure.mgmt.managednetworkfabric.models.NativeIpv6PrefixLimitPatchProperties": "Microsoft.ManagedNetworkFabric.NativeIpv6PrefixLimitPatchProperties", + "azure.mgmt.managednetworkfabric.models.NativeIpv6PrefixLimitProperties": "Microsoft.ManagedNetworkFabric.NativeIpv6PrefixLimitProperties", + "azure.mgmt.managednetworkfabric.models.NeighborAddress": "Microsoft.ManagedNetworkFabric.NeighborAddress", + "azure.mgmt.managednetworkfabric.models.NeighborAddressBfdAdministrativeStatus": "Microsoft.ManagedNetworkFabric.NeighborAddressBfdAdministrativeStatus", + "azure.mgmt.managednetworkfabric.models.NeighborAddressBgpAdministrativeStatus": "Microsoft.ManagedNetworkFabric.NeighborAddressBgpAdministrativeStatus", + "azure.mgmt.managednetworkfabric.models.NeighborAddressPatch": "Microsoft.ManagedNetworkFabric.NeighborAddressPatch", + "azure.mgmt.managednetworkfabric.models.NeighborGroup": "Microsoft.ManagedNetworkFabric.NeighborGroup", + "azure.mgmt.managednetworkfabric.models.NeighborGroupDestination": "Microsoft.ManagedNetworkFabric.NeighborGroupDestination", + "azure.mgmt.managednetworkfabric.models.NeighborGroupDestinationPatch": "Microsoft.ManagedNetworkFabric.NeighborGroupDestinationPatch", + "azure.mgmt.managednetworkfabric.models.NeighborGroupPatch": "Microsoft.ManagedNetworkFabric.NeighborGroupPatch", + "azure.mgmt.managednetworkfabric.models.NeighborGroupPatchProperties": "Microsoft.ManagedNetworkFabric.NeighborGroupPatchProperties", + "azure.mgmt.managednetworkfabric.models.NeighborGroupProperties": "Microsoft.ManagedNetworkFabric.NeighborGroupProperties", + "azure.mgmt.managednetworkfabric.models.NeighborGroupResyncResponse": "Microsoft.ManagedNetworkFabric.NeighborGroupResyncResponse", + "azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevice": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDevice", + "azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevicePatch": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDevicePatch", + "azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevicePatchProperties": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDevicePatchProperties", + "azure.mgmt.managednetworkfabric.models.NetworkBootstrapDeviceProperties": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDeviceProperties", + "azure.mgmt.managednetworkfabric.models.NetworkBootstrapDeviceRebootResponse": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDeviceRebootResponse", + "azure.mgmt.managednetworkfabric.models.NetworkBootstrapDeviceRefreshConfigurationResponse": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDeviceRefreshConfigurationResponse", + "azure.mgmt.managednetworkfabric.models.NetworkBootstrapDeviceResyncPasswordsResponse": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDeviceResyncPasswordsResponse", + "azure.mgmt.managednetworkfabric.models.NetworkBootstrapDeviceUpdateAdministrativeStateResponse": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDeviceUpdateAdministrativeStateResponse", + "azure.mgmt.managednetworkfabric.models.NetworkBootstrapDeviceUpgradeResponse": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDeviceUpgradeResponse", + "azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterface": "Microsoft.ManagedNetworkFabric.NetworkBootstrapInterface", + "azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterfacePatch": "Microsoft.ManagedNetworkFabric.NetworkBootstrapInterfacePatch", + "azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterfacePatchProperties": "Microsoft.ManagedNetworkFabric.NetworkBootstrapInterfacePatchProperties", + "azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterfaceProperties": "Microsoft.ManagedNetworkFabric.NetworkBootstrapInterfaceProperties", + "azure.mgmt.managednetworkfabric.models.NetworkDevice": "Microsoft.ManagedNetworkFabric.NetworkDevice", + "azure.mgmt.managednetworkfabric.models.NetworkDevicePatchParameters": "Microsoft.ManagedNetworkFabric.NetworkDevicePatchParameters", + "azure.mgmt.managednetworkfabric.models.NetworkDevicePatchParametersProperties": "Microsoft.ManagedNetworkFabric.NetworkDevicePatchParametersProperties", + "azure.mgmt.managednetworkfabric.models.NetworkDeviceProperties": "Microsoft.ManagedNetworkFabric.NetworkDeviceProperties", + "azure.mgmt.managednetworkfabric.models.NetworkDeviceRefreshConfigurationResponse": "Microsoft.ManagedNetworkFabric.NetworkDeviceRefreshConfigurationResponse", + "azure.mgmt.managednetworkfabric.models.NetworkDeviceResyncPasswordsResponse": "Microsoft.ManagedNetworkFabric.NetworkDeviceResyncPasswordsResponse", + "azure.mgmt.managednetworkfabric.models.NetworkDeviceRunRwCommandResponse": "Microsoft.ManagedNetworkFabric.NetworkDeviceRunRwCommandResponse", + "azure.mgmt.managednetworkfabric.models.NetworkDeviceRwCommandResponseProperties": "Microsoft.ManagedNetworkFabric.NetworkDeviceRwCommandResponseProperties", + "azure.mgmt.managednetworkfabric.models.NetworkDeviceSku": "Microsoft.ManagedNetworkFabric.NetworkDeviceSku", + "azure.mgmt.managednetworkfabric.models.NetworkDeviceSkuProperties": "Microsoft.ManagedNetworkFabric.NetworkDeviceSkuProperties", + "azure.mgmt.managednetworkfabric.models.NetworkDeviceUpdateAdministrativeStateResponse": "Microsoft.ManagedNetworkFabric.NetworkDeviceUpdateAdministrativeStateResponse", + "azure.mgmt.managednetworkfabric.models.NetworkDeviceUpgradeRequest": "Microsoft.ManagedNetworkFabric.NetworkDeviceUpgradeRequest", + "azure.mgmt.managednetworkfabric.models.NetworkDeviceUpgradeResponse": "Microsoft.ManagedNetworkFabric.NetworkDeviceUpgradeResponse", + "azure.mgmt.managednetworkfabric.models.NetworkFabric": "Microsoft.ManagedNetworkFabric.NetworkFabric", + "azure.mgmt.managednetworkfabric.models.NetworkFabricController": "Microsoft.ManagedNetworkFabric.NetworkFabricController", + "azure.mgmt.managednetworkfabric.models.NetworkFabricControllerPatch": "Microsoft.ManagedNetworkFabric.NetworkFabricControllerPatch", + "azure.mgmt.managednetworkfabric.models.NetworkFabricControllerPatchProperties": "Microsoft.ManagedNetworkFabric.NetworkFabricControllerPatchProperties", + "azure.mgmt.managednetworkfabric.models.NetworkFabricControllerProperties": "Microsoft.ManagedNetworkFabric.NetworkFabricControllerProperties", + "azure.mgmt.managednetworkfabric.models.NetworkFabricLockRequest": "Microsoft.ManagedNetworkFabric.NetworkFabricLockRequest", + "azure.mgmt.managednetworkfabric.models.NetworkFabricPatch": "Microsoft.ManagedNetworkFabric.NetworkFabricPatch", + "azure.mgmt.managednetworkfabric.models.NetworkFabricPatchProperties": "Microsoft.ManagedNetworkFabric.NetworkFabricPatchProperties", + "azure.mgmt.managednetworkfabric.models.NetworkFabricProperties": "Microsoft.ManagedNetworkFabric.NetworkFabricProperties", + "azure.mgmt.managednetworkfabric.models.NetworkFabricResyncCertificatesResponse": "Microsoft.ManagedNetworkFabric.NetworkFabricResyncCertificatesResponse", + "azure.mgmt.managednetworkfabric.models.NetworkFabricResyncPasswordsResponse": "Microsoft.ManagedNetworkFabric.NetworkFabricResyncPasswordsResponse", + "azure.mgmt.managednetworkfabric.models.NetworkFabricRotateCertificatesResponse": "Microsoft.ManagedNetworkFabric.NetworkFabricRotateCertificatesResponse", + "azure.mgmt.managednetworkfabric.models.NetworkFabricRotatePasswordsResponse": "Microsoft.ManagedNetworkFabric.NetworkFabricRotatePasswordsResponse", + "azure.mgmt.managednetworkfabric.models.NetworkFabricSku": "Microsoft.ManagedNetworkFabric.NetworkFabricSku", + "azure.mgmt.managednetworkfabric.models.NetworkFabricSkuProperties": "Microsoft.ManagedNetworkFabric.NetworkFabricSkuProperties", + "azure.mgmt.managednetworkfabric.models.NetworkInterface": "Microsoft.ManagedNetworkFabric.NetworkInterface", + "azure.mgmt.managednetworkfabric.models.NetworkInterfacePatch": "Microsoft.ManagedNetworkFabric.NetworkInterfacePatch", + "azure.mgmt.managednetworkfabric.models.NetworkInterfacePatchProperties": "Microsoft.ManagedNetworkFabric.NetworkInterfacePatchProperties", + "azure.mgmt.managednetworkfabric.models.NetworkInterfaceProperties": "Microsoft.ManagedNetworkFabric.NetworkInterfaceProperties", + "azure.mgmt.managednetworkfabric.models.NetworkMonitor": "Microsoft.ManagedNetworkFabric.NetworkMonitor", + "azure.mgmt.managednetworkfabric.models.NetworkMonitorPatch": "Microsoft.ManagedNetworkFabric.NetworkMonitorPatch", + "azure.mgmt.managednetworkfabric.models.NetworkMonitorPatchProperties": "Microsoft.ManagedNetworkFabric.NetworkMonitorPatchProperties", + "azure.mgmt.managednetworkfabric.models.NetworkMonitorProperties": "Microsoft.ManagedNetworkFabric.NetworkMonitorProperties", + "azure.mgmt.managednetworkfabric.models.NetworkPacketBroker": "Microsoft.ManagedNetworkFabric.NetworkPacketBroker", + "azure.mgmt.managednetworkfabric.models.NetworkPacketBrokerPatch": "Microsoft.ManagedNetworkFabric.NetworkPacketBrokerPatch", + "azure.mgmt.managednetworkfabric.models.NetworkPacketBrokerProperties": "Microsoft.ManagedNetworkFabric.NetworkPacketBrokerProperties", + "azure.mgmt.managednetworkfabric.models.NetworkRack": "Microsoft.ManagedNetworkFabric.NetworkRack", + "azure.mgmt.managednetworkfabric.models.NetworkRackPatch": "Microsoft.ManagedNetworkFabric.NetworkRackPatch", + "azure.mgmt.managednetworkfabric.models.NetworkRackProperties": "Microsoft.ManagedNetworkFabric.NetworkRackProperties", + "azure.mgmt.managednetworkfabric.models.NetworkTap": "Microsoft.ManagedNetworkFabric.NetworkTap", + "azure.mgmt.managednetworkfabric.models.NetworkTapPatch": "Microsoft.ManagedNetworkFabric.NetworkTapPatch", + "azure.mgmt.managednetworkfabric.models.NetworkTapPatchProperties": "Microsoft.ManagedNetworkFabric.NetworkTapPatchProperties", + "azure.mgmt.managednetworkfabric.models.NetworkTapProperties": "Microsoft.ManagedNetworkFabric.NetworkTapProperties", + "azure.mgmt.managednetworkfabric.models.NetworkTapResyncResponse": "Microsoft.ManagedNetworkFabric.NetworkTapResyncResponse", + "azure.mgmt.managednetworkfabric.models.NetworkTapRule": "Microsoft.ManagedNetworkFabric.NetworkTapRule", + "azure.mgmt.managednetworkfabric.models.NetworkTapRuleAction": "Microsoft.ManagedNetworkFabric.NetworkTapRuleAction", + "azure.mgmt.managednetworkfabric.models.NetworkTapRuleActionPatch": "Microsoft.ManagedNetworkFabric.NetworkTapRuleActionPatch", + "azure.mgmt.managednetworkfabric.models.NetworkTapRuleMatchCondition": "Microsoft.ManagedNetworkFabric.NetworkTapRuleMatchCondition", + "azure.mgmt.managednetworkfabric.models.NetworkTapRuleMatchConditionPatch": "Microsoft.ManagedNetworkFabric.NetworkTapRuleMatchConditionPatch", + "azure.mgmt.managednetworkfabric.models.NetworkTapRuleMatchConfiguration": "Microsoft.ManagedNetworkFabric.NetworkTapRuleMatchConfiguration", + "azure.mgmt.managednetworkfabric.models.NetworkTapRuleMatchConfigurationPatch": "Microsoft.ManagedNetworkFabric.NetworkTapRuleMatchConfigurationPatch", + "azure.mgmt.managednetworkfabric.models.NetworkTapRulePatch": "Microsoft.ManagedNetworkFabric.NetworkTapRulePatch", + "azure.mgmt.managednetworkfabric.models.NetworkTapRulePatchProperties": "Microsoft.ManagedNetworkFabric.NetworkTapRulePatchProperties", + "azure.mgmt.managednetworkfabric.models.NetworkTapRuleProperties": "Microsoft.ManagedNetworkFabric.NetworkTapRuleProperties", + "azure.mgmt.managednetworkfabric.models.NetworkTapRuleResyncResponse": "Microsoft.ManagedNetworkFabric.NetworkTapRuleResyncResponse", + "azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect": "Microsoft.ManagedNetworkFabric.NetworkToNetworkInterconnect", + "azure.mgmt.managednetworkfabric.models.ProxyResourceBase": "Microsoft.ManagedNetworkFabric.ProxyResourceBase", + "azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnectPatch": "Microsoft.ManagedNetworkFabric.NetworkToNetworkInterconnectPatch", + "azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnectPatchProperties": "Microsoft.ManagedNetworkFabric.NetworkToNetworkInterconnectPatchProperties", + "azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnectProperties": "Microsoft.ManagedNetworkFabric.NetworkToNetworkInterconnectProperties", + "azure.mgmt.managednetworkfabric.models.NniBmpPatchProperties": "Microsoft.ManagedNetworkFabric.NniBmpPatchProperties", + "azure.mgmt.managednetworkfabric.models.NniBmpProperties": "Microsoft.ManagedNetworkFabric.NniBmpProperties", + "azure.mgmt.managednetworkfabric.models.NniStaticRouteConfiguration": "Microsoft.ManagedNetworkFabric.NniStaticRouteConfiguration", + "azure.mgmt.managednetworkfabric.models.NniStaticRoutePatchConfiguration": "Microsoft.ManagedNetworkFabric.NniStaticRoutePatchConfiguration", + "azure.mgmt.managednetworkfabric.models.NniUpdateBfdAdministrativeStateRequest": "Microsoft.ManagedNetworkFabric.NniUpdateBfdAdministrativeStateRequest", + "azure.mgmt.managednetworkfabric.models.NniUpdateBfdAdministrativeStateResponse": "Microsoft.ManagedNetworkFabric.NniUpdateBfdAdministrativeStateResponse", + "azure.mgmt.managednetworkfabric.models.NniUpdateBfdAdministrativeStateResponseProperties": "Microsoft.ManagedNetworkFabric.NniUpdateBfdAdministrativeStateResponseProperties", + "azure.mgmt.managednetworkfabric.models.NpbStaticRouteConfiguration": "Microsoft.ManagedNetworkFabric.NpbStaticRouteConfiguration", + "azure.mgmt.managednetworkfabric.models.NpbStaticRouteConfigurationPatch": "Microsoft.ManagedNetworkFabric.NpbStaticRouteConfigurationPatch", + "azure.mgmt.managednetworkfabric.models.Operation": "Azure.ResourceManager.CommonTypes.Operation", + "azure.mgmt.managednetworkfabric.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "azure.mgmt.managednetworkfabric.models.OperationStatusResult": "Azure.ResourceManager.CommonTypes.OperationStatusResult", + "azure.mgmt.managednetworkfabric.models.OptionBLayer3Configuration": "Microsoft.ManagedNetworkFabric.OptionBLayer3Configuration", + "azure.mgmt.managednetworkfabric.models.OptionBLayer3ConfigurationPatchProperties": "Microsoft.ManagedNetworkFabric.OptionBLayer3ConfigurationPatchProperties", + "azure.mgmt.managednetworkfabric.models.OptionBLayer3PrefixLimitPatchProperties": "Microsoft.ManagedNetworkFabric.OptionBLayer3PrefixLimitPatchProperties", + "azure.mgmt.managednetworkfabric.models.OptionBLayer3PrefixLimitProperties": "Microsoft.ManagedNetworkFabric.OptionBLayer3PrefixLimitProperties", + "azure.mgmt.managednetworkfabric.models.PoliceRateConfigurationProperties": "Microsoft.ManagedNetworkFabric.PoliceRateConfigurationProperties", + "azure.mgmt.managednetworkfabric.models.PortGroupPatchProperties": "Microsoft.ManagedNetworkFabric.PortGroupPatchProperties", + "azure.mgmt.managednetworkfabric.models.PortGroupProperties": "Microsoft.ManagedNetworkFabric.PortGroupProperties", + "azure.mgmt.managednetworkfabric.models.PrefixLimitPatchProperties": "Microsoft.ManagedNetworkFabric.PrefixLimitPatchProperties", + "azure.mgmt.managednetworkfabric.models.PrefixLimitProperties": "Microsoft.ManagedNetworkFabric.PrefixLimitProperties", + "azure.mgmt.managednetworkfabric.models.QosPatchProperties": "Microsoft.ManagedNetworkFabric.QosPatchProperties", + "azure.mgmt.managednetworkfabric.models.QosProperties": "Microsoft.ManagedNetworkFabric.QosProperties", + "azure.mgmt.managednetworkfabric.models.RebootProperties": "Microsoft.ManagedNetworkFabric.RebootProperties", + "azure.mgmt.managednetworkfabric.models.RoutePolicy": "Microsoft.ManagedNetworkFabric.RoutePolicy", + "azure.mgmt.managednetworkfabric.models.RoutePolicyPatch": "Microsoft.ManagedNetworkFabric.RoutePolicyPatch", + "azure.mgmt.managednetworkfabric.models.RoutePolicyPatchableProperties": "Microsoft.ManagedNetworkFabric.RoutePolicyPatchableProperties", + "azure.mgmt.managednetworkfabric.models.RoutePolicyProperties": "Microsoft.ManagedNetworkFabric.RoutePolicyProperties", + "azure.mgmt.managednetworkfabric.models.RoutePolicyStatementPatchProperties": "Microsoft.ManagedNetworkFabric.RoutePolicyStatementPatchProperties", + "azure.mgmt.managednetworkfabric.models.RoutePolicyStatementProperties": "Microsoft.ManagedNetworkFabric.RoutePolicyStatementProperties", + "azure.mgmt.managednetworkfabric.models.RoutePrefixLimitPatchProperties": "Microsoft.ManagedNetworkFabric.RoutePrefixLimitPatchProperties", + "azure.mgmt.managednetworkfabric.models.RoutePrefixLimitProperties": "Microsoft.ManagedNetworkFabric.RoutePrefixLimitProperties", + "azure.mgmt.managednetworkfabric.models.RouteTargetInformation": "Microsoft.ManagedNetworkFabric.RouteTargetInformation", + "azure.mgmt.managednetworkfabric.models.RouteTargetPatchInformation": "Microsoft.ManagedNetworkFabric.RouteTargetPatchInformation", + "azure.mgmt.managednetworkfabric.models.RuleProperties": "Microsoft.ManagedNetworkFabric.RuleProperties", + "azure.mgmt.managednetworkfabric.models.SecretArchiveReference": "Microsoft.ManagedNetworkFabric.SecretArchiveReference", + "azure.mgmt.managednetworkfabric.models.SecretRotationStatus": "Microsoft.ManagedNetworkFabric.SecretRotationStatus", + "azure.mgmt.managednetworkfabric.models.SecretRotationSummary": "Microsoft.ManagedNetworkFabric.SecretRotationSummary", + "azure.mgmt.managednetworkfabric.models.StatementActionPatchProperties": "Microsoft.ManagedNetworkFabric.StatementActionPatchProperties", + "azure.mgmt.managednetworkfabric.models.StatementActionProperties": "Microsoft.ManagedNetworkFabric.StatementActionProperties", + "azure.mgmt.managednetworkfabric.models.StatementConditionPatchProperties": "Microsoft.ManagedNetworkFabric.StatementConditionPatchProperties", + "azure.mgmt.managednetworkfabric.models.StatementConditionProperties": "Microsoft.ManagedNetworkFabric.StatementConditionProperties", + "azure.mgmt.managednetworkfabric.models.StaticRouteConfiguration": "Microsoft.ManagedNetworkFabric.StaticRouteConfiguration", + "azure.mgmt.managednetworkfabric.models.StaticRoutePatchConfiguration": "Microsoft.ManagedNetworkFabric.StaticRoutePatchConfiguration", + "azure.mgmt.managednetworkfabric.models.StaticRoutePatchProperties": "Microsoft.ManagedNetworkFabric.StaticRoutePatchProperties", + "azure.mgmt.managednetworkfabric.models.StaticRouteProperties": "Microsoft.ManagedNetworkFabric.StaticRouteProperties", + "azure.mgmt.managednetworkfabric.models.StaticRouteRoutePolicy": "Microsoft.ManagedNetworkFabric.StaticRouteRoutePolicy", + "azure.mgmt.managednetworkfabric.models.StaticRouteRoutePolicyPatch": "Microsoft.ManagedNetworkFabric.StaticRouteRoutePolicyPatch", + "azure.mgmt.managednetworkfabric.models.StationConnectionPatchProperties": "Microsoft.ManagedNetworkFabric.StationConnectionPatchProperties", + "azure.mgmt.managednetworkfabric.models.StationConnectionProperties": "Microsoft.ManagedNetworkFabric.StationConnectionProperties", + "azure.mgmt.managednetworkfabric.models.StorageAccountConfiguration": "Microsoft.ManagedNetworkFabric.StorageAccountConfiguration", + "azure.mgmt.managednetworkfabric.models.StorageAccountPatchConfiguration": "Microsoft.ManagedNetworkFabric.StorageAccountPatchConfiguration", + "azure.mgmt.managednetworkfabric.models.SupportedConnectorProperties": "Microsoft.ManagedNetworkFabric.SupportedConnectorProperties", + "azure.mgmt.managednetworkfabric.models.SupportedVersionProperties": "Microsoft.ManagedNetworkFabric.SupportedVersionProperties", + "azure.mgmt.managednetworkfabric.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", + "azure.mgmt.managednetworkfabric.models.TerminalServerConfiguration": "Microsoft.ManagedNetworkFabric.TerminalServerConfiguration", + "azure.mgmt.managednetworkfabric.models.TerminalServerPatchConfiguration": "Microsoft.ManagedNetworkFabric.TerminalServerPatchConfiguration", + "azure.mgmt.managednetworkfabric.models.UniqueRouteDistinguisherPatchProperties": "Microsoft.ManagedNetworkFabric.UniqueRouteDistinguisherPatchProperties", + "azure.mgmt.managednetworkfabric.models.UniqueRouteDistinguisherProperties": "Microsoft.ManagedNetworkFabric.UniqueRouteDistinguisherProperties", + "azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState": "Microsoft.ManagedNetworkFabric.UpdateAdministrativeState", + "azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse": "Microsoft.ManagedNetworkFabric.UpdateAdministrativeStateResponse", + "azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponseProperties": "Microsoft.ManagedNetworkFabric.UpdateAdministrativeStateResponseProperties", + "azure.mgmt.managednetworkfabric.models.UpdateDeviceAdministrativeState": "Microsoft.ManagedNetworkFabric.UpdateDeviceAdministrativeState", + "azure.mgmt.managednetworkfabric.models.UpdateVersion": "Microsoft.ManagedNetworkFabric.UpdateVersion", + "azure.mgmt.managednetworkfabric.models.UpgradeNetworkFabricProperties": "Microsoft.ManagedNetworkFabric.UpgradeNetworkFabricProperties", + "azure.mgmt.managednetworkfabric.models.UserAssignedIdentity": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity", + "azure.mgmt.managednetworkfabric.models.ValidateConfigurationProperties": "Microsoft.ManagedNetworkFabric.ValidateConfigurationProperties", + "azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse": "Microsoft.ManagedNetworkFabric.ValidateConfigurationResponse", + "azure.mgmt.managednetworkfabric.models.ViewDeviceConfigurationOperationResponse": "Microsoft.ManagedNetworkFabric.ViewDeviceConfigurationOperationResponse", + "azure.mgmt.managednetworkfabric.models.ViewDeviceConfigurationResponseProperties": "Microsoft.ManagedNetworkFabric.ViewDeviceConfigurationResponseProperties", + "azure.mgmt.managednetworkfabric.models.VlanGroupPatchProperties": "Microsoft.ManagedNetworkFabric.VlanGroupPatchProperties", + "azure.mgmt.managednetworkfabric.models.VlanGroupProperties": "Microsoft.ManagedNetworkFabric.VlanGroupProperties", + "azure.mgmt.managednetworkfabric.models.VlanMatchCondition": "Microsoft.ManagedNetworkFabric.VlanMatchCondition", + "azure.mgmt.managednetworkfabric.models.VlanMatchConditionPatch": "Microsoft.ManagedNetworkFabric.VlanMatchConditionPatch", + "azure.mgmt.managednetworkfabric.models.VpnConfigurationPatchableProperties": "Microsoft.ManagedNetworkFabric.VpnConfigurationPatchableProperties", + "azure.mgmt.managednetworkfabric.models.VpnConfigurationProperties": "Microsoft.ManagedNetworkFabric.VpnConfigurationProperties", + "azure.mgmt.managednetworkfabric.models.VpnOptionAPatchProperties": "Microsoft.ManagedNetworkFabric.VpnOptionAPatchProperties", + "azure.mgmt.managednetworkfabric.models.VpnOptionAProperties": "Microsoft.ManagedNetworkFabric.VpnOptionAProperties", + "azure.mgmt.managednetworkfabric.models.VpnOptionBPatchProperties": "Microsoft.ManagedNetworkFabric.VpnOptionBPatchProperties", + "azure.mgmt.managednetworkfabric.models.VpnOptionBProperties": "Microsoft.ManagedNetworkFabric.VpnOptionBProperties", + "azure.mgmt.managednetworkfabric.models.Origin": "Azure.ResourceManager.CommonTypes.Origin", + "azure.mgmt.managednetworkfabric.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType", + "azure.mgmt.managednetworkfabric.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType", + "azure.mgmt.managednetworkfabric.models.ConfigurationType": "Microsoft.ManagedNetworkFabric.ConfigurationType", + "azure.mgmt.managednetworkfabric.models.CommunityActionTypes": "Microsoft.ManagedNetworkFabric.CommunityActionTypes", + "azure.mgmt.managednetworkfabric.models.IPAddressType": "Microsoft.ManagedNetworkFabric.IPAddressType", + "azure.mgmt.managednetworkfabric.models.SourceDestinationType": "Microsoft.ManagedNetworkFabric.SourceDestinationType", + "azure.mgmt.managednetworkfabric.models.PrefixType": "Microsoft.ManagedNetworkFabric.PrefixType", + "azure.mgmt.managednetworkfabric.models.PortType": "Microsoft.ManagedNetworkFabric.PortType", + "azure.mgmt.managednetworkfabric.models.Layer4Protocol": "Microsoft.ManagedNetworkFabric.Layer4Protocol", + "azure.mgmt.managednetworkfabric.models.AclActionType": "Microsoft.ManagedNetworkFabric.AclActionType", + "azure.mgmt.managednetworkfabric.models.BitRateUnit": "Microsoft.ManagedNetworkFabric.BitRateUnit", + "azure.mgmt.managednetworkfabric.models.BurstSizeUnit": "Microsoft.ManagedNetworkFabric.BurstSizeUnit", + "azure.mgmt.managednetworkfabric.models.AclType": "Microsoft.ManagedNetworkFabric.AclType", + "azure.mgmt.managednetworkfabric.models.DeviceRole": "Microsoft.ManagedNetworkFabric.DeviceRole", + "azure.mgmt.managednetworkfabric.models.BooleanEnumProperty": "Microsoft.ManagedNetworkFabric.BooleanEnumProperty", + "azure.mgmt.managednetworkfabric.models.ControlPlaneAclTtlMatchType": "Microsoft.ManagedNetworkFabric.ControlPlaneAclTtlMatchType", + "azure.mgmt.managednetworkfabric.models.ControlPlaneAclPortMatchType": "Microsoft.ManagedNetworkFabric.ControlPlaneAclPortMatchType", + "azure.mgmt.managednetworkfabric.models.ControlPlaneAclActionType": "Microsoft.ManagedNetworkFabric.ControlPlaneAclActionType", + "azure.mgmt.managednetworkfabric.models.ConfigurationState": "Microsoft.ManagedNetworkFabric.ConfigurationState", + "azure.mgmt.managednetworkfabric.models.ProvisioningState": "Microsoft.ManagedNetworkFabric.ProvisioningState", + "azure.mgmt.managednetworkfabric.models.AdministrativeState": "Microsoft.ManagedNetworkFabric.AdministrativeState", + "azure.mgmt.managednetworkfabric.models.EnableDisableState": "Microsoft.ManagedNetworkFabric.EnableDisableState", + "azure.mgmt.managednetworkfabric.models.Action": "Microsoft.ManagedNetworkFabric.Action", + "azure.mgmt.managednetworkfabric.models.RuleCondition": "Microsoft.ManagedNetworkFabric.RuleCondition", + "azure.mgmt.managednetworkfabric.models.GatewayType": "Microsoft.ManagedNetworkFabric.GatewayType", + "azure.mgmt.managednetworkfabric.models.WellKnownCommunities": "Microsoft.ManagedNetworkFabric.WellKnownCommunities", + "azure.mgmt.managednetworkfabric.models.Condition": "Microsoft.ManagedNetworkFabric.Condition", + "azure.mgmt.managednetworkfabric.models.ExtendedVlan": "Microsoft.ManagedNetworkFabric.ExtendedVlan", + "azure.mgmt.managednetworkfabric.models.ManagedServiceIdentityType": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType", + "azure.mgmt.managednetworkfabric.models.RedistributeConnectedSubnets": "Microsoft.ManagedNetworkFabric.RedistributeConnectedSubnets", + "azure.mgmt.managednetworkfabric.models.RedistributeStaticRoutes": "Microsoft.ManagedNetworkFabric.RedistributeStaticRoutes", + "azure.mgmt.managednetworkfabric.models.BmpExportPolicy": "Microsoft.ManagedNetworkFabric.BmpExportPolicy", + "azure.mgmt.managednetworkfabric.models.Extension": "Microsoft.ManagedNetworkFabric.Extension", + "azure.mgmt.managednetworkfabric.models.IsMonitoringEnabled": "Microsoft.ManagedNetworkFabric.IsMonitoringEnabled", + "azure.mgmt.managednetworkfabric.models.BfdAdministrativeState": "Microsoft.ManagedNetworkFabric.BfdAdministrativeState", + "azure.mgmt.managednetworkfabric.models.AllowASOverride": "Microsoft.ManagedNetworkFabric.AllowASOverride", + "azure.mgmt.managednetworkfabric.models.BgpAdministrativeState": "Microsoft.ManagedNetworkFabric.BgpAdministrativeState", + "azure.mgmt.managednetworkfabric.models.BmpConfigurationState": "Microsoft.ManagedNetworkFabric.BmpConfigurationState", + "azure.mgmt.managednetworkfabric.models.V4OverV6BgpSessionState": "Microsoft.ManagedNetworkFabric.V4OverV6BgpSessionState", + "azure.mgmt.managednetworkfabric.models.V6OverV4BgpSessionState": "Microsoft.ManagedNetworkFabric.V6OverV4BgpSessionState", + "azure.mgmt.managednetworkfabric.models.InternalNetworkRouteType": "Microsoft.ManagedNetworkFabric.InternalNetworkRouteType", + "azure.mgmt.managednetworkfabric.models.PeeringOption": "Microsoft.ManagedNetworkFabric.PeeringOption", + "azure.mgmt.managednetworkfabric.models.ExternalNetworkRouteType": "Microsoft.ManagedNetworkFabric.ExternalNetworkRouteType", + "azure.mgmt.managednetworkfabric.models.NetworkDeviceRoleName": "Microsoft.ManagedNetworkFabric.NetworkDeviceRoleName", + "azure.mgmt.managednetworkfabric.models.ManagedServiceIdentitySelectorType": "Microsoft.ManagedNetworkFabric.ManagedServiceIdentitySelectorType", + "azure.mgmt.managednetworkfabric.models.NetworkDeviceRole": "Microsoft.ManagedNetworkFabric.NetworkDeviceRole", + "azure.mgmt.managednetworkfabric.models.SynchronizationStatus": "Microsoft.ManagedNetworkFabric.SynchronizationStatus", + "azure.mgmt.managednetworkfabric.models.RebootType": "Microsoft.ManagedNetworkFabric.RebootType", + "azure.mgmt.managednetworkfabric.models.DeviceAdministrativeState": "Microsoft.ManagedNetworkFabric.DeviceAdministrativeState", + "azure.mgmt.managednetworkfabric.models.InterfaceType": "Microsoft.ManagedNetworkFabric.InterfaceType", + "azure.mgmt.managednetworkfabric.models.IsWorkloadManagementNetworkEnabled": "Microsoft.ManagedNetworkFabric.IsWorkloadManagementNetworkEnabled", + "azure.mgmt.managednetworkfabric.models.NfcSku": "Microsoft.ManagedNetworkFabric.NfcSku", + "azure.mgmt.managednetworkfabric.models.FabricSkuType": "Microsoft.ManagedNetworkFabric.FabricSkuType", + "azure.mgmt.managednetworkfabric.models.LockConfigurationState": "Microsoft.ManagedNetworkFabric.LockConfigurationState", + "azure.mgmt.managednetworkfabric.models.NetworkFabricLockType": "Microsoft.ManagedNetworkFabric.NetworkFabricLockType", + "azure.mgmt.managednetworkfabric.models.UniqueRouteDistinguisherConfigurationState": "Microsoft.ManagedNetworkFabric.UniqueRouteDistinguisherConfigurationState", + "azure.mgmt.managednetworkfabric.models.NNIDerivedUniqueRouteDistinguisherConfigurationState": "Microsoft.ManagedNetworkFabric.NNIDerivedUniqueRouteDistinguisherConfigurationState", + "azure.mgmt.managednetworkfabric.models.QosConfigurationState": "Microsoft.ManagedNetworkFabric.QosConfigurationState", + "azure.mgmt.managednetworkfabric.models.NetworkFabricUpgradeAction": "Microsoft.ManagedNetworkFabric.NetworkFabricUpgradeAction", + "azure.mgmt.managednetworkfabric.models.ValidateAction": "Microsoft.ManagedNetworkFabric.ValidateAction", + "azure.mgmt.managednetworkfabric.models.CommitStage": "Microsoft.ManagedNetworkFabric.CommitStage", + "azure.mgmt.managednetworkfabric.models.CommitConfigurationPolicy": "Microsoft.ManagedNetworkFabric.CommitConfigurationPolicy", + "azure.mgmt.managednetworkfabric.models.CommitBatchState": "Microsoft.ManagedNetworkFabric.CommitBatchState", + "azure.mgmt.managednetworkfabric.models.NetworkFabricLockAction": "Microsoft.ManagedNetworkFabric.NetworkFabricLockAction", + "azure.mgmt.managednetworkfabric.models.NniType": "Microsoft.ManagedNetworkFabric.NniType", + "azure.mgmt.managednetworkfabric.models.IsManagementType": "Microsoft.ManagedNetworkFabric.IsManagementType", + "azure.mgmt.managednetworkfabric.models.MicroBfdState": "Microsoft.ManagedNetworkFabric.MicroBfdState", + "azure.mgmt.managednetworkfabric.models.RouteType": "Microsoft.ManagedNetworkFabric.RouteType", + "azure.mgmt.managednetworkfabric.models.NetworkRackType": "Microsoft.ManagedNetworkFabric.NetworkRackType", + "azure.mgmt.managednetworkfabric.models.EncapsulationType": "Microsoft.ManagedNetworkFabric.EncapsulationType", + "azure.mgmt.managednetworkfabric.models.TapRuleActionType": "Microsoft.ManagedNetworkFabric.TapRuleActionType", + "azure.mgmt.managednetworkfabric.models.DestinationType": "Microsoft.ManagedNetworkFabric.DestinationType", + "azure.mgmt.managednetworkfabric.models.Encapsulation": "Microsoft.ManagedNetworkFabric.Encapsulation", + "azure.mgmt.managednetworkfabric.models.PollingType": "Microsoft.ManagedNetworkFabric.PollingType", + "azure.mgmt.managednetworkfabric.models.RoutePolicyConditionType": "Microsoft.ManagedNetworkFabric.RoutePolicyConditionType", + "azure.mgmt.managednetworkfabric.models.RoutePolicyActionType": "Microsoft.ManagedNetworkFabric.RoutePolicyActionType", + "azure.mgmt.managednetworkfabric.models.AddressFamilyType": "Microsoft.ManagedNetworkFabric.AddressFamilyType", + "azure.mgmt.managednetworkfabric.models.StationConfigurationState": "Microsoft.ManagedNetworkFabric.StationConfigurationState", + "azure.mgmt.managednetworkfabric.models.StationConnectionMode": "Microsoft.ManagedNetworkFabric.StationConnectionMode", + "azure.mgmt.managednetworkfabric.models.BmpMonitoredAddressFamily": "Microsoft.ManagedNetworkFabric.BmpMonitoredAddressFamily", + "azure.mgmt.managednetworkfabric.operations.Operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.managednetworkfabric.aio.operations.Operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.managednetworkfabric.operations.AccessControlListsOperations.get": "Microsoft.ManagedNetworkFabric.AccessControlLists.get", + "azure.mgmt.managednetworkfabric.aio.operations.AccessControlListsOperations.get": "Microsoft.ManagedNetworkFabric.AccessControlLists.get", + "azure.mgmt.managednetworkfabric.operations.AccessControlListsOperations.begin_create": "Microsoft.ManagedNetworkFabric.AccessControlLists.create", + "azure.mgmt.managednetworkfabric.aio.operations.AccessControlListsOperations.begin_create": "Microsoft.ManagedNetworkFabric.AccessControlLists.create", + "azure.mgmt.managednetworkfabric.operations.AccessControlListsOperations.begin_update": "Microsoft.ManagedNetworkFabric.AccessControlLists.update", + "azure.mgmt.managednetworkfabric.aio.operations.AccessControlListsOperations.begin_update": "Microsoft.ManagedNetworkFabric.AccessControlLists.update", + "azure.mgmt.managednetworkfabric.operations.AccessControlListsOperations.begin_delete": "Microsoft.ManagedNetworkFabric.AccessControlLists.delete", + "azure.mgmt.managednetworkfabric.aio.operations.AccessControlListsOperations.begin_delete": "Microsoft.ManagedNetworkFabric.AccessControlLists.delete", + "azure.mgmt.managednetworkfabric.operations.AccessControlListsOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.AccessControlLists.listByResourceGroup", + "azure.mgmt.managednetworkfabric.aio.operations.AccessControlListsOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.AccessControlLists.listByResourceGroup", + "azure.mgmt.managednetworkfabric.operations.AccessControlListsOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.AccessControlLists.listBySubscription", + "azure.mgmt.managednetworkfabric.aio.operations.AccessControlListsOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.AccessControlLists.listBySubscription", + "azure.mgmt.managednetworkfabric.operations.AccessControlListsOperations.begin_update_administrative_state": "Microsoft.ManagedNetworkFabric.AccessControlLists.updateAdministrativeState", + "azure.mgmt.managednetworkfabric.aio.operations.AccessControlListsOperations.begin_update_administrative_state": "Microsoft.ManagedNetworkFabric.AccessControlLists.updateAdministrativeState", + "azure.mgmt.managednetworkfabric.operations.AccessControlListsOperations.begin_resync": "Microsoft.ManagedNetworkFabric.AccessControlLists.resync", + "azure.mgmt.managednetworkfabric.aio.operations.AccessControlListsOperations.begin_resync": "Microsoft.ManagedNetworkFabric.AccessControlLists.resync", + "azure.mgmt.managednetworkfabric.operations.AccessControlListsOperations.begin_validate_configuration": "Microsoft.ManagedNetworkFabric.AccessControlLists.validateConfiguration", + "azure.mgmt.managednetworkfabric.aio.operations.AccessControlListsOperations.begin_validate_configuration": "Microsoft.ManagedNetworkFabric.AccessControlLists.validateConfiguration", + "azure.mgmt.managednetworkfabric.operations.InternetGatewayRulesOperations.get": "Microsoft.ManagedNetworkFabric.InternetGatewayRules.get", + "azure.mgmt.managednetworkfabric.aio.operations.InternetGatewayRulesOperations.get": "Microsoft.ManagedNetworkFabric.InternetGatewayRules.get", + "azure.mgmt.managednetworkfabric.operations.InternetGatewayRulesOperations.begin_create": "Microsoft.ManagedNetworkFabric.InternetGatewayRules.create", + "azure.mgmt.managednetworkfabric.aio.operations.InternetGatewayRulesOperations.begin_create": "Microsoft.ManagedNetworkFabric.InternetGatewayRules.create", + "azure.mgmt.managednetworkfabric.operations.InternetGatewayRulesOperations.begin_update": "Microsoft.ManagedNetworkFabric.InternetGatewayRules.update", + "azure.mgmt.managednetworkfabric.aio.operations.InternetGatewayRulesOperations.begin_update": "Microsoft.ManagedNetworkFabric.InternetGatewayRules.update", + "azure.mgmt.managednetworkfabric.operations.InternetGatewayRulesOperations.begin_delete": "Microsoft.ManagedNetworkFabric.InternetGatewayRules.delete", + "azure.mgmt.managednetworkfabric.aio.operations.InternetGatewayRulesOperations.begin_delete": "Microsoft.ManagedNetworkFabric.InternetGatewayRules.delete", + "azure.mgmt.managednetworkfabric.operations.InternetGatewayRulesOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.InternetGatewayRules.listByResourceGroup", + "azure.mgmt.managednetworkfabric.aio.operations.InternetGatewayRulesOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.InternetGatewayRules.listByResourceGroup", + "azure.mgmt.managednetworkfabric.operations.InternetGatewayRulesOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.InternetGatewayRules.listBySubscription", + "azure.mgmt.managednetworkfabric.aio.operations.InternetGatewayRulesOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.InternetGatewayRules.listBySubscription", + "azure.mgmt.managednetworkfabric.operations.InternetGatewaysOperations.get": "Microsoft.ManagedNetworkFabric.InternetGateways.get", + "azure.mgmt.managednetworkfabric.aio.operations.InternetGatewaysOperations.get": "Microsoft.ManagedNetworkFabric.InternetGateways.get", + "azure.mgmt.managednetworkfabric.operations.InternetGatewaysOperations.begin_create": "Microsoft.ManagedNetworkFabric.InternetGateways.create", + "azure.mgmt.managednetworkfabric.aio.operations.InternetGatewaysOperations.begin_create": "Microsoft.ManagedNetworkFabric.InternetGateways.create", + "azure.mgmt.managednetworkfabric.operations.InternetGatewaysOperations.begin_update": "Microsoft.ManagedNetworkFabric.InternetGateways.update", + "azure.mgmt.managednetworkfabric.aio.operations.InternetGatewaysOperations.begin_update": "Microsoft.ManagedNetworkFabric.InternetGateways.update", + "azure.mgmt.managednetworkfabric.operations.InternetGatewaysOperations.begin_delete": "Microsoft.ManagedNetworkFabric.InternetGateways.delete", + "azure.mgmt.managednetworkfabric.aio.operations.InternetGatewaysOperations.begin_delete": "Microsoft.ManagedNetworkFabric.InternetGateways.delete", + "azure.mgmt.managednetworkfabric.operations.InternetGatewaysOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.InternetGateways.listByResourceGroup", + "azure.mgmt.managednetworkfabric.aio.operations.InternetGatewaysOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.InternetGateways.listByResourceGroup", + "azure.mgmt.managednetworkfabric.operations.InternetGatewaysOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.InternetGateways.listBySubscription", + "azure.mgmt.managednetworkfabric.aio.operations.InternetGatewaysOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.InternetGateways.listBySubscription", + "azure.mgmt.managednetworkfabric.operations.IpCommunitiesOperations.get": "Microsoft.ManagedNetworkFabric.IpCommunities.get", + "azure.mgmt.managednetworkfabric.aio.operations.IpCommunitiesOperations.get": "Microsoft.ManagedNetworkFabric.IpCommunities.get", + "azure.mgmt.managednetworkfabric.operations.IpCommunitiesOperations.begin_create": "Microsoft.ManagedNetworkFabric.IpCommunities.create", + "azure.mgmt.managednetworkfabric.aio.operations.IpCommunitiesOperations.begin_create": "Microsoft.ManagedNetworkFabric.IpCommunities.create", + "azure.mgmt.managednetworkfabric.operations.IpCommunitiesOperations.begin_update": "Microsoft.ManagedNetworkFabric.IpCommunities.update", + "azure.mgmt.managednetworkfabric.aio.operations.IpCommunitiesOperations.begin_update": "Microsoft.ManagedNetworkFabric.IpCommunities.update", + "azure.mgmt.managednetworkfabric.operations.IpCommunitiesOperations.begin_delete": "Microsoft.ManagedNetworkFabric.IpCommunities.delete", + "azure.mgmt.managednetworkfabric.aio.operations.IpCommunitiesOperations.begin_delete": "Microsoft.ManagedNetworkFabric.IpCommunities.delete", + "azure.mgmt.managednetworkfabric.operations.IpCommunitiesOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.IpCommunities.listByResourceGroup", + "azure.mgmt.managednetworkfabric.aio.operations.IpCommunitiesOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.IpCommunities.listByResourceGroup", + "azure.mgmt.managednetworkfabric.operations.IpCommunitiesOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.IpCommunities.listBySubscription", + "azure.mgmt.managednetworkfabric.aio.operations.IpCommunitiesOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.IpCommunities.listBySubscription", + "azure.mgmt.managednetworkfabric.operations.IpExtendedCommunitiesOperations.get": "Microsoft.ManagedNetworkFabric.IpExtendedCommunities.get", + "azure.mgmt.managednetworkfabric.aio.operations.IpExtendedCommunitiesOperations.get": "Microsoft.ManagedNetworkFabric.IpExtendedCommunities.get", + "azure.mgmt.managednetworkfabric.operations.IpExtendedCommunitiesOperations.begin_create": "Microsoft.ManagedNetworkFabric.IpExtendedCommunities.create", + "azure.mgmt.managednetworkfabric.aio.operations.IpExtendedCommunitiesOperations.begin_create": "Microsoft.ManagedNetworkFabric.IpExtendedCommunities.create", + "azure.mgmt.managednetworkfabric.operations.IpExtendedCommunitiesOperations.begin_update": "Microsoft.ManagedNetworkFabric.IpExtendedCommunities.update", + "azure.mgmt.managednetworkfabric.aio.operations.IpExtendedCommunitiesOperations.begin_update": "Microsoft.ManagedNetworkFabric.IpExtendedCommunities.update", + "azure.mgmt.managednetworkfabric.operations.IpExtendedCommunitiesOperations.begin_delete": "Microsoft.ManagedNetworkFabric.IpExtendedCommunities.delete", + "azure.mgmt.managednetworkfabric.aio.operations.IpExtendedCommunitiesOperations.begin_delete": "Microsoft.ManagedNetworkFabric.IpExtendedCommunities.delete", + "azure.mgmt.managednetworkfabric.operations.IpExtendedCommunitiesOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.IpExtendedCommunities.listByResourceGroup", + "azure.mgmt.managednetworkfabric.aio.operations.IpExtendedCommunitiesOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.IpExtendedCommunities.listByResourceGroup", + "azure.mgmt.managednetworkfabric.operations.IpExtendedCommunitiesOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.IpExtendedCommunities.listBySubscription", + "azure.mgmt.managednetworkfabric.aio.operations.IpExtendedCommunitiesOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.IpExtendedCommunities.listBySubscription", + "azure.mgmt.managednetworkfabric.operations.IpPrefixesOperations.get": "Microsoft.ManagedNetworkFabric.IpPrefixes.get", + "azure.mgmt.managednetworkfabric.aio.operations.IpPrefixesOperations.get": "Microsoft.ManagedNetworkFabric.IpPrefixes.get", + "azure.mgmt.managednetworkfabric.operations.IpPrefixesOperations.begin_create": "Microsoft.ManagedNetworkFabric.IpPrefixes.create", + "azure.mgmt.managednetworkfabric.aio.operations.IpPrefixesOperations.begin_create": "Microsoft.ManagedNetworkFabric.IpPrefixes.create", + "azure.mgmt.managednetworkfabric.operations.IpPrefixesOperations.begin_update": "Microsoft.ManagedNetworkFabric.IpPrefixes.update", + "azure.mgmt.managednetworkfabric.aio.operations.IpPrefixesOperations.begin_update": "Microsoft.ManagedNetworkFabric.IpPrefixes.update", + "azure.mgmt.managednetworkfabric.operations.IpPrefixesOperations.begin_delete": "Microsoft.ManagedNetworkFabric.IpPrefixes.delete", + "azure.mgmt.managednetworkfabric.aio.operations.IpPrefixesOperations.begin_delete": "Microsoft.ManagedNetworkFabric.IpPrefixes.delete", + "azure.mgmt.managednetworkfabric.operations.IpPrefixesOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.IpPrefixes.listByResourceGroup", + "azure.mgmt.managednetworkfabric.aio.operations.IpPrefixesOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.IpPrefixes.listByResourceGroup", + "azure.mgmt.managednetworkfabric.operations.IpPrefixesOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.IpPrefixes.listBySubscription", + "azure.mgmt.managednetworkfabric.aio.operations.IpPrefixesOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.IpPrefixes.listBySubscription", + "azure.mgmt.managednetworkfabric.operations.L2IsolationDomainsOperations.get": "Microsoft.ManagedNetworkFabric.L2IsolationDomains.get", + "azure.mgmt.managednetworkfabric.aio.operations.L2IsolationDomainsOperations.get": "Microsoft.ManagedNetworkFabric.L2IsolationDomains.get", + "azure.mgmt.managednetworkfabric.operations.L2IsolationDomainsOperations.begin_create": "Microsoft.ManagedNetworkFabric.L2IsolationDomains.create", + "azure.mgmt.managednetworkfabric.aio.operations.L2IsolationDomainsOperations.begin_create": "Microsoft.ManagedNetworkFabric.L2IsolationDomains.create", + "azure.mgmt.managednetworkfabric.operations.L2IsolationDomainsOperations.begin_update": "Microsoft.ManagedNetworkFabric.L2IsolationDomains.update", + "azure.mgmt.managednetworkfabric.aio.operations.L2IsolationDomainsOperations.begin_update": "Microsoft.ManagedNetworkFabric.L2IsolationDomains.update", + "azure.mgmt.managednetworkfabric.operations.L2IsolationDomainsOperations.begin_delete": "Microsoft.ManagedNetworkFabric.L2IsolationDomains.delete", + "azure.mgmt.managednetworkfabric.aio.operations.L2IsolationDomainsOperations.begin_delete": "Microsoft.ManagedNetworkFabric.L2IsolationDomains.delete", + "azure.mgmt.managednetworkfabric.operations.L2IsolationDomainsOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.L2IsolationDomains.listByResourceGroup", + "azure.mgmt.managednetworkfabric.aio.operations.L2IsolationDomainsOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.L2IsolationDomains.listByResourceGroup", + "azure.mgmt.managednetworkfabric.operations.L2IsolationDomainsOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.L2IsolationDomains.listBySubscription", + "azure.mgmt.managednetworkfabric.aio.operations.L2IsolationDomainsOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.L2IsolationDomains.listBySubscription", + "azure.mgmt.managednetworkfabric.operations.L2IsolationDomainsOperations.begin_update_administrative_state": "Microsoft.ManagedNetworkFabric.L2IsolationDomains.updateAdministrativeState", + "azure.mgmt.managednetworkfabric.aio.operations.L2IsolationDomainsOperations.begin_update_administrative_state": "Microsoft.ManagedNetworkFabric.L2IsolationDomains.updateAdministrativeState", + "azure.mgmt.managednetworkfabric.operations.L2IsolationDomainsOperations.begin_validate_configuration": "Microsoft.ManagedNetworkFabric.L2IsolationDomains.validateConfiguration", + "azure.mgmt.managednetworkfabric.aio.operations.L2IsolationDomainsOperations.begin_validate_configuration": "Microsoft.ManagedNetworkFabric.L2IsolationDomains.validateConfiguration", + "azure.mgmt.managednetworkfabric.operations.L2IsolationDomainsOperations.begin_commit_configuration": "Microsoft.ManagedNetworkFabric.L2IsolationDomains.commitConfiguration", + "azure.mgmt.managednetworkfabric.aio.operations.L2IsolationDomainsOperations.begin_commit_configuration": "Microsoft.ManagedNetworkFabric.L2IsolationDomains.commitConfiguration", + "azure.mgmt.managednetworkfabric.operations.L3IsolationDomainsOperations.get": "Microsoft.ManagedNetworkFabric.L3IsolationDomains.get", + "azure.mgmt.managednetworkfabric.aio.operations.L3IsolationDomainsOperations.get": "Microsoft.ManagedNetworkFabric.L3IsolationDomains.get", + "azure.mgmt.managednetworkfabric.operations.L3IsolationDomainsOperations.begin_create": "Microsoft.ManagedNetworkFabric.L3IsolationDomains.create", + "azure.mgmt.managednetworkfabric.aio.operations.L3IsolationDomainsOperations.begin_create": "Microsoft.ManagedNetworkFabric.L3IsolationDomains.create", + "azure.mgmt.managednetworkfabric.operations.L3IsolationDomainsOperations.begin_update": "Microsoft.ManagedNetworkFabric.L3IsolationDomains.update", + "azure.mgmt.managednetworkfabric.aio.operations.L3IsolationDomainsOperations.begin_update": "Microsoft.ManagedNetworkFabric.L3IsolationDomains.update", + "azure.mgmt.managednetworkfabric.operations.L3IsolationDomainsOperations.begin_delete": "Microsoft.ManagedNetworkFabric.L3IsolationDomains.delete", + "azure.mgmt.managednetworkfabric.aio.operations.L3IsolationDomainsOperations.begin_delete": "Microsoft.ManagedNetworkFabric.L3IsolationDomains.delete", + "azure.mgmt.managednetworkfabric.operations.L3IsolationDomainsOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.L3IsolationDomains.listByResourceGroup", + "azure.mgmt.managednetworkfabric.aio.operations.L3IsolationDomainsOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.L3IsolationDomains.listByResourceGroup", + "azure.mgmt.managednetworkfabric.operations.L3IsolationDomainsOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.L3IsolationDomains.listBySubscription", + "azure.mgmt.managednetworkfabric.aio.operations.L3IsolationDomainsOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.L3IsolationDomains.listBySubscription", + "azure.mgmt.managednetworkfabric.operations.L3IsolationDomainsOperations.begin_update_administrative_state": "Microsoft.ManagedNetworkFabric.L3IsolationDomains.updateAdministrativeState", + "azure.mgmt.managednetworkfabric.aio.operations.L3IsolationDomainsOperations.begin_update_administrative_state": "Microsoft.ManagedNetworkFabric.L3IsolationDomains.updateAdministrativeState", + "azure.mgmt.managednetworkfabric.operations.L3IsolationDomainsOperations.begin_validate_configuration": "Microsoft.ManagedNetworkFabric.L3IsolationDomains.validateConfiguration", + "azure.mgmt.managednetworkfabric.aio.operations.L3IsolationDomainsOperations.begin_validate_configuration": "Microsoft.ManagedNetworkFabric.L3IsolationDomains.validateConfiguration", + "azure.mgmt.managednetworkfabric.operations.L3IsolationDomainsOperations.begin_commit_configuration": "Microsoft.ManagedNetworkFabric.L3IsolationDomains.commitConfiguration", + "azure.mgmt.managednetworkfabric.aio.operations.L3IsolationDomainsOperations.begin_commit_configuration": "Microsoft.ManagedNetworkFabric.L3IsolationDomains.commitConfiguration", + "azure.mgmt.managednetworkfabric.operations.InternalNetworksOperations.get": "Microsoft.ManagedNetworkFabric.InternalNetworks.get", + "azure.mgmt.managednetworkfabric.aio.operations.InternalNetworksOperations.get": "Microsoft.ManagedNetworkFabric.InternalNetworks.get", + "azure.mgmt.managednetworkfabric.operations.InternalNetworksOperations.begin_create": "Microsoft.ManagedNetworkFabric.InternalNetworks.create", + "azure.mgmt.managednetworkfabric.aio.operations.InternalNetworksOperations.begin_create": "Microsoft.ManagedNetworkFabric.InternalNetworks.create", + "azure.mgmt.managednetworkfabric.operations.InternalNetworksOperations.begin_update": "Microsoft.ManagedNetworkFabric.InternalNetworks.update", + "azure.mgmt.managednetworkfabric.aio.operations.InternalNetworksOperations.begin_update": "Microsoft.ManagedNetworkFabric.InternalNetworks.update", + "azure.mgmt.managednetworkfabric.operations.InternalNetworksOperations.begin_delete": "Microsoft.ManagedNetworkFabric.InternalNetworks.delete", + "azure.mgmt.managednetworkfabric.aio.operations.InternalNetworksOperations.begin_delete": "Microsoft.ManagedNetworkFabric.InternalNetworks.delete", + "azure.mgmt.managednetworkfabric.operations.InternalNetworksOperations.list_by_l3_isolation_domain": "Microsoft.ManagedNetworkFabric.InternalNetworks.listByL3IsolationDomain", + "azure.mgmt.managednetworkfabric.aio.operations.InternalNetworksOperations.list_by_l3_isolation_domain": "Microsoft.ManagedNetworkFabric.InternalNetworks.listByL3IsolationDomain", + "azure.mgmt.managednetworkfabric.operations.InternalNetworksOperations.begin_update_administrative_state": "Microsoft.ManagedNetworkFabric.InternalNetworks.updateAdministrativeState", + "azure.mgmt.managednetworkfabric.aio.operations.InternalNetworksOperations.begin_update_administrative_state": "Microsoft.ManagedNetworkFabric.InternalNetworks.updateAdministrativeState", + "azure.mgmt.managednetworkfabric.operations.InternalNetworksOperations.begin_update_bgp_administrative_state": "Microsoft.ManagedNetworkFabric.InternalNetworks.updateBgpAdministrativeState", + "azure.mgmt.managednetworkfabric.aio.operations.InternalNetworksOperations.begin_update_bgp_administrative_state": "Microsoft.ManagedNetworkFabric.InternalNetworks.updateBgpAdministrativeState", + "azure.mgmt.managednetworkfabric.operations.InternalNetworksOperations.begin_update_static_route_bfd_administrative_state": "Microsoft.ManagedNetworkFabric.InternalNetworks.updateStaticRouteBfdAdministrativeState", + "azure.mgmt.managednetworkfabric.aio.operations.InternalNetworksOperations.begin_update_static_route_bfd_administrative_state": "Microsoft.ManagedNetworkFabric.InternalNetworks.updateStaticRouteBfdAdministrativeState", + "azure.mgmt.managednetworkfabric.operations.InternalNetworksOperations.begin_update_bfd_administrative_state": "Microsoft.ManagedNetworkFabric.InternalNetworks.updateBfdAdministrativeState", + "azure.mgmt.managednetworkfabric.aio.operations.InternalNetworksOperations.begin_update_bfd_administrative_state": "Microsoft.ManagedNetworkFabric.InternalNetworks.updateBfdAdministrativeState", + "azure.mgmt.managednetworkfabric.operations.ExternalNetworksOperations.get": "Microsoft.ManagedNetworkFabric.ExternalNetworks.get", + "azure.mgmt.managednetworkfabric.aio.operations.ExternalNetworksOperations.get": "Microsoft.ManagedNetworkFabric.ExternalNetworks.get", + "azure.mgmt.managednetworkfabric.operations.ExternalNetworksOperations.begin_create": "Microsoft.ManagedNetworkFabric.ExternalNetworks.create", + "azure.mgmt.managednetworkfabric.aio.operations.ExternalNetworksOperations.begin_create": "Microsoft.ManagedNetworkFabric.ExternalNetworks.create", + "azure.mgmt.managednetworkfabric.operations.ExternalNetworksOperations.begin_update": "Microsoft.ManagedNetworkFabric.ExternalNetworks.update", + "azure.mgmt.managednetworkfabric.aio.operations.ExternalNetworksOperations.begin_update": "Microsoft.ManagedNetworkFabric.ExternalNetworks.update", + "azure.mgmt.managednetworkfabric.operations.ExternalNetworksOperations.begin_delete": "Microsoft.ManagedNetworkFabric.ExternalNetworks.delete", + "azure.mgmt.managednetworkfabric.aio.operations.ExternalNetworksOperations.begin_delete": "Microsoft.ManagedNetworkFabric.ExternalNetworks.delete", + "azure.mgmt.managednetworkfabric.operations.ExternalNetworksOperations.list_by_l3_isolation_domain": "Microsoft.ManagedNetworkFabric.ExternalNetworks.listByL3IsolationDomain", + "azure.mgmt.managednetworkfabric.aio.operations.ExternalNetworksOperations.list_by_l3_isolation_domain": "Microsoft.ManagedNetworkFabric.ExternalNetworks.listByL3IsolationDomain", + "azure.mgmt.managednetworkfabric.operations.ExternalNetworksOperations.begin_update_administrative_state": "Microsoft.ManagedNetworkFabric.ExternalNetworks.updateAdministrativeState", + "azure.mgmt.managednetworkfabric.aio.operations.ExternalNetworksOperations.begin_update_administrative_state": "Microsoft.ManagedNetworkFabric.ExternalNetworks.updateAdministrativeState", + "azure.mgmt.managednetworkfabric.operations.ExternalNetworksOperations.begin_update_static_route_bfd_administrative_state": "Microsoft.ManagedNetworkFabric.ExternalNetworks.updateStaticRouteBfdAdministrativeState", + "azure.mgmt.managednetworkfabric.aio.operations.ExternalNetworksOperations.begin_update_static_route_bfd_administrative_state": "Microsoft.ManagedNetworkFabric.ExternalNetworks.updateStaticRouteBfdAdministrativeState", + "azure.mgmt.managednetworkfabric.operations.ExternalNetworksOperations.begin_update_bfd_administrative_state": "Microsoft.ManagedNetworkFabric.ExternalNetworks.updateBfdAdministrativeState", + "azure.mgmt.managednetworkfabric.aio.operations.ExternalNetworksOperations.begin_update_bfd_administrative_state": "Microsoft.ManagedNetworkFabric.ExternalNetworks.updateBfdAdministrativeState", + "azure.mgmt.managednetworkfabric.operations.NeighborGroupsOperations.get": "Microsoft.ManagedNetworkFabric.NeighborGroups.get", + "azure.mgmt.managednetworkfabric.aio.operations.NeighborGroupsOperations.get": "Microsoft.ManagedNetworkFabric.NeighborGroups.get", + "azure.mgmt.managednetworkfabric.operations.NeighborGroupsOperations.begin_create": "Microsoft.ManagedNetworkFabric.NeighborGroups.create", + "azure.mgmt.managednetworkfabric.aio.operations.NeighborGroupsOperations.begin_create": "Microsoft.ManagedNetworkFabric.NeighborGroups.create", + "azure.mgmt.managednetworkfabric.operations.NeighborGroupsOperations.begin_update": "Microsoft.ManagedNetworkFabric.NeighborGroups.update", + "azure.mgmt.managednetworkfabric.aio.operations.NeighborGroupsOperations.begin_update": "Microsoft.ManagedNetworkFabric.NeighborGroups.update", + "azure.mgmt.managednetworkfabric.operations.NeighborGroupsOperations.begin_delete": "Microsoft.ManagedNetworkFabric.NeighborGroups.delete", + "azure.mgmt.managednetworkfabric.aio.operations.NeighborGroupsOperations.begin_delete": "Microsoft.ManagedNetworkFabric.NeighborGroups.delete", + "azure.mgmt.managednetworkfabric.operations.NeighborGroupsOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.NeighborGroups.listByResourceGroup", + "azure.mgmt.managednetworkfabric.aio.operations.NeighborGroupsOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.NeighborGroups.listByResourceGroup", + "azure.mgmt.managednetworkfabric.operations.NeighborGroupsOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.NeighborGroups.listBySubscription", + "azure.mgmt.managednetworkfabric.aio.operations.NeighborGroupsOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.NeighborGroups.listBySubscription", + "azure.mgmt.managednetworkfabric.operations.NeighborGroupsOperations.begin_resync": "Microsoft.ManagedNetworkFabric.NeighborGroups.resync", + "azure.mgmt.managednetworkfabric.aio.operations.NeighborGroupsOperations.begin_resync": "Microsoft.ManagedNetworkFabric.NeighborGroups.resync", + "azure.mgmt.managednetworkfabric.operations.NetworkDeviceSkusOperations.get": "Microsoft.ManagedNetworkFabric.NetworkDeviceSkus.get", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkDeviceSkusOperations.get": "Microsoft.ManagedNetworkFabric.NetworkDeviceSkus.get", + "azure.mgmt.managednetworkfabric.operations.NetworkDeviceSkusOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.NetworkDeviceSkus.listBySubscription", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkDeviceSkusOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.NetworkDeviceSkus.listBySubscription", + "azure.mgmt.managednetworkfabric.operations.NetworkDevicesOperations.get": "Microsoft.ManagedNetworkFabric.NetworkDevices.get", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkDevicesOperations.get": "Microsoft.ManagedNetworkFabric.NetworkDevices.get", + "azure.mgmt.managednetworkfabric.operations.NetworkDevicesOperations.begin_create": "Microsoft.ManagedNetworkFabric.NetworkDevices.create", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkDevicesOperations.begin_create": "Microsoft.ManagedNetworkFabric.NetworkDevices.create", + "azure.mgmt.managednetworkfabric.operations.NetworkDevicesOperations.begin_update": "Microsoft.ManagedNetworkFabric.NetworkDevices.update", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkDevicesOperations.begin_update": "Microsoft.ManagedNetworkFabric.NetworkDevices.update", + "azure.mgmt.managednetworkfabric.operations.NetworkDevicesOperations.begin_delete": "Microsoft.ManagedNetworkFabric.NetworkDevices.delete", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkDevicesOperations.begin_delete": "Microsoft.ManagedNetworkFabric.NetworkDevices.delete", + "azure.mgmt.managednetworkfabric.operations.NetworkDevicesOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.NetworkDevices.listByResourceGroup", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkDevicesOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.NetworkDevices.listByResourceGroup", + "azure.mgmt.managednetworkfabric.operations.NetworkDevicesOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.NetworkDevices.listBySubscription", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkDevicesOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.NetworkDevices.listBySubscription", + "azure.mgmt.managednetworkfabric.operations.NetworkDevicesOperations.begin_reboot": "Microsoft.ManagedNetworkFabric.NetworkDevices.reboot", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkDevicesOperations.begin_reboot": "Microsoft.ManagedNetworkFabric.NetworkDevices.reboot", + "azure.mgmt.managednetworkfabric.operations.NetworkDevicesOperations.begin_refresh_configuration": "Microsoft.ManagedNetworkFabric.NetworkDevices.refreshConfiguration", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkDevicesOperations.begin_refresh_configuration": "Microsoft.ManagedNetworkFabric.NetworkDevices.refreshConfiguration", + "azure.mgmt.managednetworkfabric.operations.NetworkDevicesOperations.begin_update_administrative_state": "Microsoft.ManagedNetworkFabric.NetworkDevices.updateAdministrativeState", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkDevicesOperations.begin_update_administrative_state": "Microsoft.ManagedNetworkFabric.NetworkDevices.updateAdministrativeState", + "azure.mgmt.managednetworkfabric.operations.NetworkDevicesOperations.begin_upgrade": "Microsoft.ManagedNetworkFabric.NetworkDevices.upgrade", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkDevicesOperations.begin_upgrade": "Microsoft.ManagedNetworkFabric.NetworkDevices.upgrade", + "azure.mgmt.managednetworkfabric.operations.NetworkDevicesOperations.begin_run_ro_command": "Microsoft.ManagedNetworkFabric.NetworkDevices.runRoCommand", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkDevicesOperations.begin_run_ro_command": "Microsoft.ManagedNetworkFabric.NetworkDevices.runRoCommand", + "azure.mgmt.managednetworkfabric.operations.NetworkDevicesOperations.begin_run_rw_command": "Microsoft.ManagedNetworkFabric.NetworkDevices.runRwCommand", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkDevicesOperations.begin_run_rw_command": "Microsoft.ManagedNetworkFabric.NetworkDevices.runRwCommand", + "azure.mgmt.managednetworkfabric.operations.NetworkDevicesOperations.begin_resync_passwords": "Microsoft.ManagedNetworkFabric.NetworkDevices.resyncPasswords", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkDevicesOperations.begin_resync_passwords": "Microsoft.ManagedNetworkFabric.NetworkDevices.resyncPasswords", + "azure.mgmt.managednetworkfabric.operations.NetworkDevicesOperations.begin_resync_certificates": "Microsoft.ManagedNetworkFabric.NetworkDevices.resyncCertificates", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkDevicesOperations.begin_resync_certificates": "Microsoft.ManagedNetworkFabric.NetworkDevices.resyncCertificates", + "azure.mgmt.managednetworkfabric.operations.NetworkInterfacesOperations.get": "Microsoft.ManagedNetworkFabric.NetworkInterfaces.get", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkInterfacesOperations.get": "Microsoft.ManagedNetworkFabric.NetworkInterfaces.get", + "azure.mgmt.managednetworkfabric.operations.NetworkInterfacesOperations.begin_create": "Microsoft.ManagedNetworkFabric.NetworkInterfaces.create", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkInterfacesOperations.begin_create": "Microsoft.ManagedNetworkFabric.NetworkInterfaces.create", + "azure.mgmt.managednetworkfabric.operations.NetworkInterfacesOperations.begin_update": "Microsoft.ManagedNetworkFabric.NetworkInterfaces.update", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkInterfacesOperations.begin_update": "Microsoft.ManagedNetworkFabric.NetworkInterfaces.update", + "azure.mgmt.managednetworkfabric.operations.NetworkInterfacesOperations.begin_delete": "Microsoft.ManagedNetworkFabric.NetworkInterfaces.delete", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkInterfacesOperations.begin_delete": "Microsoft.ManagedNetworkFabric.NetworkInterfaces.delete", + "azure.mgmt.managednetworkfabric.operations.NetworkInterfacesOperations.list_by_network_device": "Microsoft.ManagedNetworkFabric.NetworkInterfaces.listByNetworkDevice", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkInterfacesOperations.list_by_network_device": "Microsoft.ManagedNetworkFabric.NetworkInterfaces.listByNetworkDevice", + "azure.mgmt.managednetworkfabric.operations.NetworkInterfacesOperations.begin_update_administrative_state": "Microsoft.ManagedNetworkFabric.NetworkInterfaces.updateAdministrativeState", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkInterfacesOperations.begin_update_administrative_state": "Microsoft.ManagedNetworkFabric.NetworkInterfaces.updateAdministrativeState", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricControllersOperations.get": "Microsoft.ManagedNetworkFabric.NetworkFabricControllers.get", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricControllersOperations.get": "Microsoft.ManagedNetworkFabric.NetworkFabricControllers.get", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricControllersOperations.begin_create": "Microsoft.ManagedNetworkFabric.NetworkFabricControllers.create", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricControllersOperations.begin_create": "Microsoft.ManagedNetworkFabric.NetworkFabricControllers.create", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricControllersOperations.begin_update": "Microsoft.ManagedNetworkFabric.NetworkFabricControllers.update", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricControllersOperations.begin_update": "Microsoft.ManagedNetworkFabric.NetworkFabricControllers.update", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricControllersOperations.begin_delete": "Microsoft.ManagedNetworkFabric.NetworkFabricControllers.delete", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricControllersOperations.begin_delete": "Microsoft.ManagedNetworkFabric.NetworkFabricControllers.delete", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricControllersOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.NetworkFabricControllers.listByResourceGroup", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricControllersOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.NetworkFabricControllers.listByResourceGroup", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricControllersOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.NetworkFabricControllers.listBySubscription", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricControllersOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.NetworkFabricControllers.listBySubscription", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricSkusOperations.get": "Microsoft.ManagedNetworkFabric.NetworkFabricSkus.get", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricSkusOperations.get": "Microsoft.ManagedNetworkFabric.NetworkFabricSkus.get", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricSkusOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.NetworkFabricSkus.listBySubscription", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricSkusOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.NetworkFabricSkus.listBySubscription", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricsOperations.get": "Microsoft.ManagedNetworkFabric.NetworkFabrics.get", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricsOperations.get": "Microsoft.ManagedNetworkFabric.NetworkFabrics.get", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricsOperations.begin_create": "Microsoft.ManagedNetworkFabric.NetworkFabrics.create", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricsOperations.begin_create": "Microsoft.ManagedNetworkFabric.NetworkFabrics.create", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricsOperations.begin_update": "Microsoft.ManagedNetworkFabric.NetworkFabrics.update", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricsOperations.begin_update": "Microsoft.ManagedNetworkFabric.NetworkFabrics.update", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricsOperations.begin_delete": "Microsoft.ManagedNetworkFabric.NetworkFabrics.delete", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricsOperations.begin_delete": "Microsoft.ManagedNetworkFabric.NetworkFabrics.delete", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricsOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.NetworkFabrics.listByResourceGroup", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricsOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.NetworkFabrics.listByResourceGroup", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricsOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.NetworkFabrics.listBySubscription", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricsOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.NetworkFabrics.listBySubscription", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricsOperations.begin_provision": "Microsoft.ManagedNetworkFabric.NetworkFabrics.provision", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricsOperations.begin_provision": "Microsoft.ManagedNetworkFabric.NetworkFabrics.provision", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricsOperations.begin_deprovision": "Microsoft.ManagedNetworkFabric.NetworkFabrics.deprovision", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricsOperations.begin_deprovision": "Microsoft.ManagedNetworkFabric.NetworkFabrics.deprovision", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricsOperations.begin_upgrade": "Microsoft.ManagedNetworkFabric.NetworkFabrics.upgrade", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricsOperations.begin_upgrade": "Microsoft.ManagedNetworkFabric.NetworkFabrics.upgrade", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricsOperations.begin_refresh_configuration": "Microsoft.ManagedNetworkFabric.NetworkFabrics.refreshConfiguration", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricsOperations.begin_refresh_configuration": "Microsoft.ManagedNetworkFabric.NetworkFabrics.refreshConfiguration", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricsOperations.begin_update_workload_management_bfd_configuration": "Microsoft.ManagedNetworkFabric.NetworkFabrics.updateWorkloadManagementBfdConfiguration", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricsOperations.begin_update_workload_management_bfd_configuration": "Microsoft.ManagedNetworkFabric.NetworkFabrics.updateWorkloadManagementBfdConfiguration", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricsOperations.begin_update_infra_management_bfd_configuration": "Microsoft.ManagedNetworkFabric.NetworkFabrics.updateInfraManagementBfdConfiguration", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricsOperations.begin_update_infra_management_bfd_configuration": "Microsoft.ManagedNetworkFabric.NetworkFabrics.updateInfraManagementBfdConfiguration", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricsOperations.begin_validate_configuration": "Microsoft.ManagedNetworkFabric.NetworkFabrics.validateConfiguration", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricsOperations.begin_validate_configuration": "Microsoft.ManagedNetworkFabric.NetworkFabrics.validateConfiguration", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricsOperations.begin_get_topology": "Microsoft.ManagedNetworkFabric.NetworkFabrics.getTopology", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricsOperations.begin_get_topology": "Microsoft.ManagedNetworkFabric.NetworkFabrics.getTopology", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricsOperations.begin_commit_configuration": "Microsoft.ManagedNetworkFabric.NetworkFabrics.commitConfiguration", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricsOperations.begin_commit_configuration": "Microsoft.ManagedNetworkFabric.NetworkFabrics.commitConfiguration", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricsOperations.begin_commit_batch_status": "Microsoft.ManagedNetworkFabric.NetworkFabrics.commitBatchStatus", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricsOperations.begin_commit_batch_status": "Microsoft.ManagedNetworkFabric.NetworkFabrics.commitBatchStatus", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricsOperations.begin_discard_commit_batch": "Microsoft.ManagedNetworkFabric.NetworkFabrics.discardCommitBatch", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricsOperations.begin_discard_commit_batch": "Microsoft.ManagedNetworkFabric.NetworkFabrics.discardCommitBatch", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricsOperations.begin_lock_fabric": "Microsoft.ManagedNetworkFabric.NetworkFabrics.lockFabric", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricsOperations.begin_lock_fabric": "Microsoft.ManagedNetworkFabric.NetworkFabrics.lockFabric", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricsOperations.begin_view_device_configuration": "Microsoft.ManagedNetworkFabric.NetworkFabrics.viewDeviceConfiguration", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricsOperations.begin_view_device_configuration": "Microsoft.ManagedNetworkFabric.NetworkFabrics.viewDeviceConfiguration", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricsOperations.begin_arm_configuration_diff": "Microsoft.ManagedNetworkFabric.NetworkFabrics.armConfigurationDiff", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricsOperations.begin_arm_configuration_diff": "Microsoft.ManagedNetworkFabric.NetworkFabrics.armConfigurationDiff", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricsOperations.begin_rotate_passwords": "Microsoft.ManagedNetworkFabric.NetworkFabrics.rotatePasswords", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricsOperations.begin_rotate_passwords": "Microsoft.ManagedNetworkFabric.NetworkFabrics.rotatePasswords", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricsOperations.begin_resync_passwords": "Microsoft.ManagedNetworkFabric.NetworkFabrics.resyncPasswords", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricsOperations.begin_resync_passwords": "Microsoft.ManagedNetworkFabric.NetworkFabrics.resyncPasswords", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricsOperations.begin_rotate_certificates": "Microsoft.ManagedNetworkFabric.NetworkFabrics.rotateCertificates", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricsOperations.begin_rotate_certificates": "Microsoft.ManagedNetworkFabric.NetworkFabrics.rotateCertificates", + "azure.mgmt.managednetworkfabric.operations.NetworkFabricsOperations.begin_resync_certificates": "Microsoft.ManagedNetworkFabric.NetworkFabrics.resyncCertificates", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkFabricsOperations.begin_resync_certificates": "Microsoft.ManagedNetworkFabric.NetworkFabrics.resyncCertificates", + "azure.mgmt.managednetworkfabric.operations.NetworkToNetworkInterconnectsOperations.get": "Microsoft.ManagedNetworkFabric.NetworkToNetworkInterconnects.get", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkToNetworkInterconnectsOperations.get": "Microsoft.ManagedNetworkFabric.NetworkToNetworkInterconnects.get", + "azure.mgmt.managednetworkfabric.operations.NetworkToNetworkInterconnectsOperations.begin_create": "Microsoft.ManagedNetworkFabric.NetworkToNetworkInterconnects.create", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkToNetworkInterconnectsOperations.begin_create": "Microsoft.ManagedNetworkFabric.NetworkToNetworkInterconnects.create", + "azure.mgmt.managednetworkfabric.operations.NetworkToNetworkInterconnectsOperations.begin_update": "Microsoft.ManagedNetworkFabric.NetworkToNetworkInterconnects.update", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkToNetworkInterconnectsOperations.begin_update": "Microsoft.ManagedNetworkFabric.NetworkToNetworkInterconnects.update", + "azure.mgmt.managednetworkfabric.operations.NetworkToNetworkInterconnectsOperations.begin_delete": "Microsoft.ManagedNetworkFabric.NetworkToNetworkInterconnects.delete", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkToNetworkInterconnectsOperations.begin_delete": "Microsoft.ManagedNetworkFabric.NetworkToNetworkInterconnects.delete", + "azure.mgmt.managednetworkfabric.operations.NetworkToNetworkInterconnectsOperations.list_by_network_fabric": "Microsoft.ManagedNetworkFabric.NetworkToNetworkInterconnects.listByNetworkFabric", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkToNetworkInterconnectsOperations.list_by_network_fabric": "Microsoft.ManagedNetworkFabric.NetworkToNetworkInterconnects.listByNetworkFabric", + "azure.mgmt.managednetworkfabric.operations.NetworkToNetworkInterconnectsOperations.begin_update_npb_static_route_bfd_administrative_state": "Microsoft.ManagedNetworkFabric.NetworkToNetworkInterconnects.updateNpbStaticRouteBfdAdministrativeState", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkToNetworkInterconnectsOperations.begin_update_npb_static_route_bfd_administrative_state": "Microsoft.ManagedNetworkFabric.NetworkToNetworkInterconnects.updateNpbStaticRouteBfdAdministrativeState", + "azure.mgmt.managednetworkfabric.operations.NetworkToNetworkInterconnectsOperations.begin_update_administrative_state": "Microsoft.ManagedNetworkFabric.NetworkToNetworkInterconnects.updateAdministrativeState", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkToNetworkInterconnectsOperations.begin_update_administrative_state": "Microsoft.ManagedNetworkFabric.NetworkToNetworkInterconnects.updateAdministrativeState", + "azure.mgmt.managednetworkfabric.operations.NetworkToNetworkInterconnectsOperations.begin_update_bfd_administrative_state": "Microsoft.ManagedNetworkFabric.NetworkToNetworkInterconnects.updateBfdAdministrativeState", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkToNetworkInterconnectsOperations.begin_update_bfd_administrative_state": "Microsoft.ManagedNetworkFabric.NetworkToNetworkInterconnects.updateBfdAdministrativeState", + "azure.mgmt.managednetworkfabric.operations.NetworkPacketBrokersOperations.get": "Microsoft.ManagedNetworkFabric.NetworkPacketBrokers.get", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkPacketBrokersOperations.get": "Microsoft.ManagedNetworkFabric.NetworkPacketBrokers.get", + "azure.mgmt.managednetworkfabric.operations.NetworkPacketBrokersOperations.begin_create": "Microsoft.ManagedNetworkFabric.NetworkPacketBrokers.create", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkPacketBrokersOperations.begin_create": "Microsoft.ManagedNetworkFabric.NetworkPacketBrokers.create", + "azure.mgmt.managednetworkfabric.operations.NetworkPacketBrokersOperations.begin_update": "Microsoft.ManagedNetworkFabric.NetworkPacketBrokers.update", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkPacketBrokersOperations.begin_update": "Microsoft.ManagedNetworkFabric.NetworkPacketBrokers.update", + "azure.mgmt.managednetworkfabric.operations.NetworkPacketBrokersOperations.begin_delete": "Microsoft.ManagedNetworkFabric.NetworkPacketBrokers.delete", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkPacketBrokersOperations.begin_delete": "Microsoft.ManagedNetworkFabric.NetworkPacketBrokers.delete", + "azure.mgmt.managednetworkfabric.operations.NetworkPacketBrokersOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.NetworkPacketBrokers.listByResourceGroup", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkPacketBrokersOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.NetworkPacketBrokers.listByResourceGroup", + "azure.mgmt.managednetworkfabric.operations.NetworkPacketBrokersOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.NetworkPacketBrokers.listBySubscription", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkPacketBrokersOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.NetworkPacketBrokers.listBySubscription", + "azure.mgmt.managednetworkfabric.operations.NetworkRacksOperations.get": "Microsoft.ManagedNetworkFabric.NetworkRacks.get", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkRacksOperations.get": "Microsoft.ManagedNetworkFabric.NetworkRacks.get", + "azure.mgmt.managednetworkfabric.operations.NetworkRacksOperations.begin_create": "Microsoft.ManagedNetworkFabric.NetworkRacks.create", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkRacksOperations.begin_create": "Microsoft.ManagedNetworkFabric.NetworkRacks.create", + "azure.mgmt.managednetworkfabric.operations.NetworkRacksOperations.begin_update": "Microsoft.ManagedNetworkFabric.NetworkRacks.update", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkRacksOperations.begin_update": "Microsoft.ManagedNetworkFabric.NetworkRacks.update", + "azure.mgmt.managednetworkfabric.operations.NetworkRacksOperations.begin_delete": "Microsoft.ManagedNetworkFabric.NetworkRacks.delete", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkRacksOperations.begin_delete": "Microsoft.ManagedNetworkFabric.NetworkRacks.delete", + "azure.mgmt.managednetworkfabric.operations.NetworkRacksOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.NetworkRacks.listByResourceGroup", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkRacksOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.NetworkRacks.listByResourceGroup", + "azure.mgmt.managednetworkfabric.operations.NetworkRacksOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.NetworkRacks.listBySubscription", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkRacksOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.NetworkRacks.listBySubscription", + "azure.mgmt.managednetworkfabric.operations.NetworkTapRulesOperations.get": "Microsoft.ManagedNetworkFabric.NetworkTapRules.get", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkTapRulesOperations.get": "Microsoft.ManagedNetworkFabric.NetworkTapRules.get", + "azure.mgmt.managednetworkfabric.operations.NetworkTapRulesOperations.begin_create": "Microsoft.ManagedNetworkFabric.NetworkTapRules.create", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkTapRulesOperations.begin_create": "Microsoft.ManagedNetworkFabric.NetworkTapRules.create", + "azure.mgmt.managednetworkfabric.operations.NetworkTapRulesOperations.begin_update": "Microsoft.ManagedNetworkFabric.NetworkTapRules.update", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkTapRulesOperations.begin_update": "Microsoft.ManagedNetworkFabric.NetworkTapRules.update", + "azure.mgmt.managednetworkfabric.operations.NetworkTapRulesOperations.begin_delete": "Microsoft.ManagedNetworkFabric.NetworkTapRules.delete", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkTapRulesOperations.begin_delete": "Microsoft.ManagedNetworkFabric.NetworkTapRules.delete", + "azure.mgmt.managednetworkfabric.operations.NetworkTapRulesOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.NetworkTapRules.listByResourceGroup", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkTapRulesOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.NetworkTapRules.listByResourceGroup", + "azure.mgmt.managednetworkfabric.operations.NetworkTapRulesOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.NetworkTapRules.listBySubscription", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkTapRulesOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.NetworkTapRules.listBySubscription", + "azure.mgmt.managednetworkfabric.operations.NetworkTapRulesOperations.begin_update_administrative_state": "Microsoft.ManagedNetworkFabric.NetworkTapRules.updateAdministrativeState", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkTapRulesOperations.begin_update_administrative_state": "Microsoft.ManagedNetworkFabric.NetworkTapRules.updateAdministrativeState", + "azure.mgmt.managednetworkfabric.operations.NetworkTapRulesOperations.begin_resync": "Microsoft.ManagedNetworkFabric.NetworkTapRules.resync", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkTapRulesOperations.begin_resync": "Microsoft.ManagedNetworkFabric.NetworkTapRules.resync", + "azure.mgmt.managednetworkfabric.operations.NetworkTapRulesOperations.begin_validate_configuration": "Microsoft.ManagedNetworkFabric.NetworkTapRules.validateConfiguration", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkTapRulesOperations.begin_validate_configuration": "Microsoft.ManagedNetworkFabric.NetworkTapRules.validateConfiguration", + "azure.mgmt.managednetworkfabric.operations.NetworkTapsOperations.get": "Microsoft.ManagedNetworkFabric.NetworkTaps.get", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkTapsOperations.get": "Microsoft.ManagedNetworkFabric.NetworkTaps.get", + "azure.mgmt.managednetworkfabric.operations.NetworkTapsOperations.begin_create": "Microsoft.ManagedNetworkFabric.NetworkTaps.create", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkTapsOperations.begin_create": "Microsoft.ManagedNetworkFabric.NetworkTaps.create", + "azure.mgmt.managednetworkfabric.operations.NetworkTapsOperations.begin_update": "Microsoft.ManagedNetworkFabric.NetworkTaps.update", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkTapsOperations.begin_update": "Microsoft.ManagedNetworkFabric.NetworkTaps.update", + "azure.mgmt.managednetworkfabric.operations.NetworkTapsOperations.begin_delete": "Microsoft.ManagedNetworkFabric.NetworkTaps.delete", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkTapsOperations.begin_delete": "Microsoft.ManagedNetworkFabric.NetworkTaps.delete", + "azure.mgmt.managednetworkfabric.operations.NetworkTapsOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.NetworkTaps.listByResourceGroup", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkTapsOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.NetworkTaps.listByResourceGroup", + "azure.mgmt.managednetworkfabric.operations.NetworkTapsOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.NetworkTaps.listBySubscription", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkTapsOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.NetworkTaps.listBySubscription", + "azure.mgmt.managednetworkfabric.operations.NetworkTapsOperations.begin_update_administrative_state": "Microsoft.ManagedNetworkFabric.NetworkTaps.updateAdministrativeState", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkTapsOperations.begin_update_administrative_state": "Microsoft.ManagedNetworkFabric.NetworkTaps.updateAdministrativeState", + "azure.mgmt.managednetworkfabric.operations.NetworkTapsOperations.begin_resync": "Microsoft.ManagedNetworkFabric.NetworkTaps.resync", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkTapsOperations.begin_resync": "Microsoft.ManagedNetworkFabric.NetworkTaps.resync", + "azure.mgmt.managednetworkfabric.operations.RoutePoliciesOperations.get": "Microsoft.ManagedNetworkFabric.RoutePolicies.get", + "azure.mgmt.managednetworkfabric.aio.operations.RoutePoliciesOperations.get": "Microsoft.ManagedNetworkFabric.RoutePolicies.get", + "azure.mgmt.managednetworkfabric.operations.RoutePoliciesOperations.begin_create": "Microsoft.ManagedNetworkFabric.RoutePolicies.create", + "azure.mgmt.managednetworkfabric.aio.operations.RoutePoliciesOperations.begin_create": "Microsoft.ManagedNetworkFabric.RoutePolicies.create", + "azure.mgmt.managednetworkfabric.operations.RoutePoliciesOperations.begin_update": "Microsoft.ManagedNetworkFabric.RoutePolicies.update", + "azure.mgmt.managednetworkfabric.aio.operations.RoutePoliciesOperations.begin_update": "Microsoft.ManagedNetworkFabric.RoutePolicies.update", + "azure.mgmt.managednetworkfabric.operations.RoutePoliciesOperations.begin_delete": "Microsoft.ManagedNetworkFabric.RoutePolicies.delete", + "azure.mgmt.managednetworkfabric.aio.operations.RoutePoliciesOperations.begin_delete": "Microsoft.ManagedNetworkFabric.RoutePolicies.delete", + "azure.mgmt.managednetworkfabric.operations.RoutePoliciesOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.RoutePolicies.listByResourceGroup", + "azure.mgmt.managednetworkfabric.aio.operations.RoutePoliciesOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.RoutePolicies.listByResourceGroup", + "azure.mgmt.managednetworkfabric.operations.RoutePoliciesOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.RoutePolicies.listBySubscription", + "azure.mgmt.managednetworkfabric.aio.operations.RoutePoliciesOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.RoutePolicies.listBySubscription", + "azure.mgmt.managednetworkfabric.operations.RoutePoliciesOperations.begin_update_administrative_state": "Microsoft.ManagedNetworkFabric.RoutePolicies.updateAdministrativeState", + "azure.mgmt.managednetworkfabric.aio.operations.RoutePoliciesOperations.begin_update_administrative_state": "Microsoft.ManagedNetworkFabric.RoutePolicies.updateAdministrativeState", + "azure.mgmt.managednetworkfabric.operations.RoutePoliciesOperations.begin_validate_configuration": "Microsoft.ManagedNetworkFabric.RoutePolicies.validateConfiguration", + "azure.mgmt.managednetworkfabric.aio.operations.RoutePoliciesOperations.begin_validate_configuration": "Microsoft.ManagedNetworkFabric.RoutePolicies.validateConfiguration", + "azure.mgmt.managednetworkfabric.operations.RoutePoliciesOperations.begin_commit_configuration": "Microsoft.ManagedNetworkFabric.RoutePolicies.commitConfiguration", + "azure.mgmt.managednetworkfabric.aio.operations.RoutePoliciesOperations.begin_commit_configuration": "Microsoft.ManagedNetworkFabric.RoutePolicies.commitConfiguration", + "azure.mgmt.managednetworkfabric.operations.NetworkMonitorsOperations.get": "Microsoft.ManagedNetworkFabric.NetworkMonitors.get", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkMonitorsOperations.get": "Microsoft.ManagedNetworkFabric.NetworkMonitors.get", + "azure.mgmt.managednetworkfabric.operations.NetworkMonitorsOperations.begin_create": "Microsoft.ManagedNetworkFabric.NetworkMonitors.create", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkMonitorsOperations.begin_create": "Microsoft.ManagedNetworkFabric.NetworkMonitors.create", + "azure.mgmt.managednetworkfabric.operations.NetworkMonitorsOperations.begin_update": "Microsoft.ManagedNetworkFabric.NetworkMonitors.update", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkMonitorsOperations.begin_update": "Microsoft.ManagedNetworkFabric.NetworkMonitors.update", + "azure.mgmt.managednetworkfabric.operations.NetworkMonitorsOperations.begin_delete": "Microsoft.ManagedNetworkFabric.NetworkMonitors.delete", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkMonitorsOperations.begin_delete": "Microsoft.ManagedNetworkFabric.NetworkMonitors.delete", + "azure.mgmt.managednetworkfabric.operations.NetworkMonitorsOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.NetworkMonitors.listByResourceGroup", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkMonitorsOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.NetworkMonitors.listByResourceGroup", + "azure.mgmt.managednetworkfabric.operations.NetworkMonitorsOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.NetworkMonitors.listBySubscription", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkMonitorsOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.NetworkMonitors.listBySubscription", + "azure.mgmt.managednetworkfabric.operations.NetworkMonitorsOperations.begin_update_administrative_state": "Microsoft.ManagedNetworkFabric.NetworkMonitors.updateAdministrativeState", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkMonitorsOperations.begin_update_administrative_state": "Microsoft.ManagedNetworkFabric.NetworkMonitors.updateAdministrativeState", + "azure.mgmt.managednetworkfabric.operations.NetworkBootstrapDevicesOperations.get": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDevices.get", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkBootstrapDevicesOperations.get": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDevices.get", + "azure.mgmt.managednetworkfabric.operations.NetworkBootstrapDevicesOperations.begin_create": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDevices.create", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkBootstrapDevicesOperations.begin_create": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDevices.create", + "azure.mgmt.managednetworkfabric.operations.NetworkBootstrapDevicesOperations.begin_update": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDevices.update", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkBootstrapDevicesOperations.begin_update": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDevices.update", + "azure.mgmt.managednetworkfabric.operations.NetworkBootstrapDevicesOperations.begin_delete": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDevices.delete", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkBootstrapDevicesOperations.begin_delete": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDevices.delete", + "azure.mgmt.managednetworkfabric.operations.NetworkBootstrapDevicesOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDevices.listByResourceGroup", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkBootstrapDevicesOperations.list_by_resource_group": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDevices.listByResourceGroup", + "azure.mgmt.managednetworkfabric.operations.NetworkBootstrapDevicesOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDevices.listBySubscription", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkBootstrapDevicesOperations.list_by_subscription": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDevices.listBySubscription", + "azure.mgmt.managednetworkfabric.operations.NetworkBootstrapDevicesOperations.begin_reboot": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDevices.reboot", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkBootstrapDevicesOperations.begin_reboot": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDevices.reboot", + "azure.mgmt.managednetworkfabric.operations.NetworkBootstrapDevicesOperations.begin_refresh_configuration": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDevices.refreshConfiguration", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkBootstrapDevicesOperations.begin_refresh_configuration": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDevices.refreshConfiguration", + "azure.mgmt.managednetworkfabric.operations.NetworkBootstrapDevicesOperations.begin_upgrade": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDevices.upgrade", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkBootstrapDevicesOperations.begin_upgrade": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDevices.upgrade", + "azure.mgmt.managednetworkfabric.operations.NetworkBootstrapDevicesOperations.begin_update_administrative_state": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDevices.updateAdministrativeState", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkBootstrapDevicesOperations.begin_update_administrative_state": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDevices.updateAdministrativeState", + "azure.mgmt.managednetworkfabric.operations.NetworkBootstrapDevicesOperations.begin_resync_passwords": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDevices.resyncPasswords", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkBootstrapDevicesOperations.begin_resync_passwords": "Microsoft.ManagedNetworkFabric.NetworkBootstrapDevices.resyncPasswords", + "azure.mgmt.managednetworkfabric.operations.NetworkBootstrapInterfacesOperations.get": "Microsoft.ManagedNetworkFabric.NetworkBootstrapInterfaces.get", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkBootstrapInterfacesOperations.get": "Microsoft.ManagedNetworkFabric.NetworkBootstrapInterfaces.get", + "azure.mgmt.managednetworkfabric.operations.NetworkBootstrapInterfacesOperations.begin_create": "Microsoft.ManagedNetworkFabric.NetworkBootstrapInterfaces.create", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkBootstrapInterfacesOperations.begin_create": "Microsoft.ManagedNetworkFabric.NetworkBootstrapInterfaces.create", + "azure.mgmt.managednetworkfabric.operations.NetworkBootstrapInterfacesOperations.begin_update": "Microsoft.ManagedNetworkFabric.NetworkBootstrapInterfaces.update", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkBootstrapInterfacesOperations.begin_update": "Microsoft.ManagedNetworkFabric.NetworkBootstrapInterfaces.update", + "azure.mgmt.managednetworkfabric.operations.NetworkBootstrapInterfacesOperations.begin_delete": "Microsoft.ManagedNetworkFabric.NetworkBootstrapInterfaces.delete", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkBootstrapInterfacesOperations.begin_delete": "Microsoft.ManagedNetworkFabric.NetworkBootstrapInterfaces.delete", + "azure.mgmt.managednetworkfabric.operations.NetworkBootstrapInterfacesOperations.list_by_network_bootstrap_device": "Microsoft.ManagedNetworkFabric.NetworkBootstrapInterfaces.listByNetworkBootstrapDevice", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkBootstrapInterfacesOperations.list_by_network_bootstrap_device": "Microsoft.ManagedNetworkFabric.NetworkBootstrapInterfaces.listByNetworkBootstrapDevice", + "azure.mgmt.managednetworkfabric.operations.NetworkBootstrapInterfacesOperations.begin_update_administrative_state": "Microsoft.ManagedNetworkFabric.NetworkBootstrapInterfaces.updateAdministrativeState", + "azure.mgmt.managednetworkfabric.aio.operations.NetworkBootstrapInterfacesOperations.begin_update_administrative_state": "Microsoft.ManagedNetworkFabric.NetworkBootstrapInterfaces.updateAdministrativeState" + } +} \ No newline at end of file diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/__init__.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/__init__.py index 8db66d3d0f0f..d55ccad1f573 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/__init__.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/__init__.py @@ -1 +1 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/__init__.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/__init__.py index 8db66d3d0f0f..d55ccad1f573 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/__init__.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/__init__.py @@ -1 +1 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/__init__.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/__init__.py index 81e2832ac5dc..6215cfa3f9ac 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/__init__.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/__init__.py @@ -2,25 +2,31 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._managed_network_fabric_mgmt_client import ManagedNetworkFabricMgmtClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import ManagedNetworkFabricClient # type: ignore from ._version import VERSION __version__ = VERSION try: from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import + from ._patch import * except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk __all__ = [ - "ManagedNetworkFabricMgmtClient", + "ManagedNetworkFabricClient", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_managed_network_fabric_mgmt_client.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_client.py similarity index 70% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_managed_network_fabric_mgmt_client.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_client.py index 132b908ce5b7..2f2f4a835939 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_managed_network_fabric_mgmt_client.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_client.py @@ -2,19 +2,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 Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python 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 typing import Any, Optional, TYPE_CHECKING, cast +from typing_extensions import Self +from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse +from azure.core.settings import settings from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints -from . import models as _models -from ._configuration import ManagedNetworkFabricMgmtClientConfiguration -from ._serialization import Deserializer, Serializer +from ._configuration import ManagedNetworkFabricClientConfiguration +from ._utils.serialization import Deserializer, Serializer from .operations import ( AccessControlListsOperations, ExternalNetworksOperations, @@ -27,12 +31,15 @@ L2IsolationDomainsOperations, L3IsolationDomainsOperations, NeighborGroupsOperations, + NetworkBootstrapDevicesOperations, + NetworkBootstrapInterfacesOperations, NetworkDeviceSkusOperations, NetworkDevicesOperations, NetworkFabricControllersOperations, NetworkFabricSkusOperations, NetworkFabricsOperations, NetworkInterfacesOperations, + NetworkMonitorsOperations, NetworkPacketBrokersOperations, NetworkRacksOperations, NetworkTapRulesOperations, @@ -43,22 +50,24 @@ ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports + from azure.core import AzureClouds from azure.core.credentials import TokenCredential -class ManagedNetworkFabricMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes +class ManagedNetworkFabricClient: # pylint: disable=too-many-instance-attributes """Self service experience for Azure Network Fabric API. + :ivar operations: Operations operations + :vartype operations: azure.mgmt.managednetworkfabric.operations.Operations :ivar access_control_lists: AccessControlListsOperations operations :vartype access_control_lists: azure.mgmt.managednetworkfabric.operations.AccessControlListsOperations - :ivar internet_gateways: InternetGatewaysOperations operations - :vartype internet_gateways: - azure.mgmt.managednetworkfabric.operations.InternetGatewaysOperations :ivar internet_gateway_rules: InternetGatewayRulesOperations operations :vartype internet_gateway_rules: azure.mgmt.managednetworkfabric.operations.InternetGatewayRulesOperations + :ivar internet_gateways: InternetGatewaysOperations operations + :vartype internet_gateways: + azure.mgmt.managednetworkfabric.operations.InternetGatewaysOperations :ivar ip_communities: IpCommunitiesOperations operations :vartype ip_communities: azure.mgmt.managednetworkfabric.operations.IpCommunitiesOperations :ivar ip_extended_communities: IpExtendedCommunitiesOperations operations @@ -109,18 +118,28 @@ class ManagedNetworkFabricMgmtClient: # pylint: disable=client-accepts-api-vers azure.mgmt.managednetworkfabric.operations.NetworkTapRulesOperations :ivar network_taps: NetworkTapsOperations operations :vartype network_taps: azure.mgmt.managednetworkfabric.operations.NetworkTapsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.managednetworkfabric.operations.Operations :ivar route_policies: RoutePoliciesOperations operations :vartype route_policies: azure.mgmt.managednetworkfabric.operations.RoutePoliciesOperations - :param credential: Credential needed for the client to connect to Azure. Required. + :ivar network_monitors: NetworkMonitorsOperations operations + :vartype network_monitors: azure.mgmt.managednetworkfabric.operations.NetworkMonitorsOperations + :ivar network_bootstrap_devices: NetworkBootstrapDevicesOperations operations + :vartype network_bootstrap_devices: + azure.mgmt.managednetworkfabric.operations.NetworkBootstrapDevicesOperations + :ivar network_bootstrap_interfaces: NetworkBootstrapInterfacesOperations operations + :vartype network_bootstrap_interfaces: + azure.mgmt.managednetworkfabric.operations.NetworkBootstrapInterfacesOperations + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". + :param base_url: Service host. Default value is None. :type base_url: str - :keyword api_version: Api Version. Default value is "2023-06-15". Note that overriding this - default value may result in unsupported behavior. + :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :paramtype cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are "2025-07-15". + Default value is "2025-07-15". Note that overriding this default value may result in + unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -130,25 +149,57 @@ def __init__( self, credential: "TokenCredential", subscription_id: str, - base_url: str = "https://management.azure.com", + base_url: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - self._config = ManagedNetworkFabricMgmtClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs + _endpoint = "{endpoint}" + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) + self._config = ManagedNetworkFabricClientConfiguration( + credential=credential, + subscription_id=subscription_id, + base_url=cast(str, base_url), + cloud_setting=cloud_setting, + credential_scopes=credential_scopes, + **kwargs ) - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **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) + _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=cast(str, _endpoint), policies=_policies, **kwargs) + + self._serialize = Serializer() + self._deserialize = Deserializer() self._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.access_control_lists = AccessControlListsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.internet_gateways = InternetGatewaysOperations( + self.internet_gateway_rules = InternetGatewayRulesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.internet_gateway_rules = InternetGatewayRulesOperations( + self.internet_gateways = InternetGatewaysOperations( self._client, self._config, self._serialize, self._deserialize ) self.ip_communities = IpCommunitiesOperations(self._client, self._config, self._serialize, self._deserialize) @@ -194,16 +245,24 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.network_taps = NetworkTapsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.route_policies = RoutePoliciesOperations(self._client, self._config, self._serialize, self._deserialize) + self.network_monitors = NetworkMonitorsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.network_bootstrap_devices = NetworkBootstrapDevicesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.network_bootstrap_interfaces = NetworkBootstrapInterfacesOperations( + self._client, self._config, self._serialize, self._deserialize + ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: + 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) + >>> response = client.send_request(request) For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request @@ -216,13 +275,17 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: """ request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: self._client.close() - def __enter__(self) -> "ManagedNetworkFabricMgmtClient": + def __enter__(self) -> Self: self._client.__enter__() return self diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_configuration.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_configuration.py index 0f2bab76752e..41b0a1bc1544 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_configuration.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_configuration.py @@ -2,41 +2,52 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING -from azure.core.configuration import Configuration 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 import AzureClouds from azure.core.credentials import TokenCredential -class ManagedNetworkFabricMgmtClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for ManagedNetworkFabricMgmtClient. +class ManagedNetworkFabricClientConfiguration: # pylint: disable=too-many-instance-attributes + """Configuration for ManagedNetworkFabricClient. 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. + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2023-06-15". Note that overriding this - default value may result in unsupported behavior. + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str + :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :type cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are "2025-07-15". + Default value is "2025-07-15". Note that overriding this default value may result in + unsupported behavior. :paramtype api_version: str """ - def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(ManagedNetworkFabricMgmtClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2023-06-15") + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any + ) -> None: + api_version: str = kwargs.pop("api_version", "2025-07-15") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -45,9 +56,12 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs self.credential = credential self.subscription_id = subscription_id + self.base_url = base_url + self.cloud_setting = cloud_setting self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-managednetworkfabric/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -56,9 +70,9 @@ def _configure(self, **kwargs: Any) -> None: 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.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**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( diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_patch.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_patch.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """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 + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_utils/__init__.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_utils/__init__.py new file mode 100644 index 000000000000..8026245c2abc --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_utils/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_utils/model_base.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_utils/model_base.py new file mode 100644 index 000000000000..7b7f8ba67b53 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_utils/model_base.py @@ -0,0 +1,1350 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access, broad-except + +import copy +import calendar +import decimal +import functools +import sys +import logging +import base64 +import re +import typing +import enum +import email.utils +from datetime import datetime, date, time, timedelta, timezone +from json import JSONEncoder +import xml.etree.ElementTree as ET +from collections.abc import MutableMapping +from typing_extensions import Self +import isodate +from azure.core.exceptions import DeserializationError +from azure.core import CaseInsensitiveEnumMeta +from azure.core.pipeline import PipelineResponse +from azure.core.serialization import _Null +from azure.core.rest import HttpResponse + +_LOGGER = logging.getLogger(__name__) + +__all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] + +TZ_UTC = timezone.utc +_T = typing.TypeVar("_T") +_NONE_TYPE = type(None) + + +def _timedelta_as_isostr(td: timedelta) -> str: + """Converts a datetime.timedelta object into an ISO 8601 formatted string, e.g. 'P4DT12H30M05S' + + Function adapted from the Tin Can Python project: https://github.com/RusticiSoftware/TinCanPython + + :param timedelta td: The timedelta to convert + :rtype: str + :return: ISO8601 version of this timedelta + """ + + # Split seconds to larger units + seconds = td.total_seconds() + minutes, seconds = divmod(seconds, 60) + hours, minutes = divmod(minutes, 60) + days, hours = divmod(hours, 24) + + days, hours, minutes = list(map(int, (days, hours, minutes))) + seconds = round(seconds, 6) + + # Build date + date_str = "" + if days: + date_str = "%sD" % days + + if hours or minutes or seconds: + # Build time + time_str = "T" + + # Hours + bigger_exists = date_str or hours + if bigger_exists: + time_str += "{:02}H".format(hours) + + # Minutes + bigger_exists = bigger_exists or minutes + if bigger_exists: + time_str += "{:02}M".format(minutes) + + # Seconds + try: + if seconds.is_integer(): + seconds_string = "{:02}".format(int(seconds)) + else: + # 9 chars long w/ leading 0, 6 digits after decimal + seconds_string = "%09.6f" % seconds + # Remove trailing zeros + seconds_string = seconds_string.rstrip("0") + except AttributeError: # int.is_integer() raises + seconds_string = "{:02}".format(seconds) + + time_str += "{}S".format(seconds_string) + else: + time_str = "" + + return "P" + date_str + time_str + + +def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: + encoded = base64.b64encode(o).decode() + if format == "base64url": + return encoded.strip("=").replace("+", "-").replace("/", "_") + return encoded + + +def _serialize_datetime(o, format: typing.Optional[str] = None): + if hasattr(o, "year") and hasattr(o, "hour"): + if format == "rfc7231": + return email.utils.format_datetime(o, usegmt=True) + if format == "unix-timestamp": + return int(calendar.timegm(o.utctimetuple())) + + # astimezone() fails for naive times in Python 2.7, so make make sure o is aware (tzinfo is set) + if not o.tzinfo: + iso_formatted = o.replace(tzinfo=TZ_UTC).isoformat() + else: + iso_formatted = o.astimezone(TZ_UTC).isoformat() + # Replace the trailing "+00:00" UTC offset with "Z" (RFC 3339: https://www.ietf.org/rfc/rfc3339.txt) + return iso_formatted.replace("+00:00", "Z") + # Next try datetime.date or datetime.time + return o.isoformat() + + +def _is_readonly(p): + try: + return p._visibility == ["read"] + except AttributeError: + return False + + +class SdkJSONEncoder(JSONEncoder): + """A JSON encoder that's capable of serializing datetime objects and bytes.""" + + def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): + super().__init__(*args, **kwargs) + self.exclude_readonly = exclude_readonly + self.format = format + + def default(self, o): # pylint: disable=too-many-return-statements + if _is_model(o): + if self.exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + return {k: v for k, v in o.items() if k not in readonly_props} + return dict(o.items()) + try: + return super(SdkJSONEncoder, self).default(o) + except TypeError: + if isinstance(o, _Null): + return None + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, self.format) + try: + # First try datetime.datetime + return _serialize_datetime(o, self.format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return super(SdkJSONEncoder, self).default(o) + + +_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}]?") +_VALID_RFC7231 = re.compile( + r"(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s\d{2}\s" + r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" +) + +_ARRAY_ENCODE_MAPPING = { + "pipeDelimited": "|", + "spaceDelimited": " ", + "commaDelimited": ",", + "newlineDelimited": "\n", +} + + +def _deserialize_array_encoded(delimit: str, attr): + if isinstance(attr, str): + if attr == "": + return [] + return attr.split(delimit) + return attr + + +def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + attr = attr.upper() + match = _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") + return date_obj # type: ignore[no-any-return] + + +def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize RFC7231 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + match = _VALID_RFC7231.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + return email.utils.parsedate_to_datetime(attr) + + +def _deserialize_datetime_unix_timestamp(attr: typing.Union[float, datetime]) -> datetime: + """Deserialize unix timestamp into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + return datetime.fromtimestamp(attr, TZ_UTC) + + +def _deserialize_date(attr: typing.Union[str, date]) -> date: + """Deserialize ISO-8601 formatted string into Date object. + :param str attr: response string to be deserialized. + :rtype: date + :returns: The date object from that input + """ + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + if isinstance(attr, date): + return attr + return isodate.parse_date(attr, defaultmonth=None, defaultday=None) # type: ignore + + +def _deserialize_time(attr: typing.Union[str, time]) -> time: + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :rtype: datetime.time + :returns: The time object from that input + """ + if isinstance(attr, time): + return attr + return isodate.parse_time(attr) # type: ignore[no-any-return] + + +def _deserialize_bytes(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + return bytes(base64.b64decode(attr)) + + +def _deserialize_bytes_base64(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return bytes(base64.b64decode(encoded)) + + +def _deserialize_duration(attr): + if isinstance(attr, timedelta): + return attr + return isodate.parse_duration(attr) + + +def _deserialize_decimal(attr): + if isinstance(attr, decimal.Decimal): + return attr + return decimal.Decimal(str(attr)) + + +def _deserialize_int_as_str(attr): + if isinstance(attr, int): + return attr + return int(attr) + + +_DESERIALIZE_MAPPING = { + datetime: _deserialize_datetime, + date: _deserialize_date, + time: _deserialize_time, + bytes: _deserialize_bytes, + bytearray: _deserialize_bytes, + timedelta: _deserialize_duration, + typing.Any: lambda x: x, + decimal.Decimal: _deserialize_decimal, +} + +_DESERIALIZE_MAPPING_WITHFORMAT = { + "rfc3339": _deserialize_datetime, + "rfc7231": _deserialize_datetime_rfc7231, + "unix-timestamp": _deserialize_datetime_unix_timestamp, + "base64": _deserialize_bytes, + "base64url": _deserialize_bytes_base64, +} + + +def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): + if annotation is int and rf and rf._format == "str": + return _deserialize_int_as_str + if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: + return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) + if rf and rf._format: + return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) + return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore + + +def _get_type_alias_type(module_name: str, alias_name: str): + types = { + k: v + for k, v in sys.modules[module_name].__dict__.items() + if isinstance(v, typing._GenericAlias) # type: ignore + } + if alias_name not in types: + return alias_name + return types[alias_name] + + +def _get_model(module_name: str, model_name: str): + models = {k: v for k, v in sys.modules[module_name].__dict__.items() if isinstance(v, type)} + module_end = module_name.rsplit(".", 1)[0] + models.update({k: v for k, v in sys.modules[module_end].__dict__.items() if isinstance(v, type)}) + if isinstance(model_name, str): + model_name = model_name.split(".")[-1] + if model_name not in models: + return model_name + return models[model_name] + + +_UNSET = object() + + +class _MyMutableMapping(MutableMapping[str, typing.Any]): + def __init__(self, data: dict[str, typing.Any]) -> None: + self._data = data + + def __contains__(self, key: typing.Any) -> bool: + return key in self._data + + def __getitem__(self, key: str) -> typing.Any: + # If this key has been deserialized (for mutable types), we need to handle serialization + if hasattr(self, "_attr_to_rest_field"): + cache_attr = f"_deserialized_{key}" + if hasattr(self, cache_attr): + rf = _get_rest_field(getattr(self, "_attr_to_rest_field"), key) + if rf: + value = self._data.get(key) + if isinstance(value, (dict, list, set)): + # For mutable types, serialize and return + # But also update _data with serialized form and clear flag + # so mutations via this returned value affect _data + serialized = _serialize(value, rf._format) + # If serialized form is same type (no transformation needed), + # return _data directly so mutations work + if isinstance(serialized, type(value)) and serialized == value: + return self._data.get(key) + # Otherwise return serialized copy and clear flag + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + # Store serialized form back + self._data[key] = serialized + return serialized + return self._data.__getitem__(key) + + def __setitem__(self, key: str, value: typing.Any) -> None: + # Clear any cached deserialized value when setting through dictionary access + cache_attr = f"_deserialized_{key}" + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + self._data.__setitem__(key, value) + + def __delitem__(self, key: str) -> None: + self._data.__delitem__(key) + + def __iter__(self) -> typing.Iterator[typing.Any]: + return self._data.__iter__() + + def __len__(self) -> int: + return self._data.__len__() + + def __ne__(self, other: typing.Any) -> bool: + return not self.__eq__(other) + + def keys(self) -> typing.KeysView[str]: + """ + :returns: a set-like object providing a view on D's keys + :rtype: ~typing.KeysView + """ + return self._data.keys() + + def values(self) -> typing.ValuesView[typing.Any]: + """ + :returns: an object providing a view on D's values + :rtype: ~typing.ValuesView + """ + return self._data.values() + + def items(self) -> typing.ItemsView[str, typing.Any]: + """ + :returns: set-like object providing a view on D's items + :rtype: ~typing.ItemsView + """ + return self._data.items() + + def get(self, key: str, default: typing.Any = None) -> typing.Any: + """ + Get the value for key if key is in the dictionary, else default. + :param str key: The key to look up. + :param any default: The value to return if key is not in the dictionary. Defaults to None + :returns: D[k] if k in D, else d. + :rtype: any + """ + try: + return self[key] + except KeyError: + return default + + @typing.overload + def pop(self, key: str) -> typing.Any: ... # pylint: disable=arguments-differ + + @typing.overload + def pop(self, key: str, default: _T) -> _T: ... # pylint: disable=signature-differs + + @typing.overload + def pop(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs + + def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Removes specified key and return the corresponding value. + :param str key: The key to pop. + :param any default: The value to return if key is not in the dictionary + :returns: The value corresponding to the key. + :rtype: any + :raises KeyError: If key is not found and default is not given. + """ + if default is _UNSET: + return self._data.pop(key) + return self._data.pop(key, default) + + def popitem(self) -> tuple[str, typing.Any]: + """ + Removes and returns some (key, value) pair + :returns: The (key, value) pair. + :rtype: tuple + :raises KeyError: if D is empty. + """ + return self._data.popitem() + + def clear(self) -> None: + """ + Remove all items from D. + """ + self._data.clear() + + def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ + """ + Updates D from mapping/iterable E and F. + :param any args: Either a mapping object or an iterable of key-value pairs. + """ + self._data.update(*args, **kwargs) + + @typing.overload + def setdefault(self, key: str, default: None = None) -> None: ... + + @typing.overload + def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs + + def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Same as calling D.get(k, d), and setting D[k]=d if k not found + :param str key: The key to look up. + :param any default: The value to set if key is not in the dictionary + :returns: D[k] if k in D, else d. + :rtype: any + """ + if default is _UNSET: + return self._data.setdefault(key) + return self._data.setdefault(key, default) + + def __eq__(self, other: typing.Any) -> bool: + if isinstance(other, _MyMutableMapping): + return self._data == other._data + try: + other_model = self.__class__(other) + except Exception: + return False + return self._data == other_model._data + + def __repr__(self) -> str: + return str(self._data) + + +def _is_model(obj: typing.Any) -> bool: + return getattr(obj, "_is_model", False) + + +def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements + if isinstance(o, list): + if format in _ARRAY_ENCODE_MAPPING and all(isinstance(x, str) for x in o): + return _ARRAY_ENCODE_MAPPING[format].join(o) + return [_serialize(x, format) for x in o] + if isinstance(o, dict): + return {k: _serialize(v, format) for k, v in o.items()} + if isinstance(o, set): + return {_serialize(x, format) for x in o} + if isinstance(o, tuple): + return tuple(_serialize(x, format) for x in o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, format) + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, enum.Enum): + return o.value + if isinstance(o, int): + if format == "str": + return str(o) + return o + try: + # First try datetime.datetime + return _serialize_datetime(o, format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return o + + +def _get_rest_field(attr_to_rest_field: dict[str, "_RestField"], rest_name: str) -> typing.Optional["_RestField"]: + try: + return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) + except StopIteration: + return None + + +def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typing.Any: + if not rf: + return _serialize(value, None) + if rf._is_multipart_file_input: + return value + if rf._is_model: + return _deserialize(rf._type, value) + if isinstance(value, ET.Element): + value = _deserialize(rf._type, value) + return _serialize(value, rf._format) + + +class Model(_MyMutableMapping): + _is_model = True + # label whether current class's _attr_to_rest_field has been calculated + # could not see _attr_to_rest_field directly because subclass inherits it from parent class + _calculated: set[str] = set() + + def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: + class_name = self.__class__.__name__ + if len(args) > 1: + raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") + dict_to_pass = { + rest_field._rest_name: rest_field._default + for rest_field in self._attr_to_rest_field.values() + if rest_field._default is not _UNSET + } + if args: # pylint: disable=too-many-nested-blocks + if isinstance(args[0], ET.Element): + existed_attr_keys = [] + model_meta = getattr(self, "_xml", {}) + + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and args[0].get(xml_name) is not None: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + # unwrapped array could either use prop items meta/prop meta + if prop_meta.get("itemsName"): + xml_name = prop_meta.get("itemsName") + xml_ns = prop_meta.get("itemNs") + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = args[0].findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, items) + elif not rf._is_optional: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = [] + continue + + # text element is primitive type + if prop_meta.get("text", False): + if args[0].text is not None: + dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].text) + continue + + # wrapped element could be normal property or array, it should only have one element + item = args[0].find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, item) + + # rest thing is additional properties + for e in args[0]: + if e.tag not in existed_attr_keys: + dict_to_pass[e.tag] = _convert_element(e) + else: + dict_to_pass.update( + {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} + ) + else: + non_attr_kwargs = [k for k in kwargs if k not in self._attr_to_rest_field] + if non_attr_kwargs: + # actual type errors only throw the first wrong keyword arg they see, so following that. + raise TypeError(f"{class_name}.__init__() got an unexpected keyword argument '{non_attr_kwargs[0]}'") + dict_to_pass.update( + { + self._attr_to_rest_field[k]._rest_name: _create_value(self._attr_to_rest_field[k], v) + for k, v in kwargs.items() + if v is not None + } + ) + super().__init__(dict_to_pass) + + def copy(self) -> "Model": + return Model(self.__dict__) + + def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: + if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated: + # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', + # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' + mros = cls.__mro__[:-9][::-1] # ignore parents, and reverse the mro order + attr_to_rest_field: dict[str, _RestField] = { # map attribute name to rest_field property + k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") + } + annotations = { + k: v + for mro_class in mros + if hasattr(mro_class, "__annotations__") + for k, v in mro_class.__annotations__.items() + } + for attr, rf in attr_to_rest_field.items(): + rf._module = cls.__module__ + if not rf._type: + rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) + if not rf._rest_name_input: + rf._rest_name_input = attr + cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) + cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") + + return super().__new__(cls) + + def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: + for base in cls.__bases__: + if hasattr(base, "__mapping__"): + base.__mapping__[discriminator or cls.__name__] = cls # type: ignore + + @classmethod + def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: + for v in cls.__dict__.values(): + if isinstance(v, _RestField) and v._is_discriminator and v._rest_name not in exist_discriminators: + return v + return None + + @classmethod + def _deserialize(cls, data, exist_discriminators): + if not hasattr(cls, "__mapping__"): + return cls(data) + discriminator = cls._get_discriminator(exist_discriminators) + if discriminator is None: + return cls(data) + exist_discriminators.append(discriminator._rest_name) + if isinstance(data, ET.Element): + model_meta = getattr(cls, "_xml", {}) + prop_meta = getattr(discriminator, "_xml", {}) + xml_name = prop_meta.get("name", discriminator._rest_name) + xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + if data.get(xml_name) is not None: + discriminator_value = data.get(xml_name) + else: + discriminator_value = data.find(xml_name).text # pyright: ignore + else: + discriminator_value = data.get(discriminator._rest_name) + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member + return mapped_cls._deserialize(data, exist_discriminators) + + def as_dict(self, *, exclude_readonly: bool = False) -> dict[str, typing.Any]: + """Return a dict that can be turned into json using json.dump. + + :keyword bool exclude_readonly: Whether to remove the readonly properties. + :returns: A dict JSON compatible object + :rtype: dict + """ + + result = {} + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in self._attr_to_rest_field.values() if _is_readonly(p)] + for k, v in self.items(): + if exclude_readonly and k in readonly_props: # pyright: ignore + continue + is_multipart_file_input = False + try: + is_multipart_file_input = next( + rf for rf in self._attr_to_rest_field.values() if rf._rest_name == k + )._is_multipart_file_input + except StopIteration: + pass + result[k] = v if is_multipart_file_input else Model._as_dict_value(v, exclude_readonly=exclude_readonly) + return result + + @staticmethod + def _as_dict_value(v: typing.Any, exclude_readonly: bool = False) -> typing.Any: + if v is None or isinstance(v, _Null): + return None + if isinstance(v, (list, tuple, set)): + return type(v)(Model._as_dict_value(x, exclude_readonly=exclude_readonly) for x in v) + if isinstance(v, dict): + return {dk: Model._as_dict_value(dv, exclude_readonly=exclude_readonly) for dk, dv in v.items()} + return v.as_dict(exclude_readonly=exclude_readonly) if hasattr(v, "as_dict") else v + + +def _deserialize_model(model_deserializer: typing.Optional[typing.Callable], obj): + if _is_model(obj): + return obj + return _deserialize(model_deserializer, obj) + + +def _deserialize_with_optional(if_obj_deserializer: typing.Optional[typing.Callable], obj): + if obj is None: + return obj + return _deserialize_with_callable(if_obj_deserializer, obj) + + +def _deserialize_with_union(deserializers, obj): + for deserializer in deserializers: + try: + return _deserialize(deserializer, obj) + except DeserializationError: + pass + raise DeserializationError() + + +def _deserialize_dict( + value_deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj: dict[typing.Any, typing.Any], +): + if obj is None: + return obj + if isinstance(obj, ET.Element): + obj = {child.tag: child for child in obj} + return {k: _deserialize(value_deserializer, v, module) for k, v in obj.items()} + + +def _deserialize_multiple_sequence( + entry_deserializers: list[typing.Optional[typing.Callable]], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + return type(obj)(_deserialize(deserializer, entry, module) for entry, deserializer in zip(obj, entry_deserializers)) + + +def _is_array_encoded_deserializer(deserializer: functools.partial) -> bool: + return ( + isinstance(deserializer, functools.partial) + and isinstance(deserializer.args[0], functools.partial) + and deserializer.args[0].func == _deserialize_array_encoded # pylint: disable=comparison-with-callable + ) + + +def _deserialize_sequence( + deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + if isinstance(obj, ET.Element): + obj = list(obj) + + # encoded string may be deserialized to sequence + if isinstance(obj, str) and isinstance(deserializer, functools.partial): + # for list[str] + if _is_array_encoded_deserializer(deserializer): + return deserializer(obj) + + # for list[Union[...]] + if isinstance(deserializer.args[0], list): + for sub_deserializer in deserializer.args[0]: + if _is_array_encoded_deserializer(sub_deserializer): + return sub_deserializer(obj) + + return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) + + +def _sorted_annotations(types: list[typing.Any]) -> list[typing.Any]: + return sorted( + types, + key=lambda x: hasattr(x, "__name__") and x.__name__.lower() in ("str", "float", "int", "bool"), + ) + + +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-statements, too-many-branches + annotation: typing.Any, + module: typing.Optional[str], + rf: typing.Optional["_RestField"] = None, +) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + if not annotation: + return None + + # is it a type alias? + if isinstance(annotation, str): + if module is not None: + annotation = _get_type_alias_type(module, annotation) + + # is it a forward ref / in quotes? + if isinstance(annotation, (str, typing.ForwardRef)): + try: + model_name = annotation.__forward_arg__ # type: ignore + except AttributeError: + model_name = annotation + if module is not None: + annotation = _get_model(module, model_name) # type: ignore + + try: + if module and _is_model(annotation): + if rf: + rf._is_model = True + + return functools.partial(_deserialize_model, annotation) # pyright: ignore + except Exception: + pass + + # is it a literal? + try: + if annotation.__origin__ is typing.Literal: # pyright: ignore + return None + except AttributeError: + pass + + # is it optional? + try: + if any(a is _NONE_TYPE for a in annotation.__args__): # pyright: ignore + if rf: + rf._is_optional = True + if len(annotation.__args__) <= 2: # pyright: ignore + if_obj_deserializer = _get_deserialize_callable_from_annotation( + next(a for a in annotation.__args__ if a is not _NONE_TYPE), module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_with_optional, if_obj_deserializer) + # the type is Optional[Union[...]], we need to remove the None type from the Union + annotation_copy = copy.copy(annotation) + annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a is not _NONE_TYPE] # pyright: ignore + return _get_deserialize_callable_from_annotation(annotation_copy, module, rf) + except AttributeError: + pass + + # is it union? + if getattr(annotation, "__origin__", None) is typing.Union: + # initial ordering is we make `string` the last deserialization option, because it is often them most generic + deserializers = [ + _get_deserialize_callable_from_annotation(arg, module, rf) + for arg in _sorted_annotations(annotation.__args__) # pyright: ignore + ] + + return functools.partial(_deserialize_with_union, deserializers) + + try: + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() == "dict": + value_deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[1], module, rf # pyright: ignore + ) + + return functools.partial( + _deserialize_dict, + value_deserializer, + module, + ) + except (AttributeError, IndexError): + pass + try: + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() in ["list", "set", "tuple", "sequence"]: + if len(annotation.__args__) > 1: # pyright: ignore + entry_deserializers = [ + _get_deserialize_callable_from_annotation(dt, module, rf) + for dt in annotation.__args__ # pyright: ignore + ] + return functools.partial(_deserialize_multiple_sequence, entry_deserializers, module) + deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[0], module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_sequence, deserializer, module) + except (TypeError, IndexError, AttributeError, SyntaxError): + pass + + def _deserialize_default( + deserializer, + obj, + ): + if obj is None: + return obj + try: + return _deserialize_with_callable(deserializer, obj) + except Exception: + pass + return obj + + if get_deserializer(annotation, rf): + return functools.partial(_deserialize_default, get_deserializer(annotation, rf)) + + return functools.partial(_deserialize_default, annotation) + + +def _deserialize_with_callable( + deserializer: typing.Optional[typing.Callable[[typing.Any], typing.Any]], + value: typing.Any, +): # pylint: disable=too-many-return-statements + try: + if value is None or isinstance(value, _Null): + return None + if isinstance(value, ET.Element): + if deserializer is str: + return value.text or "" + if deserializer is int: + return int(value.text) if value.text else None + if deserializer is float: + return float(value.text) if value.text else None + if deserializer is bool: + return value.text == "true" if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING.values(): + return deserializer(value.text) if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING_WITHFORMAT.values(): + return deserializer(value.text) if value.text else None + if deserializer is None: + return value + if deserializer in [int, float, bool]: + return deserializer(value) + if isinstance(deserializer, CaseInsensitiveEnumMeta): + try: + return deserializer(value.text if isinstance(value, ET.Element) else value) + except ValueError: + # for unknown value, return raw value + return value.text if isinstance(value, ET.Element) else value + if isinstance(deserializer, type) and issubclass(deserializer, Model): + return deserializer._deserialize(value, []) + return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) + except Exception as e: + raise DeserializationError() from e + + +def _deserialize( + deserializer: typing.Any, + value: typing.Any, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + if isinstance(value, PipelineResponse): + value = value.http_response.json() + if rf is None and format: + rf = _RestField(format=format) + if not isinstance(deserializer, functools.partial): + deserializer = _get_deserialize_callable_from_annotation(deserializer, module, rf) + return _deserialize_with_callable(deserializer, value) + + +def _failsafe_deserialize( + deserializer: typing.Any, + response: HttpResponse, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + try: + return _deserialize(deserializer, response.json(), module, rf, format) + except Exception: # pylint: disable=broad-except + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +def _failsafe_deserialize_xml( + deserializer: typing.Any, + response: HttpResponse, +) -> typing.Any: + try: + return _deserialize_xml(deserializer, response.text()) + except Exception: # pylint: disable=broad-except + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +# pylint: disable=too-many-instance-attributes +class _RestField: + def __init__( + self, + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + is_discriminator: bool = False, + visibility: typing.Optional[list[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + xml: typing.Optional[dict[str, typing.Any]] = None, + ): + self._type = type + self._rest_name_input = name + self._module: typing.Optional[str] = None + self._is_discriminator = is_discriminator + self._visibility = visibility + self._is_model = False + self._is_optional = False + self._default = default + self._format = format + self._is_multipart_file_input = is_multipart_file_input + self._xml = xml if xml is not None else {} + + @property + def _class_type(self) -> typing.Any: + result = getattr(self._type, "args", [None])[0] + # type may be wrapped by nested functools.partial so we need to check for that + if isinstance(result, functools.partial): + return getattr(result, "args", [None])[0] + return result + + @property + def _rest_name(self) -> str: + if self._rest_name_input is None: + raise ValueError("Rest name was never set") + return self._rest_name_input + + def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin + # by this point, type and rest_name will have a value bc we default + # them in __new__ of the Model class + # Use _data.get() directly to avoid triggering __getitem__ which clears the cache + item = obj._data.get(self._rest_name) + if item is None: + return item + if self._is_model: + return item + + # For mutable types, we want mutations to directly affect _data + # Check if we've already deserialized this value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + # Return the value from _data directly (it's been deserialized in place) + return obj._data.get(self._rest_name) + + deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) + + # For mutable types, store the deserialized value back in _data + # so mutations directly affect _data + if isinstance(deserialized, (dict, list, set)): + obj._data[self._rest_name] = deserialized + object.__setattr__(obj, cache_attr, True) # Mark as deserialized + return deserialized + + return deserialized + + def __set__(self, obj: Model, value) -> None: + # Clear the cached deserialized object when setting a new value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + object.__delattr__(obj, cache_attr) + + if value is None: + # we want to wipe out entries if users set attr to None + try: + obj.__delitem__(self._rest_name) + except KeyError: + pass + return + if self._is_model: + if not _is_model(value): + value = _deserialize(self._type, value) + obj.__setitem__(self._rest_name, value) + return + obj.__setitem__(self._rest_name, _serialize(value, self._format)) + + def _get_deserialize_callable_from_annotation( + self, annotation: typing.Any + ) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + return _get_deserialize_callable_from_annotation(annotation, self._module, self) + + +def rest_field( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[list[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + xml: typing.Optional[dict[str, typing.Any]] = None, +) -> typing.Any: + return _RestField( + name=name, + type=type, + visibility=visibility, + default=default, + format=format, + is_multipart_file_input=is_multipart_file_input, + xml=xml, + ) + + +def rest_discriminator( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[list[str]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, +) -> typing.Any: + return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) + + +def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: + """Serialize a model to XML. + + :param Model model: The model to serialize. + :param bool exclude_readonly: Whether to exclude readonly properties. + :returns: The XML representation of the model. + :rtype: str + """ + return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore + + +def _get_element( + o: typing.Any, + exclude_readonly: bool = False, + parent_meta: typing.Optional[dict[str, typing.Any]] = None, + wrapped_element: typing.Optional[ET.Element] = None, +) -> typing.Union[ET.Element, list[ET.Element]]: + if _is_model(o): + model_meta = getattr(o, "_xml", {}) + + # if prop is a model, then use the prop element directly, else generate a wrapper of model + if wrapped_element is None: + wrapped_element = _create_xml_element( + model_meta.get("name", o.__class__.__name__), + model_meta.get("prefix"), + model_meta.get("ns"), + ) + + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + + for k, v in o.items(): + # do not serialize readonly properties + if exclude_readonly and k in readonly_props: + continue + + prop_rest_field = _get_rest_field(o._attr_to_rest_field, k) + if prop_rest_field: + prop_meta = getattr(prop_rest_field, "_xml").copy() + # use the wire name as xml name if no specific name is set + if prop_meta.get("name") is None: + prop_meta["name"] = k + else: + # additional properties will not have rest field, use the wire name as xml name + prop_meta = {"name": k} + + # if no ns for prop, use model's + if prop_meta.get("ns") is None and model_meta.get("ns"): + prop_meta["ns"] = model_meta.get("ns") + prop_meta["prefix"] = model_meta.get("prefix") + + if prop_meta.get("unwrapped", False): + # unwrapped could only set on array + wrapped_element.extend(_get_element(v, exclude_readonly, prop_meta)) + elif prop_meta.get("text", False): + # text could only set on primitive type + wrapped_element.text = _get_primitive_type_value(v) + elif prop_meta.get("attribute", False): + xml_name = prop_meta.get("name", k) + if prop_meta.get("ns"): + ET.register_namespace(prop_meta.get("prefix"), prop_meta.get("ns")) # pyright: ignore + xml_name = "{" + prop_meta.get("ns") + "}" + xml_name # pyright: ignore + # attribute should be primitive type + wrapped_element.set(xml_name, _get_primitive_type_value(v)) + else: + # other wrapped prop element + wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) + return wrapped_element + if isinstance(o, list): + return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore + if isinstance(o, dict): + result = [] + for k, v in o.items(): + result.append( + _get_wrapped_element( + v, + exclude_readonly, + { + "name": k, + "ns": parent_meta.get("ns") if parent_meta else None, + "prefix": parent_meta.get("prefix") if parent_meta else None, + }, + ) + ) + return result + + # primitive case need to create element based on parent_meta + if parent_meta: + return _get_wrapped_element( + o, + exclude_readonly, + { + "name": parent_meta.get("itemsName", parent_meta.get("name")), + "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), + "ns": parent_meta.get("itemsNs", parent_meta.get("ns")), + }, + ) + + raise ValueError("Could not serialize value into xml: " + o) + + +def _get_wrapped_element( + v: typing.Any, + exclude_readonly: bool, + meta: typing.Optional[dict[str, typing.Any]], +) -> ET.Element: + wrapped_element = _create_xml_element( + meta.get("name") if meta else None, meta.get("prefix") if meta else None, meta.get("ns") if meta else None + ) + if isinstance(v, (dict, list)): + wrapped_element.extend(_get_element(v, exclude_readonly, meta)) + elif _is_model(v): + _get_element(v, exclude_readonly, meta, wrapped_element) + else: + wrapped_element.text = _get_primitive_type_value(v) + return wrapped_element # type: ignore[no-any-return] + + +def _get_primitive_type_value(v) -> str: + if v is True: + return "true" + if v is False: + return "false" + if isinstance(v, _Null): + return "" + return str(v) + + +def _create_xml_element( + tag: typing.Any, prefix: typing.Optional[str] = None, ns: typing.Optional[str] = None +) -> ET.Element: + if prefix and ns: + ET.register_namespace(prefix, ns) + if ns: + return ET.Element("{" + ns + "}" + tag) + return ET.Element(tag) + + +def _deserialize_xml( + deserializer: typing.Any, + value: str, +) -> typing.Any: + element = ET.fromstring(value) # nosec + return _deserialize(deserializer, element) + + +def _convert_element(e: ET.Element): + # dict case + if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: + dict_result: dict[str, typing.Any] = {} + for child in e: + if dict_result.get(child.tag) is not None: + if isinstance(dict_result[child.tag], list): + dict_result[child.tag].append(_convert_element(child)) + else: + dict_result[child.tag] = [dict_result[child.tag], _convert_element(child)] + else: + dict_result[child.tag] = _convert_element(child) + dict_result.update(e.attrib) + return dict_result + # array case + if len(e) > 0: + array_result: list[typing.Any] = [] + for child in e: + array_result.append(_convert_element(child)) + return array_result + # primitive case + return e.text diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_serialization.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_utils/serialization.py similarity index 78% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_serialization.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_utils/serialization.py index 842ae727fbbc..81ec1de5922b 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_serialization.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_utils/serialization.py @@ -1,30 +1,12 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 # -------------------------------------------------------------------------- -# # 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. -# +# 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. # -------------------------------------------------------------------------- -# pylint: skip-file # pyright: reportUnnecessaryTypeIgnoreComment=false from base64 import b64decode, b64encode @@ -39,7 +21,6 @@ import sys import codecs from typing import ( - Dict, Any, cast, Optional, @@ -48,11 +29,7 @@ IO, Mapping, Callable, - TypeVar, MutableMapping, - Type, - List, - Mapping, ) try: @@ -62,13 +39,13 @@ import xml.etree.ElementTree as ET import isodate # type: ignore +from typing_extensions import Self -from azure.core.exceptions import DeserializationError, SerializationError, raise_with_traceback -from azure.core.serialization import NULL as AzureCoreNull +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] @@ -91,6 +68,8 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: :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. + :return: The deserialized data. + :rtype: object """ if hasattr(data, "read"): # Assume a stream @@ -112,7 +91,7 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: try: return json.loads(data_as_str) except ValueError as err: - raise DeserializationError("JSON is invalid: {}".format(err), err) + raise DeserializationError("JSON is invalid: {}".format(err), err) from err elif "xml" in (content_type or []): try: @@ -124,7 +103,7 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: pass return ET.fromstring(data_as_str) # nosec - except ET.ParseError: + 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 @@ -143,7 +122,9 @@ def _json_attemp(data): # The function hack is because Py2.7 messes up with exception # context otherwise. _LOGGER.critical("Wasn't XML not JSON, failing") - raise_with_traceback(DeserializationError, "XML is invalid") + raise DeserializationError("XML is invalid") from err + elif content_type.startswith("text/"): + return data_as_str raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) @classmethod @@ -153,6 +134,11 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], Use bytes and headers to NOT use any requests/aiohttp or whatever specific implementation. Headers will tested for "content-type" + + :param bytes body_bytes: The body of the response. + :param dict headers: The headers of the response. + :returns: The deserialized data. + :rtype: object """ # Try to use content-type from headers if available content_type = None @@ -170,13 +156,6 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], return None -try: - basestring # type: ignore - unicode_str = unicode # type: ignore -except NameError: - basestring = str - unicode_str = str - _LOGGER = logging.getLogger(__name__) try: @@ -184,80 +163,31 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], 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 +TZ_UTC = datetime.timezone.utc _FLATTEN = re.compile(r"(? None: - self.additional_properties: Dict[str, Any] = {} - for k in kwargs: + self.additional_properties: Optional[dict[str, Any]] = {} + for k in kwargs: # pylint: disable=consider-using-dict-items 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): @@ -305,13 +242,23 @@ def __init__(self, **kwargs: Any) -> None: setattr(self, k, kwargs[k]) def __eq__(self, other: Any) -> bool: - """Compare objects by comparing all attributes.""" + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are equal + :rtype: bool + """ if isinstance(other, self.__class__): return self.__dict__ == other.__dict__ return False def __ne__(self, other: Any) -> bool: - """Compare objects by comparing all attributes.""" + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are not equal + :rtype: bool + """ return not self.__eq__(other) def __str__(self) -> str: @@ -331,7 +278,11 @@ def is_xml_model(cls) -> bool: @classmethod def _create_xml_node(cls): - """Create XML node.""" + """Create XML node. + + :returns: The XML node + :rtype: xml.etree.ElementTree.Element + """ try: xml_map = cls._xml_map # type: ignore except AttributeError: @@ -340,7 +291,7 @@ def _create_xml_node(cls): 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 azure from this model. + """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)`. @@ -351,12 +302,14 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: :rtype: dict """ serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, keep_readonly=keep_readonly, **kwargs + ) def as_dict( self, keep_readonly: bool = True, - key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + key_transformer: Callable[[str, dict[str, Any], Any], Any] = attribute_transformer, **kwargs: Any ) -> JSON: """Return a dict that can be serialized using json.dump. @@ -385,12 +338,15 @@ def my_key_transformer(key, attr_desc, value): 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 :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) + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs + ) @classmethod def _infer_class_models(cls): @@ -400,30 +356,31 @@ def _infer_class_models(cls): 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: + except Exception: # pylint: disable=broad-exception-caught # 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: + def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: """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 + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) - return deserializer(cls.__name__, data, content_type=content_type) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @classmethod def from_dict( - cls: Type[ModelType], + cls, data: Any, - key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + key_extractors: Optional[Callable[[str, dict[str, Any], Any], Any]] = None, content_type: Optional[str] = None, - ) -> ModelType: + ) -> Self: """Parse a dict using given key extractor return a model. By default consider key @@ -431,9 +388,11 @@ def from_dict( and last_rest_key_case_insensitive_extractor) :param dict data: A dict using RestAPI structure + :param function key_extractors: A key extractor function. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model - :raises: DeserializationError if something went wrong + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) deserializer.key_extractors = ( # type: ignore @@ -445,7 +404,7 @@ def from_dict( if key_extractors is None else key_extractors ) - return deserializer(cls.__name__, data, content_type=content_type) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @classmethod def _flatten_subtype(cls, key, objects): @@ -453,21 +412,25 @@ def _flatten_subtype(cls, key, objects): return {} result = dict(cls._subtype_map[key]) for valuetype in cls._subtype_map[key].values(): - result.update(objects[valuetype]._flatten_subtype(key, objects)) + result |= objects[valuetype]._flatten_subtype(key, objects) # pylint: disable=protected-access 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. + + :param dict response: The initial data + :param dict objects: The class objects + :returns: The class to be used + :rtype: class """ 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) + subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) else: subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) if subtype_value: @@ -506,11 +469,13 @@ def _decode_attribute_map_key(key): inside the received data. :param str key: A key string from the generated code + :returns: The decoded key + :rtype: str """ return key.replace("\\.", ".") -class Serializer(object): +class Serializer: # pylint: disable=too-many-public-methods """Request object model serializer.""" basic_types = {str: "str", int: "int", bool: "bool", float: "float"} @@ -545,7 +510,7 @@ class Serializer(object): "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -561,17 +526,20 @@ def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): "[]": self.serialize_iter, "{}": self.serialize_dict, } - self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} + 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): + def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals + self, target_obj, data_type=None, **kwargs + ): """Serialize data into a string according to type. - :param target_obj: The data to be serialized. + :param object 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. + :raises SerializationError: if serialization fails. + :returns: The serialized data. """ key_transformer = kwargs.get("key_transformer", self.key_transformer) keep_readonly = kwargs.get("keep_readonly", False) @@ -597,17 +565,19 @@ def _serialize(self, target_obj, data_type=None, **kwargs): serialized = {} if is_xml_model_serialization: - serialized = target_obj._create_xml_node() + serialized = target_obj._create_xml_node() # pylint: disable=protected-access try: - attributes = target_obj._attribute_map + attributes = target_obj._attribute_map # pylint: disable=protected-access for attr, attr_desc in attributes.items(): attr_name = attr - if not keep_readonly and target_obj._validation.get(attr_name, {}).get("readonly", False): + if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access + 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) + serialized |= target_obj.additional_properties continue try: @@ -638,7 +608,8 @@ def _serialize(self, target_obj, data_type=None, **kwargs): 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 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 @@ -649,7 +620,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs): else: # That's a basic type # Integrate namespace if necessary local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) - local_node.text = unicode_str(new_attr) + local_node.text = str(new_attr) serialized.append(local_node) # type: ignore else: # JSON for k in reversed(keys): # type: ignore @@ -662,23 +633,24 @@ def _serialize(self, target_obj, data_type=None, **kwargs): _serialized.update(_new_attr) # type: ignore _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] - except ValueError: - continue + 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_with_traceback(SerializationError, msg, err) - else: - return serialized + raise SerializationError(msg) from err + return serialized def body(self, data, data_type, **kwargs): """Serialize data intended for a request body. - :param data: The data to be serialized. + :param object 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 + :raises SerializationError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized request body """ # Just in case this is a dict @@ -707,20 +679,22 @@ def body(self, data, data_type, **kwargs): attribute_key_case_insensitive_extractor, last_rest_key_case_insensitive_extractor, ] - data = deserializer._deserialize(data_type, data) + data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access except DeserializationError as err: - raise_with_traceback(SerializationError, "Unable to build a model: " + str(err), 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 name: The name of the URL path parameter. + :param object 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 + :returns: The serialized URL path + :raises TypeError: if serialization fails. + :raises ValueError: if data is None """ try: output = self.serialize_data(data, data_type, **kwargs) @@ -729,30 +703,30 @@ def url(self, name, data, data_type, **kwargs): 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 + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + 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 name: The name of the query parameter. + :param object 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 + :rtype: str, list + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized query parameter """ 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] - data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data] - if not kwargs.get("skip_quote", False): - data = [quote(str(d), safe="") for d in data] - return str(self.serialize_iter(data, internal_data_type, **kwargs)) + 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) @@ -762,19 +736,20 @@ def query(self, name, data, data_type, **kwargs): output = str(output) else: output = quote(str(output), safe="") - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return str(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + 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 name: The name of the header. + :param object 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 + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized header """ try: if data_type in ["[str]"]: @@ -783,37 +758,36 @@ def header(self, name, data, data_type, **kwargs): 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) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + 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 object 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. + :raises AttributeError: if required data is None. + :raises ValueError: if data is None + :raises SerializationError: if serialization fails. + :returns: The serialized data. + :rtype: str, int, float, bool, dict, list """ if data is None: raise ValueError("No value for given attribute") try: - if data is AzureCoreNull: + 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: + if 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__) + enum_type = self.dependencies.get(data_type, cast(type, data.__class__)) if issubclass(enum_type, Enum): return Serializer.serialize_enum(data, enum_obj=enum_type) @@ -823,12 +797,11 @@ def serialize_data(self, data, data_type, **kwargs): except (ValueError, TypeError) as err: msg = "Unable to serialize value: {!r} as type: {!r}." - raise_with_traceback(SerializationError, msg.format(data, data_type), err) - else: - return self._serialize(data, **kwargs) + raise SerializationError(msg.format(data, data_type)) from err + return self._serialize(data, **kwargs) @classmethod - def _get_custom_serializers(cls, data_type, **kwargs): + def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) if custom_serializer: return custom_serializer @@ -844,23 +817,33 @@ def serialize_basic(cls, data, data_type, **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 obj data: Object to be serialized. :param str data_type: Type of object in the iterable. + :rtype: str, int, float, bool + :return: serialized object + :raises TypeError: raise if data_type is not one of str, int, float, bool. """ 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 + if data_type == "int": + return int(data) + if data_type == "float": + return float(data) + if data_type == "bool": + return bool(data) + raise TypeError("Unknown basic data type: {}".format(data_type)) @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. + :param str data: Object to be serialized. :rtype: str + :return: serialized object """ try: # If I received an enum, return its value return data.value @@ -874,8 +857,7 @@ def serialize_unicode(cls, data): return data except NameError: return str(data) - else: - return str(data) + return str(data) def serialize_iter(self, data, iter_type, div=None, **kwargs): """Serialize iterable. @@ -885,13 +867,13 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): 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 list data: 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'. + Defaults to False. :rtype: list, str + :return: serialized iterable """ if isinstance(data, str): raise SerializationError("Refuse str type as a valid iter type.") @@ -903,9 +885,14 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): for d in data: try: serialized.append(self.serialize_data(d, iter_type, **kwargs)) - except ValueError: + 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) @@ -941,16 +928,17 @@ def serialize_dict(self, attr, dict_type, **kwargs): :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 + :return: serialized dictionary """ 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: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized[self.serialize_unicode(key)] = None if "xml" in serialization_ctxt: @@ -965,7 +953,7 @@ def serialize_dict(self, attr, dict_type, **kwargs): return serialized - def serialize_object(self, attr, **kwargs): + def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements """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 @@ -973,6 +961,7 @@ def serialize_object(self, attr, **kwargs): :param dict attr: Object to be serialized. :rtype: dict or str + :return: serialized object """ if attr is None: return None @@ -983,7 +972,7 @@ def serialize_object(self, attr, **kwargs): 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 unicode_str: + if obj_type is str: return self.serialize_unicode(attr) if obj_type is datetime.datetime: return self.serialize_iso(attr) @@ -997,7 +986,7 @@ def serialize_object(self, attr, **kwargs): 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): + if obj_type in self.dependencies.values() or isinstance(attr, Model): return self._serialize(attr) if obj_type == dict: @@ -1028,56 +1017,61 @@ def serialize_enum(attr, enum_obj=None): try: enum_obj(result) # type: ignore return result - except ValueError: + except ValueError as exc: 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)) + raise SerializationError(error.format(attr, enum_obj)) from exc @staticmethod - def serialize_bytearray(attr, **kwargs): + def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument """Serialize bytearray into base-64 string. - :param attr: Object to be serialized. + :param str attr: Object to be serialized. :rtype: str + :return: serialized base64 """ return b64encode(attr).decode() @staticmethod - def serialize_base64(attr, **kwargs): + def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument """Serialize str into base-64 string. - :param attr: Object to be serialized. + :param str attr: Object to be serialized. :rtype: str + :return: serialized base64 """ encoded = b64encode(attr).decode("ascii") return encoded.strip("=").replace("+", "-").replace("/", "_") @staticmethod - def serialize_decimal(attr, **kwargs): + def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument """Serialize Decimal object to float. - :param attr: Object to be serialized. + :param decimal attr: Object to be serialized. :rtype: float + :return: serialized decimal """ return float(attr) @staticmethod - def serialize_long(attr, **kwargs): + def serialize_long(attr, **kwargs): # pylint: disable=unused-argument """Serialize long (Py2) or int (Py3). - :param attr: Object to be serialized. + :param int attr: Object to be serialized. :rtype: int/long + :return: serialized long """ return _long_type(attr) @staticmethod - def serialize_date(attr, **kwargs): + def serialize_date(attr, **kwargs): # pylint: disable=unused-argument """Serialize Date object into ISO-8601 formatted string. :param Date attr: Object to be serialized. :rtype: str + :return: serialized date """ if isinstance(attr, str): attr = isodate.parse_date(attr) @@ -1085,11 +1079,12 @@ def serialize_date(attr, **kwargs): return t @staticmethod - def serialize_time(attr, **kwargs): + def serialize_time(attr, **kwargs): # pylint: disable=unused-argument """Serialize Time object into ISO-8601 formatted string. :param datetime.time attr: Object to be serialized. :rtype: str + :return: serialized time """ if isinstance(attr, str): attr = isodate.parse_time(attr) @@ -1099,30 +1094,32 @@ def serialize_time(attr, **kwargs): return t @staticmethod - def serialize_duration(attr, **kwargs): + def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument """Serialize TimeDelta object into ISO-8601 formatted string. :param TimeDelta attr: Object to be serialized. :rtype: str + :return: serialized duration """ if isinstance(attr, str): attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) @staticmethod - def serialize_rfc(attr, **kwargs): + def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. :param Datetime attr: Object to be serialized. :rtype: str - :raises: TypeError if format invalid. + :raises TypeError: if format invalid. + :return: serialized rfc """ 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.") + except AttributeError as exc: + raise TypeError("RFC1123 object must be valid Datetime object.") from exc return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( Serializer.days[utc.tm_wday], @@ -1135,12 +1132,13 @@ def serialize_rfc(attr, **kwargs): ) @staticmethod - def serialize_iso(attr, **kwargs): + def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into ISO-8601 formatted string. :param Datetime attr: Object to be serialized. :rtype: str - :raises: SerializationError if format invalid. + :raises SerializationError: if format invalid. + :return: serialized iso """ if isinstance(attr, str): attr = isodate.parse_datetime(attr) @@ -1160,19 +1158,20 @@ def serialize_iso(attr, **kwargs): return date + microseconds + "Z" except (ValueError, OverflowError) as err: msg = "Unable to serialize datetime object." - raise_with_traceback(SerializationError, msg, err) + raise SerializationError(msg) from err except AttributeError as err: msg = "ISO-8601 object must be valid Datetime object." - raise_with_traceback(TypeError, msg, err) + raise TypeError(msg) from err @staticmethod - def serialize_unix(attr, **kwargs): + def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument """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 + :raises SerializationError: if format invalid + :return: serialied unix """ if isinstance(attr, int): return attr @@ -1180,17 +1179,17 @@ def serialize_unix(attr, **kwargs): 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.") + except AttributeError as exc: + raise TypeError("Unix time object must be valid Datetime object.") from exc -def rest_key_extractor(attr, attr_desc, data): +def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument 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)) + dict_keys = cast(list[str], _FLATTEN.split(key)) if len(dict_keys) == 1: key = _decode_attribute_map_key(dict_keys[0]) break @@ -1199,14 +1198,15 @@ def rest_key_extractor(attr, attr_desc, 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 - # https://github.com/Azure/msrest-for-python/issues/197 return None key = ".".join(dict_keys[1:]) return working_data.get(key) -def rest_key_case_insensitive_extractor(attr, attr_desc, data): +def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements + attr, attr_desc, data +): key = attr_desc["key"] working_data = data @@ -1220,7 +1220,6 @@ def rest_key_case_insensitive_extractor(attr, attr_desc, 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 - # https://github.com/Azure/msrest-for-python/issues/197 return None key = ".".join(dict_keys[1:]) @@ -1228,17 +1227,29 @@ def rest_key_case_insensitive_extractor(attr, attr_desc, 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.""" +def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ 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): +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument """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" + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute """ key = attr_desc["key"] dict_keys = _FLATTEN.split(key) @@ -1275,7 +1286,7 @@ def _extract_name_from_internal_type(internal_type): return xml_name -def xml_key_extractor(attr, attr_desc, data): +def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements if isinstance(data, dict): return None @@ -1327,22 +1338,21 @@ def xml_key_extractor(attr, attr_desc, data): if is_iter_type: if is_wrapped: return None # is_wrapped no node, we want None - else: - return [] # not wrapped, assume empty list + 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 - ) + # 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. + ) + 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: @@ -1350,7 +1360,7 @@ def xml_key_extractor(attr, attr_desc, data): return children[0] -class Deserializer(object): +class Deserializer: """Response object model deserializer. :param dict classes: Class type dictionary for deserializing complex types. @@ -1359,9 +1369,9 @@ class Deserializer(object): 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}]?") + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1381,7 +1391,7 @@ def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): "duration": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } - self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} + 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 @@ -1397,27 +1407,29 @@ def __call__(self, target_obj, response_data, content_type=None): :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. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. + :rtype: object """ data = self._unpack_content(response_data, content_type) return self._deserialize(target_obj, data) - def _deserialize(self, target_obj, data): + def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements """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. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. + :rtype: 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(): + for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access if attr in constants: continue value = getattr(data, attr) @@ -1434,15 +1446,15 @@ def _deserialize(self, target_obj, data): response, class_name = self._classify_target(target_obj, data) - if isinstance(response, basestring): + if isinstance(response, str): return self.deserialize_data(data, response) - elif isinstance(response, type) and issubclass(response, Enum): + if isinstance(response, type) and issubclass(response, Enum): return self.deserialize_enum(data, response) - if data is None: + if data is None or data is CoreNull: return data try: - attributes = response._attribute_map # type: ignore + attributes = response._attribute_map # type: ignore # pylint: disable=protected-access d_attrs = {} for attr, attr_desc in attributes.items(): # Check empty string. If it's not empty, someone has a real "additionalProperties"... @@ -1471,10 +1483,9 @@ def _deserialize(self, target_obj, data): d_attrs[attr] = value except (AttributeError, TypeError, KeyError) as err: msg = "Unable to deserialize to object: " + class_name # type: ignore - raise_with_traceback(DeserializationError, msg, err) - else: - additional_properties = self._build_additional_properties(attributes, data) - return self._instantiate_model(response, d_attrs, additional_properties) + raise DeserializationError(msg) from err + 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: @@ -1501,18 +1512,20 @@ def _classify_target(self, target, data): :param str target: The target object type to deserialize to. :param str/dict data: The response data to deserialize. + :return: The classified target object and its class name. + :rtype: tuple """ if target is None: return None, None - if isinstance(target, basestring): + if isinstance(target, str): try: target = self.dependencies[target] except KeyError: return target, target try: - target = target._classify(data, self.dependencies) + target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access except AttributeError: pass # Target is not a Model, no classify return target, target.__class__.__name__ # type: ignore @@ -1527,10 +1540,12 @@ def failsafe_deserialize(self, target_obj, data, content_type=None): :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. + :return: Deserialized object. + :rtype: object """ try: return self(target_obj, data, content_type=content_type) - except: + except: # pylint: disable=bare-except _LOGGER.debug( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) @@ -1548,10 +1563,12 @@ def _unpack_content(raw_data, content_type=None): 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. + :param obj raw_data: Data to be processed. + :param str 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 + :rtype: object + :return: Unpacked content. """ # Assume this is enough to detect a Pipeline Response without importing it context = getattr(raw_data, "context", {}) @@ -1568,31 +1585,42 @@ def _unpack_content(raw_data, content_type=None): if hasattr(raw_data, "_content_consumed"): return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) - if isinstance(raw_data, (basestring, bytes)) or hasattr(raw_data, "read"): + 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. + :param Response response: The response model class. + :param dict attrs: The deserialized response attributes. + :param dict additional_properties: Additional properties to be set. + :rtype: Response + :return: The instantiated response model. """ 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")] + readonly = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("readonly") + ] + const = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + 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 + response_obj.additional_properties = additional_properties # type: ignore return response_obj except TypeError as err: msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore - raise DeserializationError(msg + str(err)) + raise DeserializationError(msg + str(err)) from err else: try: for attr, value in attrs.items(): @@ -1601,15 +1629,16 @@ def _instantiate_model(self, response, attrs, additional_properties=None): except Exception as exp: msg = "Unable to populate response model. " msg += "Type: {}, Error: {}".format(type(response), exp) - raise DeserializationError(msg) + raise DeserializationError(msg) from exp - def deserialize_data(self, data, data_type): + def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements """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. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. + :rtype: object """ if data is None: return data @@ -1623,7 +1652,11 @@ def deserialize_data(self, data, data_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"{}"] + is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment + "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) @@ -1642,15 +1675,15 @@ def deserialize_data(self, data, data_type): except (ValueError, TypeError, AttributeError) as err: msg = "Unable to deserialize response data." msg += " Data: {}, {}".format(data, data_type) - raise_with_traceback(DeserializationError, msg, err) - else: - return self._deserialize(obj_type, data) + raise DeserializationError(msg) from err + 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. + :return: Deserialized iterable. :rtype: list """ if attr is None: @@ -1667,6 +1700,7 @@ def deserialize_dict(self, attr, dict_type): :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. + :return: Deserialized dictionary. :rtype: dict """ if isinstance(attr, list): @@ -1677,20 +1711,21 @@ def deserialize_dict(self, attr, dict_type): 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): + def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements """Deserialize a generic object. This will be handled as a dictionary. :param dict attr: Dictionary to be deserialized. + :return: Deserialized object. :rtype: dict - :raises: TypeError if non-builtin datatype encountered. + :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, basestring): + if isinstance(attr, str): return self.deserialize_basic(attr, "str") obj_type = type(attr) if obj_type in self.basic_types: @@ -1716,11 +1751,10 @@ def deserialize_object(self, attr, **kwargs): pass return deserialized - else: - error = "Cannot deserialize generic object with type: " - raise TypeError(error + str(obj_type)) + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) - def deserialize_basic(self, attr, data_type): + def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements """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 @@ -1728,8 +1762,9 @@ def deserialize_basic(self, attr, data_type): :param str attr: response string to be deserialized. :param str data_type: deserialization data type. + :return: Deserialized basic type. :rtype: str, int, float or bool - :raises: TypeError if string format is not valid. + :raises TypeError: if string format is not valid or data_type is not one of str, int, float, bool. """ # If we're here, data is supposed to be a basic type. # If it's still an XML node, take the text @@ -1739,24 +1774,27 @@ def deserialize_basic(self, attr, data_type): 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 + # 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, basestring): + if isinstance(attr, str): if attr.lower() in ["true", "1"]: return True - elif attr.lower() in ["false", "0"]: + if 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 + if data_type == "int": + return int(attr) + if data_type == "float": + return float(attr) + raise TypeError("Unknown basic data type: {}".format(data_type)) @staticmethod def deserialize_unicode(data): @@ -1764,6 +1802,7 @@ def deserialize_unicode(data): as a string. :param str data: response string to be deserialized. + :return: Deserialized string. :rtype: str or unicode """ # We might be here because we have an enum modeled as string, @@ -1777,8 +1816,7 @@ def deserialize_unicode(data): return data except NameError: return str(data) - else: - return str(data) + return str(data) @staticmethod def deserialize_enum(data, enum_obj): @@ -1790,6 +1828,7 @@ def deserialize_enum(data, enum_obj): :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. + :return: Deserialized enum object. :rtype: Enum """ if isinstance(data, enum_obj) or data is None: @@ -1798,12 +1837,11 @@ def deserialize_enum(data, enum_obj): data = data.value if isinstance(data, int): # Workaround. We might consider remove it in the future. - # https://github.com/Azure/azure-rest-api-specs/issues/141 try: return list(enum_obj.__members__.values())[data] - except IndexError: + except IndexError as exc: error = "{!r} is not a valid index for enum {!r}" - raise DeserializationError(error.format(data, enum_obj)) + raise DeserializationError(error.format(data, enum_obj)) from exc try: return enum_obj(str(data)) except ValueError: @@ -1819,8 +1857,9 @@ def deserialize_bytearray(attr): """Deserialize string into bytearray. :param str attr: response string to be deserialized. + :return: Deserialized bytearray :rtype: bytearray - :raises: TypeError if string format invalid. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1831,8 +1870,9 @@ def deserialize_base64(attr): """Deserialize base64 encoded string into string. :param str attr: response string to be deserialized. + :return: Deserialized base64 string :rtype: bytearray - :raises: TypeError if string format invalid. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1846,24 +1886,26 @@ 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. + :return: Deserialized decimal + :raises DeserializationError: if string format invalid. + :rtype: decimal """ if isinstance(attr, ET.Element): attr = attr.text try: - return decimal.Decimal(attr) # type: ignore + return decimal.Decimal(str(attr)) # type: ignore except decimal.DecimalException as err: msg = "Invalid decimal {}".format(attr) - raise_with_traceback(DeserializationError, msg, err) + 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. + :return: Deserialized int :rtype: long or int - :raises: ValueError if string format invalid. + :raises ValueError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1874,8 +1916,9 @@ def deserialize_duration(attr): """Deserialize ISO-8601 formatted string into TimeDelta object. :param str attr: response string to be deserialized. + :return: Deserialized duration :rtype: TimeDelta - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1883,32 +1926,33 @@ def deserialize_duration(attr): duration = isodate.parse_duration(attr) except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize duration object." - raise_with_traceback(DeserializationError, msg, err) - else: - return duration + raise DeserializationError(msg) from err + return duration @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. :param str attr: response string to be deserialized. + :return: Deserialized date :rtype: Date - :raises: DeserializationError if string format invalid. + :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=None, defaultday=None) + 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. + :return: Deserialized time :rtype: datetime.time - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1921,31 +1965,32 @@ def deserialize_rfc(attr): """Deserialize RFC-1123 formatted string into Datetime object. :param str attr: response string to be deserialized. + :return: Deserialized RFC datetime :rtype: Datetime - :raises: DeserializationError if string format invalid. + :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)) + *parsed_date[:6], tzinfo=datetime.timezone(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_with_traceback(DeserializationError, msg, err) - else: - return date_obj + raise DeserializationError(msg) from err + return date_obj @staticmethod def deserialize_iso(attr): """Deserialize ISO-8601 formatted string into Datetime object. :param str attr: response string to be deserialized. + :return: Deserialized ISO datetime :rtype: Datetime - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1972,9 +2017,8 @@ def deserialize_iso(attr): raise OverflowError("Hit max or min date") except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize datetime object." - raise_with_traceback(DeserializationError, msg, err) - else: - return date_obj + raise DeserializationError(msg) from err + return date_obj @staticmethod def deserialize_unix(attr): @@ -1982,15 +2026,16 @@ def deserialize_unix(attr): This is represented as seconds. :param int attr: Object to be serialized. + :return: Deserialized datetime :rtype: Datetime - :raises: DeserializationError if format invalid + :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_with_traceback(DeserializationError, msg, err) - else: - return date_obj + raise DeserializationError(msg) from err + return date_obj diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_validation.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_validation.py new file mode 100644 index 000000000000..f5af3a4eb8a2 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_validation.py @@ -0,0 +1,66 @@ +# -------------------------------------------------------------------------- +# 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_added_on = kwargs.pop("params_added_on", {}) + method_added_on = kwargs.pop("method_added_on", "") + api_versions_list = kwargs.pop("api_versions_list", []) + + def _index_with_default(value: str, default: int = -1) -> int: + """Get the index of value in lst, or return default if not found. + + :param value: The value to search for in the api_versions_list. + :type value: str + :param default: The default value to return if the value is not found. + :type default: int + :return: The index of the value in the list, or the default value if not found. + :rtype: int + """ + try: + return api_versions_list.index(value) + except ValueError: + return default + + def decorator(func): + @functools.wraps(func) + def wrapper(*args, **kwargs): + try: + # this assumes the client has an _api_version attribute + client = args[0] + client_api_version = client._config.api_version # pylint: disable=protected-access + except AttributeError: + return func(*args, **kwargs) + + if _index_with_default(method_added_on) > _index_with_default(client_api_version): + raise ValueError( + f"'{func.__name__}' is not available in API version " + f"{client_api_version}. Pass service API version {method_added_on} or newer to your client." + ) + + unsupported = { + parameter: api_version + for api_version, parameters in params_added_on.items() + for parameter in parameters + if parameter in kwargs and _index_with_default(api_version) > _index_with_default(client_api_version) + } + if unsupported: + raise ValueError( + "".join( + [ + f"'{param}' is not available in API version {client_api_version}. " + f"Use service API version {version} or newer.\n" + for param, version in unsupported.items() + ] + ) + ) + return func(*args, **kwargs) + + return wrapper + + return decorator diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_vendor.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_vendor.py deleted file mode 100644 index bd0df84f5319..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_vendor.py +++ /dev/null @@ -1,30 +0,0 @@ -# -------------------------------------------------------------------------- -# 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 List, cast - -from azure.core.pipeline.transport import HttpRequest - - -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 - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_version.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_version.py index c47f66669f1b..8f2350dd3b0c 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_version.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/_version.py @@ -2,8 +2,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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0" +VERSION = "2.0.0" diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/__init__.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/__init__.py index 2405f998680b..c79eaaeef4e8 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/__init__.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/__init__.py @@ -2,22 +2,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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._managed_network_fabric_mgmt_client import ManagedNetworkFabricMgmtClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import ManagedNetworkFabricClient # type: ignore try: from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import + from ._patch import * except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk __all__ = [ - "ManagedNetworkFabricMgmtClient", + "ManagedNetworkFabricClient", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/_managed_network_fabric_mgmt_client.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/_client.py similarity index 70% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/_managed_network_fabric_mgmt_client.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/_client.py index 5cee3cd0fbc7..5f2f5c0538ed 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/_managed_network_fabric_mgmt_client.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/_client.py @@ -2,19 +2,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 Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python 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 typing import Any, Awaitable, Optional, TYPE_CHECKING, cast +from typing_extensions import Self +from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.settings import settings from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints -from .. import models as _models -from .._serialization import Deserializer, Serializer -from ._configuration import ManagedNetworkFabricMgmtClientConfiguration +from .._utils.serialization import Deserializer, Serializer +from ._configuration import ManagedNetworkFabricClientConfiguration from .operations import ( AccessControlListsOperations, ExternalNetworksOperations, @@ -27,12 +31,15 @@ L2IsolationDomainsOperations, L3IsolationDomainsOperations, NeighborGroupsOperations, + NetworkBootstrapDevicesOperations, + NetworkBootstrapInterfacesOperations, NetworkDeviceSkusOperations, NetworkDevicesOperations, NetworkFabricControllersOperations, NetworkFabricSkusOperations, NetworkFabricsOperations, NetworkInterfacesOperations, + NetworkMonitorsOperations, NetworkPacketBrokersOperations, NetworkRacksOperations, NetworkTapRulesOperations, @@ -43,22 +50,24 @@ ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports + from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential -class ManagedNetworkFabricMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes +class ManagedNetworkFabricClient: # pylint: disable=too-many-instance-attributes """Self service experience for Azure Network Fabric API. + :ivar operations: Operations operations + :vartype operations: azure.mgmt.managednetworkfabric.aio.operations.Operations :ivar access_control_lists: AccessControlListsOperations operations :vartype access_control_lists: azure.mgmt.managednetworkfabric.aio.operations.AccessControlListsOperations - :ivar internet_gateways: InternetGatewaysOperations operations - :vartype internet_gateways: - azure.mgmt.managednetworkfabric.aio.operations.InternetGatewaysOperations :ivar internet_gateway_rules: InternetGatewayRulesOperations operations :vartype internet_gateway_rules: azure.mgmt.managednetworkfabric.aio.operations.InternetGatewayRulesOperations + :ivar internet_gateways: InternetGatewaysOperations operations + :vartype internet_gateways: + azure.mgmt.managednetworkfabric.aio.operations.InternetGatewaysOperations :ivar ip_communities: IpCommunitiesOperations operations :vartype ip_communities: azure.mgmt.managednetworkfabric.aio.operations.IpCommunitiesOperations :ivar ip_extended_communities: IpExtendedCommunitiesOperations operations @@ -112,18 +121,29 @@ class ManagedNetworkFabricMgmtClient: # pylint: disable=client-accepts-api-vers azure.mgmt.managednetworkfabric.aio.operations.NetworkTapRulesOperations :ivar network_taps: NetworkTapsOperations operations :vartype network_taps: azure.mgmt.managednetworkfabric.aio.operations.NetworkTapsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.managednetworkfabric.aio.operations.Operations :ivar route_policies: RoutePoliciesOperations operations :vartype route_policies: azure.mgmt.managednetworkfabric.aio.operations.RoutePoliciesOperations - :param credential: Credential needed for the client to connect to Azure. Required. + :ivar network_monitors: NetworkMonitorsOperations operations + :vartype network_monitors: + azure.mgmt.managednetworkfabric.aio.operations.NetworkMonitorsOperations + :ivar network_bootstrap_devices: NetworkBootstrapDevicesOperations operations + :vartype network_bootstrap_devices: + azure.mgmt.managednetworkfabric.aio.operations.NetworkBootstrapDevicesOperations + :ivar network_bootstrap_interfaces: NetworkBootstrapInterfacesOperations operations + :vartype network_bootstrap_interfaces: + azure.mgmt.managednetworkfabric.aio.operations.NetworkBootstrapInterfacesOperations + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". + :param base_url: Service host. Default value is None. :type base_url: str - :keyword api_version: Api Version. Default value is "2023-06-15". Note that overriding this - default value may result in unsupported behavior. + :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :paramtype cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are "2025-07-15". + Default value is "2025-07-15". Note that overriding this default value may result in + unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -133,25 +153,59 @@ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, - base_url: str = "https://management.azure.com", + base_url: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - self._config = ManagedNetworkFabricMgmtClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs + _endpoint = "{endpoint}" + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) + self._config = ManagedNetworkFabricClientConfiguration( + credential=credential, + subscription_id=subscription_id, + base_url=cast(str, base_url), + cloud_setting=cloud_setting, + credential_scopes=credential_scopes, + **kwargs ) - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **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) + _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=cast(str, _endpoint), policies=_policies, **kwargs + ) + + self._serialize = Serializer() + self._deserialize = Deserializer() self._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.access_control_lists = AccessControlListsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.internet_gateways = InternetGatewaysOperations( + self.internet_gateway_rules = InternetGatewayRulesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.internet_gateway_rules = InternetGatewayRulesOperations( + self.internet_gateways = InternetGatewaysOperations( self._client, self._config, self._serialize, self._deserialize ) self.ip_communities = IpCommunitiesOperations(self._client, self._config, self._serialize, self._deserialize) @@ -197,16 +251,26 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.network_taps = NetworkTapsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.route_policies = RoutePoliciesOperations(self._client, self._config, self._serialize, self._deserialize) + self.network_monitors = NetworkMonitorsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.network_bootstrap_devices = NetworkBootstrapDevicesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.network_bootstrap_interfaces = NetworkBootstrapInterfacesOperations( + self._client, self._config, self._serialize, self._deserialize + ) - def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: + 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) + >>> response = await client.send_request(request) For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request @@ -219,13 +283,17 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncH """ request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + 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) -> "ManagedNetworkFabricMgmtClient": + async def __aenter__(self) -> Self: await self._client.__aenter__() return self diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/_configuration.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/_configuration.py index fc0c8409b6a9..1955f14279ba 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/_configuration.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/_configuration.py @@ -2,41 +2,52 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING -from azure.core.configuration import Configuration 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 import AzureClouds from azure.core.credentials_async import AsyncTokenCredential -class ManagedNetworkFabricMgmtClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for ManagedNetworkFabricMgmtClient. +class ManagedNetworkFabricClientConfiguration: # pylint: disable=too-many-instance-attributes + """Configuration for ManagedNetworkFabricClient. 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. + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2023-06-15". Note that overriding this - default value may result in unsupported behavior. + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str + :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :type cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are "2025-07-15". + Default value is "2025-07-15". Note that overriding this default value may result in + unsupported behavior. :paramtype api_version: str """ - def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(ManagedNetworkFabricMgmtClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2023-06-15") + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any + ) -> None: + api_version: str = kwargs.pop("api_version", "2025-07-15") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -45,9 +56,12 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.credential = credential self.subscription_id = subscription_id + self.base_url = base_url + self.cloud_setting = cloud_setting self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-managednetworkfabric/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: @@ -56,9 +70,9 @@ def _configure(self, **kwargs: Any) -> None: 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.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**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( diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/_patch.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/_patch.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """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 + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/__init__.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/__init__.py index 95b33173ed4b..6f98a0dd5ad0 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/__init__.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/__init__.py @@ -2,43 +2,53 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._access_control_lists_operations import AccessControlListsOperations -from ._internet_gateways_operations import InternetGatewaysOperations -from ._internet_gateway_rules_operations import InternetGatewayRulesOperations -from ._ip_communities_operations import IpCommunitiesOperations -from ._ip_extended_communities_operations import IpExtendedCommunitiesOperations -from ._ip_prefixes_operations import IpPrefixesOperations -from ._l2_isolation_domains_operations import L2IsolationDomainsOperations -from ._l3_isolation_domains_operations import L3IsolationDomainsOperations -from ._internal_networks_operations import InternalNetworksOperations -from ._external_networks_operations import ExternalNetworksOperations -from ._neighbor_groups_operations import NeighborGroupsOperations -from ._network_device_skus_operations import NetworkDeviceSkusOperations -from ._network_devices_operations import NetworkDevicesOperations -from ._network_interfaces_operations import NetworkInterfacesOperations -from ._network_fabric_controllers_operations import NetworkFabricControllersOperations -from ._network_fabric_skus_operations import NetworkFabricSkusOperations -from ._network_fabrics_operations import NetworkFabricsOperations -from ._network_to_network_interconnects_operations import NetworkToNetworkInterconnectsOperations -from ._network_packet_brokers_operations import NetworkPacketBrokersOperations -from ._network_racks_operations import NetworkRacksOperations -from ._network_tap_rules_operations import NetworkTapRulesOperations -from ._network_taps_operations import NetworkTapsOperations -from ._operations import Operations -from ._route_policies_operations import RoutePoliciesOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import Operations # type: ignore +from ._operations import AccessControlListsOperations # type: ignore +from ._operations import InternetGatewayRulesOperations # type: ignore +from ._operations import InternetGatewaysOperations # type: ignore +from ._operations import IpCommunitiesOperations # type: ignore +from ._operations import IpExtendedCommunitiesOperations # type: ignore +from ._operations import IpPrefixesOperations # type: ignore +from ._operations import L2IsolationDomainsOperations # type: ignore +from ._operations import L3IsolationDomainsOperations # type: ignore +from ._operations import InternalNetworksOperations # type: ignore +from ._operations import ExternalNetworksOperations # type: ignore +from ._operations import NeighborGroupsOperations # type: ignore +from ._operations import NetworkDeviceSkusOperations # type: ignore +from ._operations import NetworkDevicesOperations # type: ignore +from ._operations import NetworkInterfacesOperations # type: ignore +from ._operations import NetworkFabricControllersOperations # type: ignore +from ._operations import NetworkFabricSkusOperations # type: ignore +from ._operations import NetworkFabricsOperations # type: ignore +from ._operations import NetworkToNetworkInterconnectsOperations # type: ignore +from ._operations import NetworkPacketBrokersOperations # type: ignore +from ._operations import NetworkRacksOperations # type: ignore +from ._operations import NetworkTapRulesOperations # type: ignore +from ._operations import NetworkTapsOperations # type: ignore +from ._operations import RoutePoliciesOperations # type: ignore +from ._operations import NetworkMonitorsOperations # type: ignore +from ._operations import NetworkBootstrapDevicesOperations # type: ignore +from ._operations import NetworkBootstrapInterfacesOperations # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ + "Operations", "AccessControlListsOperations", - "InternetGatewaysOperations", "InternetGatewayRulesOperations", + "InternetGatewaysOperations", "IpCommunitiesOperations", "IpExtendedCommunitiesOperations", "IpPrefixesOperations", @@ -58,8 +68,10 @@ "NetworkRacksOperations", "NetworkTapRulesOperations", "NetworkTapsOperations", - "Operations", "RoutePoliciesOperations", + "NetworkMonitorsOperations", + "NetworkBootstrapDevicesOperations", + "NetworkBootstrapInterfacesOperations", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_access_control_lists_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_access_control_lists_operations.py deleted file mode 100644 index 95d46a938dfa..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_access_control_lists_operations.py +++ /dev/null @@ -1,1422 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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._access_control_lists_operations import ( - build_create_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_resync_request, - build_update_administrative_state_request, - build_update_request, - build_validate_configuration_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class AccessControlListsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricMgmtClient`'s - :attr:`access_control_lists` 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") - - async def _create_initial( - self, - resource_group_name: str, - access_control_list_name: str, - body: Union[_models.AccessControlList, IO], - **kwargs: Any - ) -> _models.AccessControlList: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AccessControlList] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "AccessControlList") - - request = build_create_request( - resource_group_name=resource_group_name, - access_control_list_name=access_control_list_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AccessControlList", pipeline_response) - - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = self._deserialize("AccessControlList", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}" - } - - @overload - async def begin_create( - self, - resource_group_name: str, - access_control_list_name: str, - body: _models.AccessControlList, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AccessControlList]: - """Creates Access Control List. - - Implements Access Control List PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param access_control_list_name: Name of the Access Control List. Required. - :type access_control_list_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.AccessControlList - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either AccessControlList or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.AccessControlList] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - access_control_list_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AccessControlList]: - """Creates Access Control List. - - Implements Access Control List PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param access_control_list_name: Name of the Access Control List. Required. - :type access_control_list_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either AccessControlList or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.AccessControlList] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - access_control_list_name: str, - body: Union[_models.AccessControlList, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.AccessControlList]: - """Creates Access Control List. - - Implements Access Control List PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param access_control_list_name: Name of the Access Control List. Required. - :type access_control_list_name: str - :param body: Request payload. Is either a AccessControlList type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.AccessControlList or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either AccessControlList or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.AccessControlList] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AccessControlList] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - access_control_list_name=access_control_list_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AccessControlList", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}" - } - - @distributed_trace_async - async def get( - self, resource_group_name: str, access_control_list_name: str, **kwargs: Any - ) -> _models.AccessControlList: - """Gets a Access Control List. - - Implements Access Control List GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param access_control_list_name: Name of the Access Control List. Required. - :type access_control_list_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AccessControlList or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.AccessControlList - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AccessControlList] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - access_control_list_name=access_control_list_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("AccessControlList", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}" - } - - async def _update_initial( - self, - resource_group_name: str, - access_control_list_name: str, - body: Union[_models.AccessControlListPatch, IO], - **kwargs: Any - ) -> Optional[_models.AccessControlList]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.AccessControlList]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "AccessControlListPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - access_control_list_name=access_control_list_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AccessControlList", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}" - } - - @overload - async def begin_update( - self, - resource_group_name: str, - access_control_list_name: str, - body: _models.AccessControlListPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AccessControlList]: - """Updates the Access Control List. - - API to update certain properties of the Access Control List resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param access_control_list_name: Name of the Access Control List. Required. - :type access_control_list_name: str - :param body: Access Control List properties to update. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.AccessControlListPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either AccessControlList or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.AccessControlList] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - access_control_list_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AccessControlList]: - """Updates the Access Control List. - - API to update certain properties of the Access Control List resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param access_control_list_name: Name of the Access Control List. Required. - :type access_control_list_name: str - :param body: Access Control List properties to update. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either AccessControlList or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.AccessControlList] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - access_control_list_name: str, - body: Union[_models.AccessControlListPatch, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.AccessControlList]: - """Updates the Access Control List. - - API to update certain properties of the Access Control List resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param access_control_list_name: Name of the Access Control List. Required. - :type access_control_list_name: str - :param body: Access Control List properties to update. Is either a AccessControlListPatch type - or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.AccessControlListPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either AccessControlList or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.AccessControlList] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AccessControlList] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - access_control_list_name=access_control_list_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AccessControlList", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, access_control_list_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - access_control_list_name=access_control_list_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = 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) - - 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) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}" - } - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, access_control_list_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a Access Control List. - - Implements Access Control List DELETE method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param access_control_list_name: Name of the Access Control List. Required. - :type access_control_list_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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, - access_control_list_name=access_control_list_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}" - } - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.AccessControlList"]: - """List AccessControlLists by resource group. - - Implements AccessControlLists list by resource group GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AccessControlList or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.AccessControlList] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AccessControlListsListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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("AccessControlListsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.AccessControlList"]: - """List AccessControlLists by subscription. - - Implements AccessControlLists list by subscription GET method. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AccessControlList or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.AccessControlList] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AccessControlListsListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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("AccessControlListsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/accessControlLists" - } - - async def _update_administrative_state_initial( - self, - resource_group_name: str, - access_control_list_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_administrative_state_request( - resource_group_name=resource_group_name, - access_control_list_name=access_control_list_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_administrative_state_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_administrative_state_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}/updateAdministrativeState" - } - - @overload - async def begin_update_administrative_state( - self, - resource_group_name: str, - access_control_list_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Updates administrative state of Access Control Lists. - - Implements the operation to the underlying resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param access_control_list_name: Name of the Access Control List. Required. - :type access_control_list_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update_administrative_state( - self, - resource_group_name: str, - access_control_list_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Updates administrative state of Access Control Lists. - - Implements the operation to the underlying resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param access_control_list_name: Name of the Access Control List. Required. - :type access_control_list_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update_administrative_state( - self, - resource_group_name: str, - access_control_list_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Updates administrative state of Access Control Lists. - - Implements the operation to the underlying resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param access_control_list_name: Name of the Access Control List. Required. - :type access_control_list_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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_administrative_state_initial( - resource_group_name=resource_group_name, - access_control_list_name=access_control_list_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_administrative_state.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}/updateAdministrativeState" - } - - async def _resync_initial( - self, resource_group_name: str, access_control_list_name: str, **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - request = build_resync_request( - resource_group_name=resource_group_name, - access_control_list_name=access_control_list_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._resync_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _resync_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}/resync" - } - - @distributed_trace_async - async def begin_resync( - self, resource_group_name: str, access_control_list_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Resync operation on the Access Control Lists. - - Implements the operation to the underlying resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param access_control_list_name: Name of the Access Control List. Required. - :type access_control_list_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._resync_initial( - resource_group_name=resource_group_name, - access_control_list_name=access_control_list_name, - api_version=api_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("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_resync.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}/resync" - } - - async def _validate_configuration_initial( - self, resource_group_name: str, access_control_list_name: str, **kwargs: Any - ) -> _models.ValidateConfigurationResponse: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ValidateConfigurationResponse] = kwargs.pop("cls", None) - - request = build_validate_configuration_request( - resource_group_name=resource_group_name, - access_control_list_name=access_control_list_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._validate_configuration_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _validate_configuration_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}/validateConfiguration" - } - - @distributed_trace_async - async def begin_validate_configuration( - self, resource_group_name: str, access_control_list_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.ValidateConfigurationResponse]: - """Validates the configuration of the Access Control Lists. - - Implements the operation to the underlying resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param access_control_list_name: Name of the Access Control List. Required. - :type access_control_list_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ValidateConfigurationResponse or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ValidateConfigurationResponse] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._validate_configuration_initial( - resource_group_name=resource_group_name, - access_control_list_name=access_control_list_name, - api_version=api_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("ValidateConfigurationResponse", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}/validateConfiguration" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_external_networks_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_external_networks_operations.py deleted file mode 100644 index 008b27054faf..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_external_networks_operations.py +++ /dev/null @@ -1,1359 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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._external_networks_operations import ( - build_create_request, - build_delete_request, - build_get_request, - build_list_by_l3_isolation_domain_request, - build_update_administrative_state_request, - build_update_request, - build_update_static_route_bfd_administrative_state_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ExternalNetworksOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricMgmtClient`'s - :attr:`external_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") - - async def _create_initial( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: Union[_models.ExternalNetwork, IO], - **kwargs: Any - ) -> _models.ExternalNetwork: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ExternalNetwork] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "ExternalNetwork") - - request = build_create_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - external_network_name=external_network_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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("ExternalNetwork", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("ExternalNetwork", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}" - } - - @overload - async def begin_create( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: _models.ExternalNetwork, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ExternalNetwork]: - """Creates ExternalNetwork for Layer3 Isolation Domain for communication of computes with external - services. - - Creates ExternalNetwork PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param external_network_name: Name of the External Network. Required. - :type external_network_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.ExternalNetwork - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ExternalNetwork or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ExternalNetwork]: - """Creates ExternalNetwork for Layer3 Isolation Domain for communication of computes with external - services. - - Creates ExternalNetwork PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param external_network_name: Name of the External Network. Required. - :type external_network_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ExternalNetwork or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: Union[_models.ExternalNetwork, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.ExternalNetwork]: - """Creates ExternalNetwork for Layer3 Isolation Domain for communication of computes with external - services. - - Creates ExternalNetwork PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param external_network_name: Name of the External Network. Required. - :type external_network_name: str - :param body: Request payload. Is either a ExternalNetwork type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.ExternalNetwork or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ExternalNetwork or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ExternalNetwork] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - l3_isolation_domain_name=l3_isolation_domain_name, - external_network_name=external_network_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ExternalNetwork", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}" - } - - @distributed_trace_async - async def get( - self, resource_group_name: str, l3_isolation_domain_name: str, external_network_name: str, **kwargs: Any - ) -> _models.ExternalNetwork: - """Retrieves details of ExternalNetwork. - - Implements ExternalNetworks GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param external_network_name: Name of the External Network. Required. - :type external_network_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ExternalNetwork or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.ExternalNetwork - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ExternalNetwork] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - external_network_name=external_network_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("ExternalNetwork", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}" - } - - async def _update_initial( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: Union[_models.ExternalNetworkPatch, IO], - **kwargs: Any - ) -> Optional[_models.ExternalNetwork]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.ExternalNetwork]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "ExternalNetworkPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - external_network_name=external_network_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("ExternalNetwork", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}" - } - - @overload - async def begin_update( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: _models.ExternalNetworkPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ExternalNetwork]: - """Updates a External Networks. - - API to update certain properties of the ExternalNetworks resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param external_network_name: Name of the External Network. Required. - :type external_network_name: str - :param body: ExternalNetwork properties to update. Only annotations are supported. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.ExternalNetworkPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ExternalNetwork or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ExternalNetwork]: - """Updates a External Networks. - - API to update certain properties of the ExternalNetworks resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param external_network_name: Name of the External Network. Required. - :type external_network_name: str - :param body: ExternalNetwork properties to update. Only annotations are supported. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ExternalNetwork or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: Union[_models.ExternalNetworkPatch, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.ExternalNetwork]: - """Updates a External Networks. - - API to update certain properties of the ExternalNetworks resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param external_network_name: Name of the External Network. Required. - :type external_network_name: str - :param body: ExternalNetwork properties to update. Only annotations are supported. Is either a - ExternalNetworkPatch type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.ExternalNetworkPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ExternalNetwork or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ExternalNetwork] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - l3_isolation_domain_name=l3_isolation_domain_name, - external_network_name=external_network_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ExternalNetwork", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, l3_isolation_domain_name: str, external_network_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - external_network_name=external_network_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}" - } - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, l3_isolation_domain_name: str, external_network_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a ExternalNetworks. - - Implements ExternalNetworks DELETE method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param external_network_name: Name of the External Network. Required. - :type external_network_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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, - l3_isolation_domain_name=l3_isolation_domain_name, - external_network_name=external_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, {}) - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}" - } - - @distributed_trace - def list_by_l3_isolation_domain( - self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any - ) -> AsyncIterable["_models.ExternalNetwork"]: - """Executes list operation to display External Networks within an isolation domain. - - Implements External Networks list by resource group GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ExternalNetwork or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ExternalNetworksList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_l3_isolation_domain_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_l3_isolation_domain.metadata["url"], - 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._config.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("ExternalNetworksList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_l3_isolation_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks" - } - - async def _update_administrative_state_initial( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_administrative_state_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - external_network_name=external_network_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_administrative_state_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_administrative_state_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}/updateAdministrativeState" - } - - @overload - async def begin_update_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Executes update operation to enable or disable administrative State for externalNetwork. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param external_network_name: Name of the External Network. Required. - :type external_network_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Executes update operation to enable or disable administrative State for externalNetwork. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param external_network_name: Name of the External Network. Required. - :type external_network_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Executes update operation to enable or disable administrative State for externalNetwork. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param external_network_name: Name of the External Network. Required. - :type external_network_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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_administrative_state_initial( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - external_network_name=external_network_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_administrative_state.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}/updateAdministrativeState" - } - - async def _update_static_route_bfd_administrative_state_initial( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_static_route_bfd_administrative_state_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - external_network_name=external_network_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_static_route_bfd_administrative_state_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_static_route_bfd_administrative_state_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}/updateStaticRouteBfdAdministrativeState" - } - - @overload - async def begin_update_static_route_bfd_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Executes Static Route BFD state update operation to the underlying resources. - - Update Static Route BFD for external Network. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param external_network_name: Name of the External Network. Required. - :type external_network_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update_static_route_bfd_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Executes Static Route BFD state update operation to the underlying resources. - - Update Static Route BFD for external Network. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param external_network_name: Name of the External Network. Required. - :type external_network_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update_static_route_bfd_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Executes Static Route BFD state update operation to the underlying resources. - - Update Static Route BFD for external Network. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param external_network_name: Name of the External Network. Required. - :type external_network_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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_static_route_bfd_administrative_state_initial( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - external_network_name=external_network_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_static_route_bfd_administrative_state.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}/updateStaticRouteBfdAdministrativeState" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_internal_networks_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_internal_networks_operations.py deleted file mode 100644 index 41301f0e7969..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_internal_networks_operations.py +++ /dev/null @@ -1,1612 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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._internal_networks_operations import ( - build_create_request, - build_delete_request, - build_get_request, - build_list_by_l3_isolation_domain_request, - build_update_administrative_state_request, - build_update_bgp_administrative_state_request, - build_update_request, - build_update_static_route_bfd_administrative_state_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class InternalNetworksOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricMgmtClient`'s - :attr:`internal_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") - - async def _create_initial( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: Union[_models.InternalNetwork, IO], - **kwargs: Any - ) -> _models.InternalNetwork: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InternalNetwork] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "InternalNetwork") - - request = build_create_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - internal_network_name=internal_network_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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("InternalNetwork", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("InternalNetwork", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}" - } - - @overload - async def begin_create( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: _models.InternalNetwork, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InternalNetwork]: - """Creates InternalNetwork for Layer3 Isolation Domain for communication of compute within and - across racks. - - Creates InternalNetwork PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.InternalNetwork - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InternalNetwork or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InternalNetwork]: - """Creates InternalNetwork for Layer3 Isolation Domain for communication of compute within and - across racks. - - Creates InternalNetwork PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InternalNetwork or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: Union[_models.InternalNetwork, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.InternalNetwork]: - """Creates InternalNetwork for Layer3 Isolation Domain for communication of compute within and - across racks. - - Creates InternalNetwork PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :param body: Request payload. Is either a InternalNetwork type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.InternalNetwork or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InternalNetwork or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InternalNetwork] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - l3_isolation_domain_name=l3_isolation_domain_name, - internal_network_name=internal_network_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("InternalNetwork", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}" - } - - @distributed_trace_async - async def get( - self, resource_group_name: str, l3_isolation_domain_name: str, internal_network_name: str, **kwargs: Any - ) -> _models.InternalNetwork: - """Retrieves details of InternalNetworks using GET method. - - Gets a InternalNetworks. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InternalNetwork or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.InternalNetwork - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.InternalNetwork] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - internal_network_name=internal_network_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("InternalNetwork", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}" - } - - async def _update_initial( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: Union[_models.InternalNetworkPatch, IO], - **kwargs: Any - ) -> Optional[_models.InternalNetwork]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.InternalNetwork]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "InternalNetworkPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - internal_network_name=internal_network_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("InternalNetwork", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}" - } - - @overload - async def begin_update( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: _models.InternalNetworkPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InternalNetwork]: - """API to update certain properties of the InternalNetworks resources. - - Updates a InternalNetworks. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :param body: InternalNetwork properties to update. Only annotations are supported. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.InternalNetworkPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InternalNetwork or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InternalNetwork]: - """API to update certain properties of the InternalNetworks resources. - - Updates a InternalNetworks. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :param body: InternalNetwork properties to update. Only annotations are supported. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InternalNetwork or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: Union[_models.InternalNetworkPatch, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.InternalNetwork]: - """API to update certain properties of the InternalNetworks resources. - - Updates a InternalNetworks. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :param body: InternalNetwork properties to update. Only annotations are supported. Is either a - InternalNetworkPatch type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.InternalNetworkPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InternalNetwork or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InternalNetwork] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - l3_isolation_domain_name=l3_isolation_domain_name, - internal_network_name=internal_network_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("InternalNetwork", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, l3_isolation_domain_name: str, internal_network_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - internal_network_name=internal_network_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}" - } - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, l3_isolation_domain_name: str, internal_network_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a InternalNetworks. - - Implements InternalNetworks DELETE method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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, - l3_isolation_domain_name=l3_isolation_domain_name, - internal_network_name=internal_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, {}) - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}" - } - - @distributed_trace - def list_by_l3_isolation_domain( - self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any - ) -> AsyncIterable["_models.InternalNetwork"]: - """Executes list operation to display list of all internal networks. - - Displays InternalNetworks list by resource group GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InternalNetwork or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.InternalNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.InternalNetworksList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_l3_isolation_domain_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_l3_isolation_domain.metadata["url"], - 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._config.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("InternalNetworksList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_l3_isolation_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks" - } - - async def _update_administrative_state_initial( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_administrative_state_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - internal_network_name=internal_network_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_administrative_state_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_administrative_state_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateAdministrativeState" - } - - @overload - async def begin_update_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Executes the operation to the underlying resources. - - Update Administrative state of InternalNetworks on resources referred by their resource ids. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Executes the operation to the underlying resources. - - Update Administrative state of InternalNetworks on resources referred by their resource ids. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Executes the operation to the underlying resources. - - Update Administrative state of InternalNetworks on resources referred by their resource ids. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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_administrative_state_initial( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - internal_network_name=internal_network_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_administrative_state.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateAdministrativeState" - } - - async def _update_bgp_administrative_state_initial( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_bgp_administrative_state_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - internal_network_name=internal_network_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_bgp_administrative_state_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_bgp_administrative_state_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateBgpAdministrativeState" - } - - @overload - async def begin_update_bgp_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Executes the operation to the underlying resources for updating BGP state on edge devices. - - Update BGP state for internalNetwork. Allowed only on edge devices. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update_bgp_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Executes the operation to the underlying resources for updating BGP state on edge devices. - - Update BGP state for internalNetwork. Allowed only on edge devices. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update_bgp_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Executes the operation to the underlying resources for updating BGP state on edge devices. - - Update BGP state for internalNetwork. Allowed only on edge devices. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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_bgp_administrative_state_initial( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - internal_network_name=internal_network_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_bgp_administrative_state.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateBgpAdministrativeState" - } - - async def _update_static_route_bfd_administrative_state_initial( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_static_route_bfd_administrative_state_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - internal_network_name=internal_network_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_static_route_bfd_administrative_state_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_static_route_bfd_administrative_state_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateStaticRouteBfdAdministrativeState" - } - - @overload - async def begin_update_static_route_bfd_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Update Static Route BFD administrative state for internalNetwork. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update_static_route_bfd_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Update Static Route BFD administrative state for internalNetwork. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update_static_route_bfd_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Update Static Route BFD administrative state for internalNetwork. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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_static_route_bfd_administrative_state_initial( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - internal_network_name=internal_network_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_static_route_bfd_administrative_state.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateStaticRouteBfdAdministrativeState" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_internet_gateway_rules_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_internet_gateway_rules_operations.py deleted file mode 100644 index c7e056e1d5ce..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_internet_gateway_rules_operations.py +++ /dev/null @@ -1,914 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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._internet_gateway_rules_operations import ( - build_create_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_update_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class InternetGatewayRulesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricMgmtClient`'s - :attr:`internet_gateway_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") - - async def _create_initial( - self, - resource_group_name: str, - internet_gateway_rule_name: str, - body: Union[_models.InternetGatewayRule, IO], - **kwargs: Any - ) -> _models.InternetGatewayRule: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InternetGatewayRule] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "InternetGatewayRule") - - request = build_create_request( - resource_group_name=resource_group_name, - internet_gateway_rule_name=internet_gateway_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("InternetGatewayRule", pipeline_response) - - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = self._deserialize("InternetGatewayRule", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName}" - } - - @overload - async def begin_create( - self, - resource_group_name: str, - internet_gateway_rule_name: str, - body: _models.InternetGatewayRule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InternetGatewayRule]: - """Creates an Internet Gateway rule. - - Creates an Internet Gateway rule resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. - :type internet_gateway_rule_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.InternetGatewayRule - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InternetGatewayRule or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - internet_gateway_rule_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InternetGatewayRule]: - """Creates an Internet Gateway rule. - - Creates an Internet Gateway rule resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. - :type internet_gateway_rule_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InternetGatewayRule or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - internet_gateway_rule_name: str, - body: Union[_models.InternetGatewayRule, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.InternetGatewayRule]: - """Creates an Internet Gateway rule. - - Creates an Internet Gateway rule resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. - :type internet_gateway_rule_name: str - :param body: Request payload. Is either a InternetGatewayRule type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.InternetGatewayRule or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InternetGatewayRule or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InternetGatewayRule] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - internet_gateway_rule_name=internet_gateway_rule_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("InternetGatewayRule", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName}" - } - - @distributed_trace_async - async def get( - self, resource_group_name: str, internet_gateway_rule_name: str, **kwargs: Any - ) -> _models.InternetGatewayRule: - """Gets an Internet Gateway Rule. - - Gets an Internet Gateway Rule resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. - :type internet_gateway_rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InternetGatewayRule or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.InternetGatewayRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.InternetGatewayRule] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - internet_gateway_rule_name=internet_gateway_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("InternetGatewayRule", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName}" - } - - async def _update_initial( - self, - resource_group_name: str, - internet_gateway_rule_name: str, - body: Union[_models.InternetGatewayRulePatch, IO], - **kwargs: Any - ) -> Optional[_models.InternetGatewayRule]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.InternetGatewayRule]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "InternetGatewayRulePatch") - - request = build_update_request( - resource_group_name=resource_group_name, - internet_gateway_rule_name=internet_gateway_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("InternetGatewayRule", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName}" - } - - @overload - async def begin_update( - self, - resource_group_name: str, - internet_gateway_rule_name: str, - body: _models.InternetGatewayRulePatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InternetGatewayRule]: - """Updates an Internet Gateway Rule. - - API to update certain properties of the Internet Gateway Rule resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. - :type internet_gateway_rule_name: str - :param body: Internet Gateway Rule properties to update. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.InternetGatewayRulePatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InternetGatewayRule or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - internet_gateway_rule_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InternetGatewayRule]: - """Updates an Internet Gateway Rule. - - API to update certain properties of the Internet Gateway Rule resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. - :type internet_gateway_rule_name: str - :param body: Internet Gateway Rule properties to update. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InternetGatewayRule or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - internet_gateway_rule_name: str, - body: Union[_models.InternetGatewayRulePatch, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.InternetGatewayRule]: - """Updates an Internet Gateway Rule. - - API to update certain properties of the Internet Gateway Rule resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. - :type internet_gateway_rule_name: str - :param body: Internet Gateway Rule properties to update. Is either a InternetGatewayRulePatch - type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.InternetGatewayRulePatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InternetGatewayRule or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InternetGatewayRule] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - internet_gateway_rule_name=internet_gateway_rule_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("InternetGatewayRule", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, internet_gateway_rule_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - internet_gateway_rule_name=internet_gateway_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = 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) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName}" - } - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, internet_gateway_rule_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an Internet Gateway Rule. - - Implements Internet Gateway Rules DELETE method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. - :type internet_gateway_rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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, - internet_gateway_rule_name=internet_gateway_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, {}) - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName}" - } - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.InternetGatewayRule"]: - """List Internet Gateway Rules by resource group. - - Implements Internet Gateway Rules list by resource group GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InternetGatewayRule or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.InternetGatewayRulesListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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("InternetGatewayRulesListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.InternetGatewayRule"]: - """List Internet Gateway Rules by subscription. - - List all Internet Gateway rules in the given subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InternetGatewayRule or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.InternetGatewayRulesListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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("InternetGatewayRulesListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_internet_gateways_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_internet_gateways_operations.py deleted file mode 100644 index ac5ef843d697..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_internet_gateways_operations.py +++ /dev/null @@ -1,906 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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._internet_gateways_operations import ( - build_create_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_update_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class InternetGatewaysOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricMgmtClient`'s - :attr:`internet_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") - - async def _create_initial( - self, - resource_group_name: str, - internet_gateway_name: str, - body: Union[_models.InternetGateway, IO], - **kwargs: Any - ) -> _models.InternetGateway: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InternetGateway] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "InternetGateway") - - request = build_create_request( - resource_group_name=resource_group_name, - internet_gateway_name=internet_gateway_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("InternetGateway", pipeline_response) - - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = self._deserialize("InternetGateway", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName}" - } - - @overload - async def begin_create( - self, - resource_group_name: str, - internet_gateway_name: str, - body: _models.InternetGateway, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InternetGateway]: - """Create a Network Fabric Service Internet Gateway. - - Creates a Network Fabric Service Internet Gateway resource instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_name: Name of the Internet Gateway. Required. - :type internet_gateway_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.InternetGateway - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InternetGateway or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternetGateway] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - internet_gateway_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InternetGateway]: - """Create a Network Fabric Service Internet Gateway. - - Creates a Network Fabric Service Internet Gateway resource instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_name: Name of the Internet Gateway. Required. - :type internet_gateway_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InternetGateway or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternetGateway] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - internet_gateway_name: str, - body: Union[_models.InternetGateway, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.InternetGateway]: - """Create a Network Fabric Service Internet Gateway. - - Creates a Network Fabric Service Internet Gateway resource instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_name: Name of the Internet Gateway. Required. - :type internet_gateway_name: str - :param body: Request payload. Is either a InternetGateway type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.InternetGateway or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InternetGateway or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternetGateway] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InternetGateway] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - internet_gateway_name=internet_gateway_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("InternetGateway", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName}" - } - - @distributed_trace_async - async def get(self, resource_group_name: str, internet_gateway_name: str, **kwargs: Any) -> _models.InternetGateway: - """Retrieves details of Network Fabric Service Internet Gateway. - - Implements Gateway GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_name: Name of the Internet Gateway. Required. - :type internet_gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InternetGateway or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.InternetGateway - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.InternetGateway] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - internet_gateway_name=internet_gateway_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("InternetGateway", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName}" - } - - async def _update_initial( - self, - resource_group_name: str, - internet_gateway_name: str, - body: Union[_models.InternetGatewayPatch, IO], - **kwargs: Any - ) -> Optional[_models.InternetGateway]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.InternetGateway]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "InternetGatewayPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - internet_gateway_name=internet_gateway_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("InternetGateway", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName}" - } - - @overload - async def begin_update( - self, - resource_group_name: str, - internet_gateway_name: str, - body: _models.InternetGatewayPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InternetGateway]: - """Updates a Network Fabric Service Internet Gateway. - - Execute patch on Network Fabric Service Internet Gateway. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_name: Name of the Internet Gateway. Required. - :type internet_gateway_name: str - :param body: API to update certain properties of the L2 Isolation Domain resource.. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.InternetGatewayPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InternetGateway or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternetGateway] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - internet_gateway_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InternetGateway]: - """Updates a Network Fabric Service Internet Gateway. - - Execute patch on Network Fabric Service Internet Gateway. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_name: Name of the Internet Gateway. Required. - :type internet_gateway_name: str - :param body: API to update certain properties of the L2 Isolation Domain resource.. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InternetGateway or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternetGateway] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - internet_gateway_name: str, - body: Union[_models.InternetGatewayPatch, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.InternetGateway]: - """Updates a Network Fabric Service Internet Gateway. - - Execute patch on Network Fabric Service Internet Gateway. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_name: Name of the Internet Gateway. Required. - :type internet_gateway_name: str - :param body: API to update certain properties of the L2 Isolation Domain resource.. Is either a - InternetGatewayPatch type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.InternetGatewayPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InternetGateway or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternetGateway] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InternetGateway] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - internet_gateway_name=internet_gateway_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("InternetGateway", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, internet_gateway_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - internet_gateway_name=internet_gateway_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName}" - } - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, internet_gateway_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a Network Fabric Service Internet Gateway. - - Execute a delete on Network Fabric Service Internet Gateway. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_name: Name of the Internet Gateway. Required. - :type internet_gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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, - internet_gateway_name=internet_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, {}) - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName}" - } - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.InternetGateway"]: - """List Internet Gateways by resource group. - - Displays Internet Gateways list by resource group GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InternetGateway or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.InternetGateway] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.InternetGatewaysListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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("InternetGatewaysListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.InternetGateway"]: - """List Internet Gateways by subscription. - - Displays Internet Gateways list by subscription GET method. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InternetGateway or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.InternetGateway] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.InternetGatewaysListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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("InternetGatewaysListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/internetGateways" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_ip_communities_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_ip_communities_operations.py deleted file mode 100644 index 12916eb4c55b..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_ip_communities_operations.py +++ /dev/null @@ -1,888 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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._ip_communities_operations import ( - build_create_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_update_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class IpCommunitiesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricMgmtClient`'s - :attr:`ip_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") - - async def _create_initial( - self, resource_group_name: str, ip_community_name: str, body: Union[_models.IpCommunity, IO], **kwargs: Any - ) -> _models.IpCommunity: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.IpCommunity] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "IpCommunity") - - request = build_create_request( - resource_group_name=resource_group_name, - ip_community_name=ip_community_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("IpCommunity", pipeline_response) - - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = self._deserialize("IpCommunity", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities/{ipCommunityName}" - } - - @overload - async def begin_create( - self, - resource_group_name: str, - ip_community_name: str, - body: _models.IpCommunity, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.IpCommunity]: - """Create an IP Community. - - Implements an IP Community PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_community_name: Name of the IP Community. Required. - :type ip_community_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.IpCommunity - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either IpCommunity or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - ip_community_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.IpCommunity]: - """Create an IP Community. - - Implements an IP Community PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_community_name: Name of the IP Community. Required. - :type ip_community_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either IpCommunity or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, resource_group_name: str, ip_community_name: str, body: Union[_models.IpCommunity, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.IpCommunity]: - """Create an IP Community. - - Implements an IP Community PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_community_name: Name of the IP Community. Required. - :type ip_community_name: str - :param body: Request payload. Is either a IpCommunity type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.IpCommunity or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either IpCommunity or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.IpCommunity] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - ip_community_name=ip_community_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("IpCommunity", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities/{ipCommunityName}" - } - - @distributed_trace_async - async def get(self, resource_group_name: str, ip_community_name: str, **kwargs: Any) -> _models.IpCommunity: - """Gets an IP Community. - - Implements an IP Community GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_community_name: Name of the IP Community. Required. - :type ip_community_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: IpCommunity or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.IpCommunity - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.IpCommunity] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - ip_community_name=ip_community_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("IpCommunity", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities/{ipCommunityName}" - } - - async def _update_initial( - self, resource_group_name: str, ip_community_name: str, body: Union[_models.IpCommunityPatch, IO], **kwargs: Any - ) -> Optional[_models.IpCommunity]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.IpCommunity]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "IpCommunityPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - ip_community_name=ip_community_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("IpCommunity", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities/{ipCommunityName}" - } - - @overload - async def begin_update( - self, - resource_group_name: str, - ip_community_name: str, - body: _models.IpCommunityPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.IpCommunity]: - """Updates an IP Community. - - API to update certain properties of the IP Community resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_community_name: Name of the IP Community. Required. - :type ip_community_name: str - :param body: IP Community properties to update. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.IpCommunityPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either IpCommunity or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - ip_community_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.IpCommunity]: - """Updates an IP Community. - - API to update certain properties of the IP Community resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_community_name: Name of the IP Community. Required. - :type ip_community_name: str - :param body: IP Community properties to update. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either IpCommunity or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, resource_group_name: str, ip_community_name: str, body: Union[_models.IpCommunityPatch, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.IpCommunity]: - """Updates an IP Community. - - API to update certain properties of the IP Community resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_community_name: Name of the IP Community. Required. - :type ip_community_name: str - :param body: IP Community properties to update. Is either a IpCommunityPatch type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.IpCommunityPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either IpCommunity or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.IpCommunity] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - ip_community_name=ip_community_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("IpCommunity", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities/{ipCommunityName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, ip_community_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - ip_community_name=ip_community_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = 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) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities/{ipCommunityName}" - } - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, ip_community_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an IP Community. - - Implements IP Community DELETE method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_community_name: Name of the IP Community. Required. - :type ip_community_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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_community_name=ip_community_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities/{ipCommunityName}" - } - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.IpCommunity"]: - """List IP Communities by resource group. - - Implements IP Communities list by resource group GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IpCommunity or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.IpCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.IpCommunitiesListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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("IpCommunitiesListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.IpCommunity"]: - """List IP Communities by subscription. - - Implements IP Communities list by subscription GET method. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IpCommunity or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.IpCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.IpCommunitiesListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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("IpCommunitiesListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/ipCommunities" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_ip_extended_communities_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_ip_extended_communities_operations.py deleted file mode 100644 index 4c07806798de..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_ip_extended_communities_operations.py +++ /dev/null @@ -1,914 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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._ip_extended_communities_operations import ( - build_create_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_update_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class IpExtendedCommunitiesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricMgmtClient`'s - :attr:`ip_extended_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") - - async def _create_initial( - self, - resource_group_name: str, - ip_extended_community_name: str, - body: Union[_models.IpExtendedCommunity, IO], - **kwargs: Any - ) -> _models.IpExtendedCommunity: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.IpExtendedCommunity] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "IpExtendedCommunity") - - request = build_create_request( - resource_group_name=resource_group_name, - ip_extended_community_name=ip_extended_community_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("IpExtendedCommunity", pipeline_response) - - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = self._deserialize("IpExtendedCommunity", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName}" - } - - @overload - async def begin_create( - self, - resource_group_name: str, - ip_extended_community_name: str, - body: _models.IpExtendedCommunity, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.IpExtendedCommunity]: - """Create an IP Extended Community. - - Implements IP Extended Community PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_extended_community_name: Name of the IP Extended Community. Required. - :type ip_extended_community_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either IpExtendedCommunity or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - ip_extended_community_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.IpExtendedCommunity]: - """Create an IP Extended Community. - - Implements IP Extended Community PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_extended_community_name: Name of the IP Extended Community. Required. - :type ip_extended_community_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either IpExtendedCommunity or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - ip_extended_community_name: str, - body: Union[_models.IpExtendedCommunity, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.IpExtendedCommunity]: - """Create an IP Extended Community. - - Implements IP Extended Community PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_extended_community_name: Name of the IP Extended Community. Required. - :type ip_extended_community_name: str - :param body: Request payload. Is either a IpExtendedCommunity type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either IpExtendedCommunity or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.IpExtendedCommunity] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - ip_extended_community_name=ip_extended_community_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("IpExtendedCommunity", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName}" - } - - @distributed_trace_async - async def get( - self, resource_group_name: str, ip_extended_community_name: str, **kwargs: Any - ) -> _models.IpExtendedCommunity: - """Gets an IP Extended Community. - - Implements IP Extended Community GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_extended_community_name: Name of the IP Extended Community. Required. - :type ip_extended_community_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: IpExtendedCommunity or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.IpExtendedCommunity] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - ip_extended_community_name=ip_extended_community_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("IpExtendedCommunity", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName}" - } - - async def _update_initial( - self, - resource_group_name: str, - ip_extended_community_name: str, - body: Union[_models.IpExtendedCommunityPatch, IO], - **kwargs: Any - ) -> Optional[_models.IpExtendedCommunity]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.IpExtendedCommunity]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "IpExtendedCommunityPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - ip_extended_community_name=ip_extended_community_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("IpExtendedCommunity", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName}" - } - - @overload - async def begin_update( - self, - resource_group_name: str, - ip_extended_community_name: str, - body: _models.IpExtendedCommunityPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.IpExtendedCommunity]: - """Updates the IP Extended Community. - - API to update certain properties of the IP Extended Community resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_extended_community_name: Name of the IP Extended Community. Required. - :type ip_extended_community_name: str - :param body: IP Extended Community properties to update. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either IpExtendedCommunity or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - ip_extended_community_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.IpExtendedCommunity]: - """Updates the IP Extended Community. - - API to update certain properties of the IP Extended Community resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_extended_community_name: Name of the IP Extended Community. Required. - :type ip_extended_community_name: str - :param body: IP Extended Community properties to update. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either IpExtendedCommunity or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - ip_extended_community_name: str, - body: Union[_models.IpExtendedCommunityPatch, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.IpExtendedCommunity]: - """Updates the IP Extended Community. - - API to update certain properties of the IP Extended Community resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_extended_community_name: Name of the IP Extended Community. Required. - :type ip_extended_community_name: str - :param body: IP Extended Community properties to update. Is either a IpExtendedCommunityPatch - type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either IpExtendedCommunity or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.IpExtendedCommunity] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - ip_extended_community_name=ip_extended_community_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("IpExtendedCommunity", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, ip_extended_community_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - ip_extended_community_name=ip_extended_community_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = 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) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName}" - } - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, ip_extended_community_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the IP Extended Community. - - Implements IP Extended Community DELETE method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_extended_community_name: Name of the IP Extended Community. Required. - :type ip_extended_community_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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_extended_community_name=ip_extended_community_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName}" - } - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.IpExtendedCommunity"]: - """List IpExtendedCommunities by resource group. - - Implements IpExtendedCommunities list by resource group GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IpExtendedCommunity or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.IpExtendedCommunityListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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("IpExtendedCommunityListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.IpExtendedCommunity"]: - """List IpExtendedCommunities by subscription. - - Implements IpExtendedCommunities list by subscription GET method. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IpExtendedCommunity or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.IpExtendedCommunityListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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("IpExtendedCommunityListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_ip_prefixes_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_ip_prefixes_operations.py deleted file mode 100644 index 1f0138f04022..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_ip_prefixes_operations.py +++ /dev/null @@ -1,886 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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._ip_prefixes_operations import ( - build_create_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_update_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class IpPrefixesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricMgmtClient`'s - :attr:`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") - - async def _create_initial( - self, resource_group_name: str, ip_prefix_name: str, body: Union[_models.IpPrefix, IO], **kwargs: Any - ) -> _models.IpPrefix: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.IpPrefix] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "IpPrefix") - - request = build_create_request( - resource_group_name=resource_group_name, - ip_prefix_name=ip_prefix_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("IpPrefix", pipeline_response) - - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = self._deserialize("IpPrefix", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/{ipPrefixName}" - } - - @overload - async def begin_create( - self, - resource_group_name: str, - ip_prefix_name: str, - body: _models.IpPrefix, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.IpPrefix]: - """Create an IP Prefix. - - Implements IP Prefix PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_prefix_name: Name of the IP Prefix. Required. - :type ip_prefix_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.IpPrefix - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either IpPrefix or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpPrefix] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - ip_prefix_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.IpPrefix]: - """Create an IP Prefix. - - Implements IP Prefix PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_prefix_name: Name of the IP Prefix. Required. - :type ip_prefix_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either IpPrefix or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpPrefix] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, resource_group_name: str, ip_prefix_name: str, body: Union[_models.IpPrefix, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.IpPrefix]: - """Create an IP Prefix. - - Implements IP Prefix PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_prefix_name: Name of the IP Prefix. Required. - :type ip_prefix_name: str - :param body: Request payload. Is either a IpPrefix type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.IpPrefix or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either IpPrefix or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpPrefix] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.IpPrefix] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - ip_prefix_name=ip_prefix_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("IpPrefix", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/{ipPrefixName}" - } - - @distributed_trace_async - async def get(self, resource_group_name: str, ip_prefix_name: str, **kwargs: Any) -> _models.IpPrefix: - """Gets an IP Prefix. - - Implements IP Prefix GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_prefix_name: Name of the IP Prefix. Required. - :type ip_prefix_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: IpPrefix or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.IpPrefix - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.IpPrefix] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - ip_prefix_name=ip_prefix_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("IpPrefix", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/{ipPrefixName}" - } - - async def _update_initial( - self, resource_group_name: str, ip_prefix_name: str, body: Union[_models.IpPrefixPatch, IO], **kwargs: Any - ) -> Optional[_models.IpPrefix]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.IpPrefix]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "IpPrefixPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - ip_prefix_name=ip_prefix_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("IpPrefix", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/{ipPrefixName}" - } - - @overload - async def begin_update( - self, - resource_group_name: str, - ip_prefix_name: str, - body: _models.IpPrefixPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.IpPrefix]: - """Updates the IP Prefix. - - API to update certain properties of the IP Prefix resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_prefix_name: Name of the IP Prefix. Required. - :type ip_prefix_name: str - :param body: IP Prefix properties to update. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.IpPrefixPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either IpPrefix or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpPrefix] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - ip_prefix_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.IpPrefix]: - """Updates the IP Prefix. - - API to update certain properties of the IP Prefix resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_prefix_name: Name of the IP Prefix. Required. - :type ip_prefix_name: str - :param body: IP Prefix properties to update. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either IpPrefix or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpPrefix] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, resource_group_name: str, ip_prefix_name: str, body: Union[_models.IpPrefixPatch, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.IpPrefix]: - """Updates the IP Prefix. - - API to update certain properties of the IP Prefix resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_prefix_name: Name of the IP Prefix. Required. - :type ip_prefix_name: str - :param body: IP Prefix properties to update. Is either a IpPrefixPatch type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.IpPrefixPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either IpPrefix or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpPrefix] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.IpPrefix] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - ip_prefix_name=ip_prefix_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("IpPrefix", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/{ipPrefixName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, ip_prefix_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - ip_prefix_name=ip_prefix_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = 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) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/{ipPrefixName}" - } - - @distributed_trace_async - async def begin_delete(self, resource_group_name: str, ip_prefix_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Deletes the IP Prefix. - - Implements IP Prefix DELETE method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_prefix_name: Name of the IP Prefix. Required. - :type ip_prefix_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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_prefix_name=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, {}) - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/{ipPrefixName}" - } - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.IpPrefix"]: - """List IpPrefixes by resource group. - - Implements IpPrefixes list by resource group GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IpPrefix or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.IpPrefix] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.IpPrefixesListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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("IpPrefixesListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.IpPrefix"]: - """List IpPrefixes by subscription. - - Implements IpPrefixes list by subscription GET method. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IpPrefix or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.IpPrefix] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.IpPrefixesListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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("IpPrefixesListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_l2_isolation_domains_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_l2_isolation_domains_operations.py deleted file mode 100644 index 3ac94bc13bc2..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_l2_isolation_domains_operations.py +++ /dev/null @@ -1,1413 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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._l2_isolation_domains_operations import ( - build_commit_configuration_request, - build_create_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_update_administrative_state_request, - build_update_request, - build_validate_configuration_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class L2IsolationDomainsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricMgmtClient`'s - :attr:`l2_isolation_domains` 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") - - async def _create_initial( - self, - resource_group_name: str, - l2_isolation_domain_name: str, - body: Union[_models.L2IsolationDomain, IO], - **kwargs: Any - ) -> _models.L2IsolationDomain: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.L2IsolationDomain] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "L2IsolationDomain") - - request = build_create_request( - resource_group_name=resource_group_name, - l2_isolation_domain_name=l2_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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("L2IsolationDomain", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("L2IsolationDomain", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}" - } - - @overload - async def begin_create( - self, - resource_group_name: str, - l2_isolation_domain_name: str, - body: _models.L2IsolationDomain, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.L2IsolationDomain]: - """Create L2 Isolation Domain. - - Creates layer 2 network connectivity between compute nodes within a rack and across racks.The - configuration is applied on the devices only after the isolation domain is enabled. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. - :type l2_isolation_domain_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.L2IsolationDomain - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either L2IsolationDomain or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - l2_isolation_domain_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.L2IsolationDomain]: - """Create L2 Isolation Domain. - - Creates layer 2 network connectivity between compute nodes within a rack and across racks.The - configuration is applied on the devices only after the isolation domain is enabled. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. - :type l2_isolation_domain_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either L2IsolationDomain or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - l2_isolation_domain_name: str, - body: Union[_models.L2IsolationDomain, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.L2IsolationDomain]: - """Create L2 Isolation Domain. - - Creates layer 2 network connectivity between compute nodes within a rack and across racks.The - configuration is applied on the devices only after the isolation domain is enabled. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. - :type l2_isolation_domain_name: str - :param body: Request payload. Is either a L2IsolationDomain type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.L2IsolationDomain or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either L2IsolationDomain or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.L2IsolationDomain] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - l2_isolation_domain_name=l2_isolation_domain_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("L2IsolationDomain", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}" - } - - @distributed_trace_async - async def get( - self, resource_group_name: str, l2_isolation_domain_name: str, **kwargs: Any - ) -> _models.L2IsolationDomain: - """Retrieves details of this L2 Isolation Domain. - - Implements L2 Isolation Domain GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. - :type l2_isolation_domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: L2IsolationDomain or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.L2IsolationDomain - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.L2IsolationDomain] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - l2_isolation_domain_name=l2_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("L2IsolationDomain", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}" - } - - async def _update_initial( - self, - resource_group_name: str, - l2_isolation_domain_name: str, - body: Union[_models.L2IsolationDomainPatch, IO], - **kwargs: Any - ) -> Optional[_models.L2IsolationDomain]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.L2IsolationDomain]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "L2IsolationDomainPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - l2_isolation_domain_name=l2_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("L2IsolationDomain", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}" - } - - @overload - async def begin_update( - self, - resource_group_name: str, - l2_isolation_domain_name: str, - body: _models.L2IsolationDomainPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.L2IsolationDomain]: - """Updates the L2 Isolation Domain. - - API to update certain properties of the L2 Isolation Domain resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. - :type l2_isolation_domain_name: str - :param body: API to update certain properties of the L2 Isolation Domain resource.. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.L2IsolationDomainPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either L2IsolationDomain or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - l2_isolation_domain_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.L2IsolationDomain]: - """Updates the L2 Isolation Domain. - - API to update certain properties of the L2 Isolation Domain resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. - :type l2_isolation_domain_name: str - :param body: API to update certain properties of the L2 Isolation Domain resource.. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either L2IsolationDomain or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - l2_isolation_domain_name: str, - body: Union[_models.L2IsolationDomainPatch, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.L2IsolationDomain]: - """Updates the L2 Isolation Domain. - - API to update certain properties of the L2 Isolation Domain resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. - :type l2_isolation_domain_name: str - :param body: API to update certain properties of the L2 Isolation Domain resource.. Is either a - L2IsolationDomainPatch type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.L2IsolationDomainPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either L2IsolationDomain or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.L2IsolationDomain] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - l2_isolation_domain_name=l2_isolation_domain_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("L2IsolationDomain", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, l2_isolation_domain_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - l2_isolation_domain_name=l2_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}" - } - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, l2_isolation_domain_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the L2 Isolation Domain. - - Deletes layer 2 connectivity between compute nodes by managed by named L2 Isolation name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. - :type l2_isolation_domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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, - l2_isolation_domain_name=l2_isolation_domain_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}" - } - - async def _update_administrative_state_initial( - self, - resource_group_name: str, - l2_isolation_domain_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForDeviceUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForDeviceUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_administrative_state_request( - resource_group_name=resource_group_name, - l2_isolation_domain_name=l2_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_administrative_state_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_administrative_state_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/updateAdministrativeState" - } - - @overload - async def begin_update_administrative_state( - self, - resource_group_name: str, - l2_isolation_domain_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForDeviceUpdate]: - """Implements the operation to the underlying resources. - - Enables isolation domain across the fabric or on specified racks. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. - :type l2_isolation_domain_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForDeviceUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update_administrative_state( - self, - resource_group_name: str, - l2_isolation_domain_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForDeviceUpdate]: - """Implements the operation to the underlying resources. - - Enables isolation domain across the fabric or on specified racks. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. - :type l2_isolation_domain_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForDeviceUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update_administrative_state( - self, - resource_group_name: str, - l2_isolation_domain_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForDeviceUpdate]: - """Implements the operation to the underlying resources. - - Enables isolation domain across the fabric or on specified racks. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. - :type l2_isolation_domain_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForDeviceUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForDeviceUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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_administrative_state_initial( - resource_group_name=resource_group_name, - l2_isolation_domain_name=l2_isolation_domain_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_administrative_state.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/updateAdministrativeState" - } - - async def _validate_configuration_initial( - self, resource_group_name: str, l2_isolation_domain_name: str, **kwargs: Any - ) -> _models.ValidateConfigurationResponse: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ValidateConfigurationResponse] = kwargs.pop("cls", None) - - request = build_validate_configuration_request( - resource_group_name=resource_group_name, - l2_isolation_domain_name=l2_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._validate_configuration_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _validate_configuration_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/validateConfiguration" - } - - @distributed_trace_async - async def begin_validate_configuration( - self, resource_group_name: str, l2_isolation_domain_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.ValidateConfigurationResponse]: - """Validates the configuration of the resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. - :type l2_isolation_domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ValidateConfigurationResponse or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ValidateConfigurationResponse] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._validate_configuration_initial( - resource_group_name=resource_group_name, - l2_isolation_domain_name=l2_isolation_domain_name, - api_version=api_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("ValidateConfigurationResponse", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/validateConfiguration" - } - - async def _commit_configuration_initial( - self, resource_group_name: str, l2_isolation_domain_name: str, **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - request = build_commit_configuration_request( - resource_group_name=resource_group_name, - l2_isolation_domain_name=l2_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._commit_configuration_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _commit_configuration_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/commitConfiguration" - } - - @distributed_trace_async - async def begin_commit_configuration( - self, resource_group_name: str, l2_isolation_domain_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Execute the commit on the resources. - - Commits the configuration of the given resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. - :type l2_isolation_domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._commit_configuration_initial( - resource_group_name=resource_group_name, - l2_isolation_domain_name=l2_isolation_domain_name, - api_version=api_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("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_commit_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/commitConfiguration" - } - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.L2IsolationDomain"]: - """List L2IsolationDomains by resource group. - - Displays L2IsolationDomains list by resource group GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either L2IsolationDomain or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.L2IsolationDomainsListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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("L2IsolationDomainsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.L2IsolationDomain"]: - """List L2IsolationDomains by subscription. - - Displays L2IsolationDomains list by subscription GET method. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either L2IsolationDomain or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.L2IsolationDomainsListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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("L2IsolationDomainsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_l3_isolation_domains_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_l3_isolation_domains_operations.py deleted file mode 100644 index 1be279fc8305..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_l3_isolation_domains_operations.py +++ /dev/null @@ -1,1416 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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._l3_isolation_domains_operations import ( - build_commit_configuration_request, - build_create_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_update_administrative_state_request, - build_update_request, - build_validate_configuration_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class L3IsolationDomainsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricMgmtClient`'s - :attr:`l3_isolation_domains` 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") - - async def _create_initial( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - body: Union[_models.L3IsolationDomain, IO], - **kwargs: Any - ) -> _models.L3IsolationDomain: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.L3IsolationDomain] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "L3IsolationDomain") - - request = build_create_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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("L3IsolationDomain", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("L3IsolationDomain", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}" - } - - @overload - async def begin_create( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - body: _models.L3IsolationDomain, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.L3IsolationDomain]: - """Create L3 Isolation Domain. - - Create isolation domain resources for layer 3 connectivity between compute nodes and for - communication with external services .This configuration is applied on the devices only after - the creation of networks is completed and isolation domain is enabled. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.L3IsolationDomain - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either L3IsolationDomain or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.L3IsolationDomain]: - """Create L3 Isolation Domain. - - Create isolation domain resources for layer 3 connectivity between compute nodes and for - communication with external services .This configuration is applied on the devices only after - the creation of networks is completed and isolation domain is enabled. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either L3IsolationDomain or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - body: Union[_models.L3IsolationDomain, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.L3IsolationDomain]: - """Create L3 Isolation Domain. - - Create isolation domain resources for layer 3 connectivity between compute nodes and for - communication with external services .This configuration is applied on the devices only after - the creation of networks is completed and isolation domain is enabled. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param body: Request payload. Is either a L3IsolationDomain type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.L3IsolationDomain or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either L3IsolationDomain or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.L3IsolationDomain] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - l3_isolation_domain_name=l3_isolation_domain_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("L3IsolationDomain", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}" - } - - @distributed_trace_async - async def get( - self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any - ) -> _models.L3IsolationDomain: - """Gets a L3 Isolation Domain. - - Retrieves details of this L3 Isolation Domain. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: L3IsolationDomain or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.L3IsolationDomain - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.L3IsolationDomain] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("L3IsolationDomain", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}" - } - - async def _update_initial( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - body: Union[_models.L3IsolationDomainPatch, IO], - **kwargs: Any - ) -> Optional[_models.L3IsolationDomain]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.L3IsolationDomain]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "L3IsolationDomainPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("L3IsolationDomain", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}" - } - - @overload - async def begin_update( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - body: _models.L3IsolationDomainPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.L3IsolationDomain]: - """Updates a L3 Isolation Domain. - - API to update certain properties of the L3 Isolation Domain resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param body: API to update certain properties of the L3 Isolation Domain resource. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.L3IsolationDomainPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either L3IsolationDomain or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.L3IsolationDomain]: - """Updates a L3 Isolation Domain. - - API to update certain properties of the L3 Isolation Domain resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param body: API to update certain properties of the L3 Isolation Domain resource. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either L3IsolationDomain or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - body: Union[_models.L3IsolationDomainPatch, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.L3IsolationDomain]: - """Updates a L3 Isolation Domain. - - API to update certain properties of the L3 Isolation Domain resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param body: API to update certain properties of the L3 Isolation Domain resource. Is either a - L3IsolationDomainPatch type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.L3IsolationDomainPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either L3IsolationDomain or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.L3IsolationDomain] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - l3_isolation_domain_name=l3_isolation_domain_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("L3IsolationDomain", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}" - } - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a L3 Isolation Domain. - - Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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, - l3_isolation_domain_name=l3_isolation_domain_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}" - } - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.L3IsolationDomain"]: - """List L3IsolationDomains by resource group. - - Displays L3IsolationDomains list by resource group GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either L3IsolationDomain or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.L3IsolationDomainsListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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("L3IsolationDomainsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.L3IsolationDomain"]: - """List L3IsolationDomains by subscription. - - Displays L3IsolationDomains list by subscription GET method. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either L3IsolationDomain or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.L3IsolationDomainsListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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("L3IsolationDomainsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains" - } - - async def _update_administrative_state_initial( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForDeviceUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForDeviceUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_administrative_state_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_administrative_state_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_administrative_state_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/updateAdministrativeState" - } - - @overload - async def begin_update_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForDeviceUpdate]: - """executes enable operation to the underlying resources. - - Enables racks for this Isolation Domain. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForDeviceUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForDeviceUpdate]: - """executes enable operation to the underlying resources. - - Enables racks for this Isolation Domain. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForDeviceUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForDeviceUpdate]: - """executes enable operation to the underlying resources. - - Enables racks for this Isolation Domain. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForDeviceUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForDeviceUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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_administrative_state_initial( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_administrative_state.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/updateAdministrativeState" - } - - async def _validate_configuration_initial( - self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any - ) -> _models.ValidateConfigurationResponse: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ValidateConfigurationResponse] = kwargs.pop("cls", None) - - request = build_validate_configuration_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._validate_configuration_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _validate_configuration_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/validateConfiguration" - } - - @distributed_trace_async - async def begin_validate_configuration( - self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.ValidateConfigurationResponse]: - """Validates the configuration of the resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ValidateConfigurationResponse or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ValidateConfigurationResponse] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._validate_configuration_initial( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - api_version=api_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("ValidateConfigurationResponse", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/validateConfiguration" - } - - async def _commit_configuration_initial( - self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - request = build_commit_configuration_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._commit_configuration_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _commit_configuration_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/commitConfiguration" - } - - @distributed_trace_async - async def begin_commit_configuration( - self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Execute the commit on the resources. - - Commits the configuration of the given resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._commit_configuration_initial( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - api_version=api_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("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_commit_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/commitConfiguration" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_neighbor_groups_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_neighbor_groups_operations.py deleted file mode 100644 index d9211f33ae1f..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_neighbor_groups_operations.py +++ /dev/null @@ -1,891 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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._neighbor_groups_operations import ( - build_create_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_update_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class NeighborGroupsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricMgmtClient`'s - :attr:`neighbor_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") - - async def _create_initial( - self, resource_group_name: str, neighbor_group_name: str, body: Union[_models.NeighborGroup, IO], **kwargs: Any - ) -> _models.NeighborGroup: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NeighborGroup] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NeighborGroup") - - request = build_create_request( - resource_group_name=resource_group_name, - neighbor_group_name=neighbor_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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("NeighborGroup", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("NeighborGroup", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups/{neighborGroupName}" - } - - @overload - async def begin_create( - self, - resource_group_name: str, - neighbor_group_name: str, - body: _models.NeighborGroup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NeighborGroup]: - """Creates the Neighbor Group. - - Implements the Neighbor Group PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param neighbor_group_name: Name of the Neighbor Group. Required. - :type neighbor_group_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NeighborGroup - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NeighborGroup or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NeighborGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - neighbor_group_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NeighborGroup]: - """Creates the Neighbor Group. - - Implements the Neighbor Group PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param neighbor_group_name: Name of the Neighbor Group. Required. - :type neighbor_group_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NeighborGroup or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NeighborGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, resource_group_name: str, neighbor_group_name: str, body: Union[_models.NeighborGroup, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.NeighborGroup]: - """Creates the Neighbor Group. - - Implements the Neighbor Group PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param neighbor_group_name: Name of the Neighbor Group. Required. - :type neighbor_group_name: str - :param body: Request payload. Is either a NeighborGroup type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NeighborGroup or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NeighborGroup or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NeighborGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NeighborGroup] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - neighbor_group_name=neighbor_group_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NeighborGroup", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups/{neighborGroupName}" - } - - @distributed_trace_async - async def get(self, resource_group_name: str, neighbor_group_name: str, **kwargs: Any) -> _models.NeighborGroup: - """Retrieves details of neighbor Group using GET method. - - Gets the Neighbor Group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param neighbor_group_name: Name of the Neighbor Group. Required. - :type neighbor_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NeighborGroup or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.NeighborGroup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NeighborGroup] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - neighbor_group_name=neighbor_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("NeighborGroup", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups/{neighborGroupName}" - } - - async def _update_initial( - self, - resource_group_name: str, - neighbor_group_name: str, - body: Union[_models.NeighborGroupPatch, IO], - **kwargs: Any - ) -> Optional[_models.NeighborGroup]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.NeighborGroup]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NeighborGroupPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - neighbor_group_name=neighbor_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("NeighborGroup", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups/{neighborGroupName}" - } - - @overload - async def begin_update( - self, - resource_group_name: str, - neighbor_group_name: str, - body: _models.NeighborGroupPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NeighborGroup]: - """API to update certain properties of the Neighbor Group Resources. - - Updates the Neighbor Group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param neighbor_group_name: Name of the Neighbor Group. Required. - :type neighbor_group_name: str - :param body: Neighbor Group properties to update. Only annotations are supported. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NeighborGroupPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NeighborGroup or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NeighborGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - neighbor_group_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NeighborGroup]: - """API to update certain properties of the Neighbor Group Resources. - - Updates the Neighbor Group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param neighbor_group_name: Name of the Neighbor Group. Required. - :type neighbor_group_name: str - :param body: Neighbor Group properties to update. Only annotations are supported. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NeighborGroup or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NeighborGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - neighbor_group_name: str, - body: Union[_models.NeighborGroupPatch, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.NeighborGroup]: - """API to update certain properties of the Neighbor Group Resources. - - Updates the Neighbor Group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param neighbor_group_name: Name of the Neighbor Group. Required. - :type neighbor_group_name: str - :param body: Neighbor Group properties to update. Only annotations are supported. Is either a - NeighborGroupPatch type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NeighborGroupPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NeighborGroup or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NeighborGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NeighborGroup] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - neighbor_group_name=neighbor_group_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NeighborGroup", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups/{neighborGroupName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, neighbor_group_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - neighbor_group_name=neighbor_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups/{neighborGroupName}" - } - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, neighbor_group_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a Neighbor Group. - - Implements Neighbor Group DELETE method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param neighbor_group_name: Name of the Neighbor Group. Required. - :type neighbor_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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, - neighbor_group_name=neighbor_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, {}) - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups/{neighborGroupName}" - } - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.NeighborGroup"]: - """List Neighbor Groups by resource group. - - Displays NeighborGroups list by resource group GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NeighborGroup or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NeighborGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NeighborGroupsListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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("NeighborGroupsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.NeighborGroup"]: - """List Neighbor Groups by subscription. - - Displays NeighborGroups list by subscription GET method. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NeighborGroup or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NeighborGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NeighborGroupsListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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("NeighborGroupsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/neighborGroups" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_device_skus_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_device_skus_operations.py deleted file mode 100644 index 3df8c219a60a..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_device_skus_operations.py +++ /dev/null @@ -1,201 +0,0 @@ -# pylint: disable=too-many-lines -# 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, AsyncIterable, Callable, Dict, Optional, TypeVar -import urllib.parse - -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.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 ... import models as _models -from ..._vendor import _convert_request -from ...operations._network_device_skus_operations import build_get_request, build_list_by_subscription_request - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class NetworkDeviceSkusOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricMgmtClient`'s - :attr:`network_device_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") - - @distributed_trace_async - async def get(self, network_device_sku_name: str, **kwargs: Any) -> _models.NetworkDeviceSku: - """Gets a Network Device Sku. - - Get a Network Device SKU details. - - :param network_device_sku_name: Name of the Network Device SKU. Required. - :type network_device_sku_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkDeviceSku or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkDeviceSku - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkDeviceSku] = kwargs.pop("cls", None) - - request = build_get_request( - network_device_sku_name=network_device_sku_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("NetworkDeviceSku", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkDeviceSkus/{networkDeviceSkuName}" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.NetworkDeviceSku"]: - """List Network Device SKUs by subscription. - - List Network Device SKUs for the given subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkDeviceSku or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkDeviceSku] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkDeviceSkusListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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("NetworkDeviceSkusListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkDeviceSkus" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_devices_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_devices_operations.py deleted file mode 100644 index 26830b0baf90..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_devices_operations.py +++ /dev/null @@ -1,1738 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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._network_devices_operations import ( - build_create_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_reboot_request, - build_refresh_configuration_request, - build_update_administrative_state_request, - build_update_request, - build_upgrade_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class NetworkDevicesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricMgmtClient`'s - :attr:`network_devices` 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") - - async def _create_initial( - self, resource_group_name: str, network_device_name: str, body: Union[_models.NetworkDevice, IO], **kwargs: Any - ) -> _models.NetworkDevice: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkDevice] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkDevice") - - request = build_create_request( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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("NetworkDevice", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("NetworkDevice", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}" - } - - @overload - async def begin_create( - self, - resource_group_name: str, - network_device_name: str, - body: _models.NetworkDevice, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkDevice]: - """Create Network Device. - - Create a Network Device resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkDevice - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkDevice or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - network_device_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkDevice]: - """Create Network Device. - - Create a Network Device resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkDevice or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, resource_group_name: str, network_device_name: str, body: Union[_models.NetworkDevice, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkDevice]: - """Create Network Device. - - Create a Network Device resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param body: Request payload. Is either a NetworkDevice type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkDevice or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkDevice or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkDevice] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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_device_name=network_device_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkDevice", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}" - } - - @distributed_trace_async - async def get(self, resource_group_name: str, network_device_name: str, **kwargs: Any) -> _models.NetworkDevice: - """Gets a Network Device. - - Gets the Network Device resource details. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkDevice or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkDevice - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkDevice] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("NetworkDevice", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}" - } - - async def _update_initial( - self, - resource_group_name: str, - network_device_name: str, - body: Union[_models.NetworkDevicePatchParameters, IO], - **kwargs: Any - ) -> Optional[_models.NetworkDevice]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.NetworkDevice]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkDevicePatchParameters") - - request = build_update_request( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("NetworkDevice", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}" - } - - @overload - async def begin_update( - self, - resource_group_name: str, - network_device_name: str, - body: _models.NetworkDevicePatchParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkDevice]: - """Updates a Network Device. - - Update certain properties of the Network Device resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param body: Network Device properties to update. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkDevicePatchParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkDevice or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - network_device_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkDevice]: - """Updates a Network Device. - - Update certain properties of the Network Device resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param body: Network Device properties to update. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkDevice or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - network_device_name: str, - body: Union[_models.NetworkDevicePatchParameters, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkDevice]: - """Updates a Network Device. - - Update certain properties of the Network Device resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param body: Network Device properties to update. Is either a NetworkDevicePatchParameters type - or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkDevicePatchParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkDevice or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkDevice] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - network_device_name=network_device_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkDevice", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, network_device_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}" - } - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, network_device_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a Network Device. - - Delete the Network Device resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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_device_name=network_device_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}" - } - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.NetworkDevice"]: - """List NetworkDevices by resource group. - - List all the Network Device resources in a given resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkDevice or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkDevicesListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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("NetworkDevicesListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.NetworkDevice"]: - """List NetworkDevices by subscription. - - List all the Network Device resources in a given subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkDevice or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkDevicesListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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("NetworkDevicesListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkDevices" - } - - async def _reboot_initial( - self, - resource_group_name: str, - network_device_name: str, - body: Union[_models.RebootProperties, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "RebootProperties") - - request = build_reboot_request( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._reboot_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _reboot_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/reboot" - } - - @overload - async def begin_reboot( - self, - resource_group_name: str, - network_device_name: str, - body: _models.RebootProperties, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Reboot the Network Device. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.RebootProperties - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_reboot( - self, - resource_group_name: str, - network_device_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Reboot the Network Device. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_reboot( - self, - resource_group_name: str, - network_device_name: str, - body: Union[_models.RebootProperties, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Reboot the Network Device. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param body: Request payload. Is either a RebootProperties type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.RebootProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._reboot_initial( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_reboot.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/reboot" - } - - async def _refresh_configuration_initial( - self, resource_group_name: str, network_device_name: str, **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - request = build_refresh_configuration_request( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._refresh_configuration_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _refresh_configuration_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/refreshConfiguration" - } - - @distributed_trace_async - async def begin_refresh_configuration( - self, resource_group_name: str, network_device_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Refreshes the configuration the Network Device. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._refresh_configuration_initial( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - api_version=api_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("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_refresh_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/refreshConfiguration" - } - - async def _update_administrative_state_initial( - self, - resource_group_name: str, - network_device_name: str, - body: Union[_models.UpdateDeviceAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateDeviceAdministrativeState") - - request = build_update_administrative_state_request( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_administrative_state_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_administrative_state_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/updateAdministrativeState" - } - - @overload - async def begin_update_administrative_state( - self, - resource_group_name: str, - network_device_name: str, - body: _models.UpdateDeviceAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Updates the Administrative state of the Network Device. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateDeviceAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update_administrative_state( - self, - resource_group_name: str, - network_device_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Updates the Administrative state of the Network Device. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update_administrative_state( - self, - resource_group_name: str, - network_device_name: str, - body: Union[_models.UpdateDeviceAdministrativeState, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Updates the Administrative state of the Network Device. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param body: Request payload. Is either a UpdateDeviceAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateDeviceAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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_administrative_state_initial( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_administrative_state.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/updateAdministrativeState" - } - - async def _upgrade_initial( - self, resource_group_name: str, network_device_name: str, body: Union[_models.UpdateVersion, IO], **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateVersion") - - request = build_upgrade_request( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._upgrade_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _upgrade_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/upgrade" - } - - @overload - async def begin_upgrade( - self, - resource_group_name: str, - network_device_name: str, - body: _models.UpdateVersion, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Upgrades the version of the Network Device. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_upgrade( - self, - resource_group_name: str, - network_device_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Upgrades the version of the Network Device. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_upgrade( - self, resource_group_name: str, network_device_name: str, body: Union[_models.UpdateVersion, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Upgrades the version of the Network Device. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param body: Request payload. Is either a UpdateVersion type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateVersion or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._upgrade_initial( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_upgrade.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/upgrade" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_fabric_controllers_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_fabric_controllers_operations.py deleted file mode 100644 index 4364590cdc66..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_fabric_controllers_operations.py +++ /dev/null @@ -1,909 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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._network_fabric_controllers_operations import ( - build_create_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_update_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class NetworkFabricControllersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricMgmtClient`'s - :attr:`network_fabric_controllers` 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") - - async def _create_initial( - self, - resource_group_name: str, - network_fabric_controller_name: str, - body: Union[_models.NetworkFabricController, IO], - **kwargs: Any - ) -> _models.NetworkFabricController: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkFabricController] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkFabricController") - - request = build_create_request( - resource_group_name=resource_group_name, - network_fabric_controller_name=network_fabric_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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("NetworkFabricController", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("NetworkFabricController", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}" - } - - @overload - async def begin_create( - self, - resource_group_name: str, - network_fabric_controller_name: str, - body: _models.NetworkFabricController, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkFabricController]: - """Create Network fabric controller. - - Creates a Network Fabric Controller. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. - :type network_fabric_controller_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabricController - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkFabricController or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - network_fabric_controller_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkFabricController]: - """Create Network fabric controller. - - Creates a Network Fabric Controller. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. - :type network_fabric_controller_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkFabricController or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - network_fabric_controller_name: str, - body: Union[_models.NetworkFabricController, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkFabricController]: - """Create Network fabric controller. - - Creates a Network Fabric Controller. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. - :type network_fabric_controller_name: str - :param body: Request payload. Is either a NetworkFabricController type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabricController or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkFabricController or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkFabricController] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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_fabric_controller_name=network_fabric_controller_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkFabricController", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}" - } - - @distributed_trace_async - async def get( - self, resource_group_name: str, network_fabric_controller_name: str, **kwargs: Any - ) -> _models.NetworkFabricController: - """Gets a Network Fabric Controller. - - Shows the provisioning status of Network Fabric Controller. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. - :type network_fabric_controller_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkFabricController or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkFabricController - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkFabricController] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - network_fabric_controller_name=network_fabric_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("NetworkFabricController", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}" - } - - async def _update_initial( - self, - resource_group_name: str, - network_fabric_controller_name: str, - body: Union[_models.NetworkFabricControllerPatch, IO], - **kwargs: Any - ) -> Optional[_models.NetworkFabricController]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.NetworkFabricController]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkFabricControllerPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - network_fabric_controller_name=network_fabric_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("NetworkFabricController", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}" - } - - @overload - async def begin_update( - self, - resource_group_name: str, - network_fabric_controller_name: str, - body: _models.NetworkFabricControllerPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkFabricController]: - """Updates a Network Fabric Controller. - - Updates are currently not supported for the Network Fabric Controller resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. - :type network_fabric_controller_name: str - :param body: Network Fabric Controller properties to update. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabricControllerPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkFabricController or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - network_fabric_controller_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkFabricController]: - """Updates a Network Fabric Controller. - - Updates are currently not supported for the Network Fabric Controller resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. - :type network_fabric_controller_name: str - :param body: Network Fabric Controller properties to update. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkFabricController or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - network_fabric_controller_name: str, - body: Union[_models.NetworkFabricControllerPatch, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkFabricController]: - """Updates a Network Fabric Controller. - - Updates are currently not supported for the Network Fabric Controller resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. - :type network_fabric_controller_name: str - :param body: Network Fabric Controller properties to update. Is either a - NetworkFabricControllerPatch type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabricControllerPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkFabricController or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkFabricController] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - network_fabric_controller_name=network_fabric_controller_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkFabricController", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, network_fabric_controller_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - network_fabric_controller_name=network_fabric_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = 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) - - 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) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}" - } - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, network_fabric_controller_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a Network Fabric Controller. - - Deletes the Network Fabric Controller resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. - :type network_fabric_controller_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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_fabric_controller_name=network_fabric_controller_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}" - } - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.NetworkFabricController"]: - """List NetworkFabricControllers by resource group. - - Lists all the NetworkFabricControllers thats available in the resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkFabricController or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkFabricControllersListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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("NetworkFabricControllersListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.NetworkFabricController"]: - """List NetworkFabricControllers by subscription. - - Lists all the NetworkFabricControllers by subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkFabricController or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkFabricControllersListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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("NetworkFabricControllersListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_fabric_skus_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_fabric_skus_operations.py deleted file mode 100644 index 0855875a9902..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_fabric_skus_operations.py +++ /dev/null @@ -1,201 +0,0 @@ -# pylint: disable=too-many-lines -# 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, AsyncIterable, Callable, Dict, Optional, TypeVar -import urllib.parse - -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.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 ... import models as _models -from ..._vendor import _convert_request -from ...operations._network_fabric_skus_operations import build_get_request, build_list_by_subscription_request - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class NetworkFabricSkusOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricMgmtClient`'s - :attr:`network_fabric_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") - - @distributed_trace_async - async def get(self, network_fabric_sku_name: str, **kwargs: Any) -> _models.NetworkFabricSku: - """Gets a Network Fabric Sku. - - Implements Network Fabric SKU GET method. - - :param network_fabric_sku_name: Name of the Network Fabric SKU. Required. - :type network_fabric_sku_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkFabricSku or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkFabricSku - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkFabricSku] = kwargs.pop("cls", None) - - request = build_get_request( - network_fabric_sku_name=network_fabric_sku_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("NetworkFabricSku", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkFabricSkus/{networkFabricSkuName}" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.NetworkFabricSku"]: - """List Network Fabric SKUs by subscription. - - Implements Network Fabric SKUs list by subscription GET method. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkFabricSku or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkFabricSku] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkFabricSkusListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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("NetworkFabricSkusListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkFabricSkus" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_fabrics_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_fabrics_operations.py deleted file mode 100644 index 0db6fdcd4d72..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_fabrics_operations.py +++ /dev/null @@ -1,2533 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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._network_fabrics_operations import ( - build_commit_configuration_request, - build_create_request, - build_delete_request, - build_deprovision_request, - build_get_request, - build_get_topology_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_provision_request, - build_refresh_configuration_request, - build_update_infra_management_bfd_configuration_request, - build_update_request, - build_update_workload_management_bfd_configuration_request, - build_upgrade_request, - build_validate_configuration_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class NetworkFabricsOperations: # pylint: disable=too-many-public-methods - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricMgmtClient`'s - :attr:`network_fabrics` 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") - - async def _create_initial( - self, resource_group_name: str, network_fabric_name: str, body: Union[_models.NetworkFabric, IO], **kwargs: Any - ) -> _models.NetworkFabric: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkFabric] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkFabric") - - request = build_create_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("NetworkFabric", pipeline_response) - - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = self._deserialize("NetworkFabric", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}" - } - - @overload - async def begin_create( - self, - resource_group_name: str, - network_fabric_name: str, - body: _models.NetworkFabric, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkFabric]: - """Create Network Fabric. - - Create Network Fabric resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabric - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkFabric or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabric] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - network_fabric_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkFabric]: - """Create Network Fabric. - - Create Network Fabric resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkFabric or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabric] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, resource_group_name: str, network_fabric_name: str, body: Union[_models.NetworkFabric, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkFabric]: - """Create Network Fabric. - - Create Network Fabric resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Request payload. Is either a NetworkFabric type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabric or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkFabric or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabric] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkFabric] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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_fabric_name=network_fabric_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkFabric", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}" - } - - @distributed_trace_async - async def get(self, resource_group_name: str, network_fabric_name: str, **kwargs: Any) -> _models.NetworkFabric: - """Gets a Network Fabric. - - Get Network Fabric resource details. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkFabric or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkFabric - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkFabric] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("NetworkFabric", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}" - } - - async def _update_initial( - self, - resource_group_name: str, - network_fabric_name: str, - body: Union[_models.NetworkFabricPatch, IO], - **kwargs: Any - ) -> Optional[_models.NetworkFabric]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.NetworkFabric]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkFabricPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("NetworkFabric", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}" - } - - @overload - async def begin_update( - self, - resource_group_name: str, - network_fabric_name: str, - body: _models.NetworkFabricPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkFabric]: - """Updates a Network Fabric. - - Update certain properties of the Network Fabric resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Network Fabric properties to update. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabricPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkFabric or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabric] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - network_fabric_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkFabric]: - """Updates a Network Fabric. - - Update certain properties of the Network Fabric resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Network Fabric properties to update. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkFabric or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabric] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - network_fabric_name: str, - body: Union[_models.NetworkFabricPatch, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkFabric]: - """Updates a Network Fabric. - - Update certain properties of the Network Fabric resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Network Fabric properties to update. Is either a NetworkFabricPatch type or a IO - type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabricPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkFabric or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabric] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkFabric] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - network_fabric_name=network_fabric_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkFabric", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, network_fabric_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = 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) - - 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) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}" - } - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, network_fabric_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a Network Fabric. - - Delete Network Fabric resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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_fabric_name=network_fabric_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}" - } - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.NetworkFabric"]: - """List Network Fabrics by resource group. - - List all the Network Fabric resources in the given resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkFabric or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkFabric] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkFabricsListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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("NetworkFabricsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.NetworkFabric"]: - """List Network Fabrics by subscription. - - List all the Network Fabric resources in the given subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkFabric or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkFabric] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkFabricsListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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("NetworkFabricsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkFabrics" - } - - async def _provision_initial( - self, resource_group_name: str, network_fabric_name: str, **kwargs: Any - ) -> _models.CommonPostActionResponseForDeviceUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForDeviceUpdate] = kwargs.pop("cls", None) - - request = build_provision_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._provision_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _provision_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/provision" - } - - @distributed_trace_async - async def begin_provision( - self, resource_group_name: str, network_fabric_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForDeviceUpdate]: - """Implements the operation to the underlying resources. - - Provisions the underlying resources in the given Network Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForDeviceUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForDeviceUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._provision_initial( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - api_version=api_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("CommonPostActionResponseForDeviceUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_provision.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/provision" - } - - async def _deprovision_initial( - self, resource_group_name: str, network_fabric_name: str, **kwargs: Any - ) -> _models.CommonPostActionResponseForDeviceUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForDeviceUpdate] = kwargs.pop("cls", None) - - request = build_deprovision_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._deprovision_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _deprovision_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/deprovision" - } - - @distributed_trace_async - async def begin_deprovision( - self, resource_group_name: str, network_fabric_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForDeviceUpdate]: - """Implements the operation to the underlying resources. - - Deprovisions the underlying resources in the given Network Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForDeviceUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForDeviceUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._deprovision_initial( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - api_version=api_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("CommonPostActionResponseForDeviceUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_deprovision.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/deprovision" - } - - async def _upgrade_initial( - self, resource_group_name: str, network_fabric_name: str, body: Union[_models.UpdateVersion, IO], **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateVersion") - - request = build_upgrade_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._upgrade_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _upgrade_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/upgrade" - } - - @overload - async def begin_upgrade( - self, - resource_group_name: str, - network_fabric_name: str, - body: _models.UpdateVersion, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Upgrades the version of the underlying resources in the given Network Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Network Fabric properties to update. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_upgrade( - self, - resource_group_name: str, - network_fabric_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Upgrades the version of the underlying resources in the given Network Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Network Fabric properties to update. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_upgrade( - self, resource_group_name: str, network_fabric_name: str, body: Union[_models.UpdateVersion, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Upgrades the version of the underlying resources in the given Network Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Network Fabric properties to update. Is either a UpdateVersion type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateVersion or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._upgrade_initial( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_upgrade.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/upgrade" - } - - async def _refresh_configuration_initial( - self, resource_group_name: str, network_fabric_name: str, **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - request = build_refresh_configuration_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._refresh_configuration_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _refresh_configuration_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/refreshConfiguration" - } - - @distributed_trace_async - async def begin_refresh_configuration( - self, resource_group_name: str, network_fabric_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Refreshes the configuration of the underlying resources in the given Network Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._refresh_configuration_initial( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - api_version=api_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("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_refresh_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/refreshConfiguration" - } - - async def _update_workload_management_bfd_configuration_initial( - self, - resource_group_name: str, - network_fabric_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_workload_management_bfd_configuration_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_workload_management_bfd_configuration_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_workload_management_bfd_configuration_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/updateWorkloadManagementBfdConfiguration" - } - - @overload - async def begin_update_workload_management_bfd_configuration( - self, - resource_group_name: str, - network_fabric_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Updates the Workload Management BFD Configuration of the underlying resources in the given - Network Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update_workload_management_bfd_configuration( - self, - resource_group_name: str, - network_fabric_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Updates the Workload Management BFD Configuration of the underlying resources in the given - Network Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update_workload_management_bfd_configuration( - self, - resource_group_name: str, - network_fabric_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Updates the Workload Management BFD Configuration of the underlying resources in the given - Network Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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_workload_management_bfd_configuration_initial( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_workload_management_bfd_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/updateWorkloadManagementBfdConfiguration" - } - - async def _update_infra_management_bfd_configuration_initial( - self, - resource_group_name: str, - network_fabric_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_infra_management_bfd_configuration_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_infra_management_bfd_configuration_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_infra_management_bfd_configuration_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/updateInfraManagementBfdConfiguration" - } - - @overload - async def begin_update_infra_management_bfd_configuration( - self, - resource_group_name: str, - network_fabric_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Updates the Infra Management BFD Configuration of the underlying resources in the given Network - Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update_infra_management_bfd_configuration( - self, - resource_group_name: str, - network_fabric_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Updates the Infra Management BFD Configuration of the underlying resources in the given Network - Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update_infra_management_bfd_configuration( - self, - resource_group_name: str, - network_fabric_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Updates the Infra Management BFD Configuration of the underlying resources in the given Network - Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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_infra_management_bfd_configuration_initial( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_infra_management_bfd_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/updateInfraManagementBfdConfiguration" - } - - async def _validate_configuration_initial( - self, - resource_group_name: str, - network_fabric_name: str, - body: Union[_models.ValidateConfigurationProperties, IO], - **kwargs: Any - ) -> _models.ValidateConfigurationResponse: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ValidateConfigurationResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "ValidateConfigurationProperties") - - request = build_validate_configuration_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._validate_configuration_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _validate_configuration_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/validateConfiguration" - } - - @overload - async def begin_validate_configuration( - self, - resource_group_name: str, - network_fabric_name: str, - body: _models.ValidateConfigurationProperties, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ValidateConfigurationResponse]: - """Implements the operation to the underlying resources. - - Validates the configuration of the underlying resources in the given Network Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Validate configuration properties. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.ValidateConfigurationProperties - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ValidateConfigurationResponse or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_validate_configuration( - self, - resource_group_name: str, - network_fabric_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ValidateConfigurationResponse]: - """Implements the operation to the underlying resources. - - Validates the configuration of the underlying resources in the given Network Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Validate configuration properties. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ValidateConfigurationResponse or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_validate_configuration( - self, - resource_group_name: str, - network_fabric_name: str, - body: Union[_models.ValidateConfigurationProperties, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.ValidateConfigurationResponse]: - """Implements the operation to the underlying resources. - - Validates the configuration of the underlying resources in the given Network Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Validate configuration properties. Is either a ValidateConfigurationProperties - type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.ValidateConfigurationProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ValidateConfigurationResponse or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ValidateConfigurationResponse] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._validate_configuration_initial( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/validateConfiguration" - } - - async def _get_topology_initial( - self, resource_group_name: str, network_fabric_name: str, **kwargs: Any - ) -> _models.ValidateConfigurationResponse: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ValidateConfigurationResponse] = kwargs.pop("cls", None) - - request = build_get_topology_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._get_topology_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _get_topology_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/getTopology" - } - - @distributed_trace_async - async def begin_get_topology( - self, resource_group_name: str, network_fabric_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.ValidateConfigurationResponse]: - """Implements the operation to the underlying resources. - - Gets Topology of the underlying resources in the given Network Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ValidateConfigurationResponse or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ValidateConfigurationResponse] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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_topology_initial( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - api_version=api_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("ValidateConfigurationResponse", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_get_topology.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/getTopology" - } - - async def _commit_configuration_initial( - self, resource_group_name: str, network_fabric_name: str, **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - request = build_commit_configuration_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._commit_configuration_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _commit_configuration_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/commitConfiguration" - } - - @distributed_trace_async - async def begin_commit_configuration( - self, resource_group_name: str, network_fabric_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Atomic update of the given Network Fabric instance. Sync update of NFA resources at Fabric - level. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._commit_configuration_initial( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - api_version=api_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("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_commit_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/commitConfiguration" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_interfaces_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_interfaces_operations.py deleted file mode 100644 index 58d3595393ca..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_interfaces_operations.py +++ /dev/null @@ -1,1103 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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._network_interfaces_operations import ( - build_create_request, - build_delete_request, - build_get_request, - build_list_by_network_device_request, - build_update_administrative_state_request, - build_update_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class NetworkInterfacesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricMgmtClient`'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") - - async def _create_initial( - self, - resource_group_name: str, - network_device_name: str, - network_interface_name: str, - body: Union[_models.NetworkInterface, IO], - **kwargs: Any - ) -> _models.NetworkInterface: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkInterface") - - request = build_create_request( - resource_group_name=resource_group_name, - network_device_name=network_device_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, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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("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 - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}" - } - - @overload - async def begin_create( - self, - resource_group_name: str, - network_device_name: str, - network_interface_name: str, - body: _models.NetworkInterface, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkInterface]: - """Create NetworkInterface. - - Create a Network Interface resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param network_interface_name: Name of the Network Interface. Required. - :type network_interface_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkInterface - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkInterface] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - network_device_name: str, - network_interface_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkInterface]: - """Create NetworkInterface. - - Create a Network Interface resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param network_interface_name: Name of the Network Interface. Required. - :type network_interface_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkInterface] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - network_device_name: str, - network_interface_name: str, - body: Union[_models.NetworkInterface, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkInterface]: - """Create NetworkInterface. - - Create a Network Interface resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param network_interface_name: Name of the Network Interface. Required. - :type network_interface_name: str - :param body: Request payload. Is either a NetworkInterface type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkInterface or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.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._config.api_version)) - 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_initial( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - network_interface_name=network_interface_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda 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, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}" - } - - @distributed_trace_async - async def get( - self, resource_group_name: str, network_device_name: str, network_interface_name: str, **kwargs: Any - ) -> _models.NetworkInterface: - """Gets a NetworkInterface. - - Get the Network Interface resource details. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param network_interface_name: Name of the Network Interface. Required. - :type network_interface_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkInterface or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkInterface - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkInterface] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - network_interface_name=network_interface_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("NetworkInterface", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}" - } - - async def _update_initial( - self, - resource_group_name: str, - network_device_name: str, - network_interface_name: str, - body: Union[_models.NetworkInterfacePatch, IO], - **kwargs: Any - ) -> Optional[_models.NetworkInterface]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.NetworkInterface]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkInterfacePatch") - - request = build_update_request( - resource_group_name=resource_group_name, - network_device_name=network_device_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, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("NetworkInterface", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}" - } - - @overload - async def begin_update( - self, - resource_group_name: str, - network_device_name: str, - network_interface_name: str, - body: _models.NetworkInterfacePatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkInterface]: - """Updates a NetworkInterface. - - Update certain properties of the Network Interface resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param network_interface_name: Name of the Network Interface. Required. - :type network_interface_name: str - :param body: NetworkInterface properties to update. Only tags are supported. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkInterfacePatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkInterface] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - network_device_name: str, - network_interface_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkInterface]: - """Updates a NetworkInterface. - - Update certain properties of the Network Interface resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param network_interface_name: Name of the Network Interface. Required. - :type network_interface_name: str - :param body: NetworkInterface properties to update. Only tags are supported. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkInterface] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - network_device_name: str, - network_interface_name: str, - body: Union[_models.NetworkInterfacePatch, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkInterface]: - """Updates a NetworkInterface. - - Update certain properties of the Network Interface resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param network_interface_name: Name of the Network Interface. Required. - :type network_interface_name: str - :param body: NetworkInterface properties to update. Only tags are supported. Is either a - NetworkInterfacePatch type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkInterfacePatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.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._config.api_version)) - 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_initial( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - network_interface_name=network_interface_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda 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, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, network_device_name: str, network_interface_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - network_interface_name=network_interface_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}" - } - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, network_device_name: str, network_interface_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a NetworkInterface. - - Delete the Network Interface resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param network_interface_name: Name of the Network Interface. Required. - :type network_interface_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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_device_name=network_device_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, {}) - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}" - } - - @distributed_trace - def list_by_network_device( - self, resource_group_name: str, network_device_name: str, **kwargs: Any - ) -> AsyncIterable["_models.NetworkInterface"]: - """List all Network Interfaces that are available using an Network Device. - - List all the Network Interface resources in a given resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkInterface or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.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._config.api_version)) - cls: ClsType[_models.NetworkInterfacesList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_network_device_request( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_network_device.metadata["url"], - 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._config.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("NetworkInterfacesList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_network_device.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces" - } - - async def _update_administrative_state_initial( - self, - resource_group_name: str, - network_device_name: str, - network_interface_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_administrative_state_request( - resource_group_name=resource_group_name, - network_device_name=network_device_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, - template_url=self._update_administrative_state_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_administrative_state_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}/updateAdministrativeState" - } - - @overload - async def begin_update_administrative_state( - self, - resource_group_name: str, - network_device_name: str, - network_interface_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Updates the admin state of the network interface. - - Update the admin state of the Network Interface. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param network_interface_name: Name of the Network Interface. Required. - :type network_interface_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update_administrative_state( - self, - resource_group_name: str, - network_device_name: str, - network_interface_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Updates the admin state of the network interface. - - Update the admin state of the Network Interface. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param network_interface_name: Name of the Network Interface. Required. - :type network_interface_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update_administrative_state( - self, - resource_group_name: str, - network_device_name: str, - network_interface_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Updates the admin state of the network interface. - - Update the admin state of the Network Interface. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param network_interface_name: Name of the Network Interface. Required. - :type network_interface_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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_administrative_state_initial( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - network_interface_name=network_interface_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_administrative_state.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}/updateAdministrativeState" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_packet_brokers_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_packet_brokers_operations.py deleted file mode 100644 index ed2196bfc9f3..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_packet_brokers_operations.py +++ /dev/null @@ -1,903 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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._network_packet_brokers_operations import ( - build_create_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_update_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class NetworkPacketBrokersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricMgmtClient`'s - :attr:`network_packet_brokers` 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") - - async def _create_initial( - self, - resource_group_name: str, - network_packet_broker_name: str, - body: Union[_models.NetworkPacketBroker, IO], - **kwargs: Any - ) -> _models.NetworkPacketBroker: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkPacketBroker] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkPacketBroker") - - request = build_create_request( - resource_group_name=resource_group_name, - network_packet_broker_name=network_packet_broker_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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("NetworkPacketBroker", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("NetworkPacketBroker", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/{networkPacketBrokerName}" - } - - @overload - async def begin_create( - self, - resource_group_name: str, - network_packet_broker_name: str, - body: _models.NetworkPacketBroker, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkPacketBroker]: - """Create Network Packet Broker. - - Creates a Network Packet Broker. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_packet_broker_name: Name of the Network Packet Broker. Required. - :type network_packet_broker_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkPacketBroker or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - network_packet_broker_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkPacketBroker]: - """Create Network Packet Broker. - - Creates a Network Packet Broker. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_packet_broker_name: Name of the Network Packet Broker. Required. - :type network_packet_broker_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkPacketBroker or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - network_packet_broker_name: str, - body: Union[_models.NetworkPacketBroker, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkPacketBroker]: - """Create Network Packet Broker. - - Creates a Network Packet Broker. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_packet_broker_name: Name of the Network Packet Broker. Required. - :type network_packet_broker_name: str - :param body: Request payload. Is either a NetworkPacketBroker type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkPacketBroker or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkPacketBroker] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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_packet_broker_name=network_packet_broker_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkPacketBroker", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/{networkPacketBrokerName}" - } - - @distributed_trace_async - async def get( - self, resource_group_name: str, network_packet_broker_name: str, **kwargs: Any - ) -> _models.NetworkPacketBroker: - """Gets a Network Packet Broker. - - Retrieves details of this Network Packet Broker. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_packet_broker_name: Name of the Network Packet Broker. Required. - :type network_packet_broker_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkPacketBroker or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkPacketBroker] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - network_packet_broker_name=network_packet_broker_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("NetworkPacketBroker", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/{networkPacketBrokerName}" - } - - async def _update_initial( - self, - resource_group_name: str, - network_packet_broker_name: str, - body: Union[_models.NetworkPacketBrokerPatch, IO], - **kwargs: Any - ) -> Optional[_models.NetworkPacketBroker]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.NetworkPacketBroker]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkPacketBrokerPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - network_packet_broker_name=network_packet_broker_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("NetworkPacketBroker", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/{networkPacketBrokerName}" - } - - @overload - async def begin_update( - self, - resource_group_name: str, - network_packet_broker_name: str, - body: _models.NetworkPacketBrokerPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkPacketBroker]: - """Updates the Network Packet Broker. - - API to update certain properties of the Network Packet Broker resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_packet_broker_name: Name of the Network Packet Broker. Required. - :type network_packet_broker_name: str - :param body: Network Packet Broker properties to update. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkPacketBrokerPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkPacketBroker or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - network_packet_broker_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkPacketBroker]: - """Updates the Network Packet Broker. - - API to update certain properties of the Network Packet Broker resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_packet_broker_name: Name of the Network Packet Broker. Required. - :type network_packet_broker_name: str - :param body: Network Packet Broker properties to update. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkPacketBroker or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - network_packet_broker_name: str, - body: Union[_models.NetworkPacketBrokerPatch, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkPacketBroker]: - """Updates the Network Packet Broker. - - API to update certain properties of the Network Packet Broker resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_packet_broker_name: Name of the Network Packet Broker. Required. - :type network_packet_broker_name: str - :param body: Network Packet Broker properties to update. Is either a NetworkPacketBrokerPatch - type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkPacketBrokerPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkPacketBroker or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkPacketBroker] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - network_packet_broker_name=network_packet_broker_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkPacketBroker", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/{networkPacketBrokerName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, network_packet_broker_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - network_packet_broker_name=network_packet_broker_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/{networkPacketBrokerName}" - } - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, network_packet_broker_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a Network Packet Broker. - - Deletes Network Packet Broker. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_packet_broker_name: Name of the Network Packet Broker. Required. - :type network_packet_broker_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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_packet_broker_name=network_packet_broker_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/{networkPacketBrokerName}" - } - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.NetworkPacketBroker"]: - """List all Network Packet Brokers under resource group. - - Displays NetworkPacketBrokers list by resource group GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkPacketBroker or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkPacketBrokersListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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("NetworkPacketBrokersListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.NetworkPacketBroker"]: - """List Network Packet Brokers by subscription. - - Displays Network Packet Brokers list by subscription GET method. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkPacketBroker or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkPacketBrokersListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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("NetworkPacketBrokersListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_racks_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_racks_operations.py deleted file mode 100644 index f6d4fe5de258..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_racks_operations.py +++ /dev/null @@ -1,877 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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._network_racks_operations import ( - build_create_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_update_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class NetworkRacksOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricMgmtClient`'s - :attr:`network_racks` 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") - - async def _create_initial( - self, resource_group_name: str, network_rack_name: str, body: Union[_models.NetworkRack, IO], **kwargs: Any - ) -> _models.NetworkRack: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkRack] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkRack") - - request = build_create_request( - resource_group_name=resource_group_name, - network_rack_name=network_rack_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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("NetworkRack", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("NetworkRack", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks/{networkRackName}" - } - - @overload - async def begin_create( - self, - resource_group_name: str, - network_rack_name: str, - body: _models.NetworkRack, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkRack]: - """Create Network Rack. - - Create Network Rack resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_rack_name: Name of the Network Rack. Required. - :type network_rack_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkRack - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkRack or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkRack] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - network_rack_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkRack]: - """Create Network Rack. - - Create Network Rack resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_rack_name: Name of the Network Rack. Required. - :type network_rack_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkRack or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkRack] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, resource_group_name: str, network_rack_name: str, body: Union[_models.NetworkRack, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkRack]: - """Create Network Rack. - - Create Network Rack resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_rack_name: Name of the Network Rack. Required. - :type network_rack_name: str - :param body: Request payload. Is either a NetworkRack type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkRack or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkRack or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkRack] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkRack] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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_rack_name=network_rack_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkRack", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks/{networkRackName}" - } - - @distributed_trace_async - async def get(self, resource_group_name: str, network_rack_name: str, **kwargs: Any) -> _models.NetworkRack: - """Gets a Network Rack. - - Get Network Rack resource details. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_rack_name: Name of the Network Rack. Required. - :type network_rack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkRack or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkRack - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkRack] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - network_rack_name=network_rack_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("NetworkRack", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks/{networkRackName}" - } - - async def _update_initial( - self, resource_group_name: str, network_rack_name: str, body: Union[_models.TagsUpdate, IO], **kwargs: Any - ) -> Optional[_models.NetworkRack]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.NetworkRack]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "TagsUpdate") - - request = build_update_request( - resource_group_name=resource_group_name, - network_rack_name=network_rack_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("NetworkRack", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks/{networkRackName}" - } - - @overload - async def begin_update( - self, - resource_group_name: str, - network_rack_name: str, - body: _models.TagsUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkRack]: - """Updates a Network Rack. - - Update certain properties of the Network Rack resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_rack_name: Name of the Network Rack. Required. - :type network_rack_name: str - :param body: Network Rack properties to update. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.TagsUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkRack or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkRack] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - network_rack_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkRack]: - """Updates a Network Rack. - - Update certain properties of the Network Rack resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_rack_name: Name of the Network Rack. Required. - :type network_rack_name: str - :param body: Network Rack properties to update. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkRack or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkRack] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, resource_group_name: str, network_rack_name: str, body: Union[_models.TagsUpdate, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkRack]: - """Updates a Network Rack. - - Update certain properties of the Network Rack resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_rack_name: Name of the Network Rack. Required. - :type network_rack_name: str - :param body: Network Rack properties to update. Is either a TagsUpdate type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.TagsUpdate or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkRack or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkRack] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkRack] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - network_rack_name=network_rack_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkRack", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks/{networkRackName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, network_rack_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - network_rack_name=network_rack_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks/{networkRackName}" - } - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, network_rack_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a Network Rack. - - Delete Network Rack resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_rack_name: Name of the Network Rack. Required. - :type network_rack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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_rack_name=network_rack_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks/{networkRackName}" - } - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.NetworkRack"]: - """List Network Racks by resource group. - - List all Network Rack resources in the given resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkRack or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkRack] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkRacksListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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("NetworkRacksListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.NetworkRack"]: - """List Network Racks by subscription. - - List all Network Rack resources in the given subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkRack or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkRack] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkRacksListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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("NetworkRacksListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkRacks" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_tap_rules_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_tap_rules_operations.py deleted file mode 100644 index 98f109303fcb..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_tap_rules_operations.py +++ /dev/null @@ -1,1419 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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._network_tap_rules_operations import ( - build_create_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_resync_request, - build_update_administrative_state_request, - build_update_request, - build_validate_configuration_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class NetworkTapRulesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricMgmtClient`'s - :attr:`network_tap_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") - - async def _create_initial( - self, - resource_group_name: str, - network_tap_rule_name: str, - body: Union[_models.NetworkTapRule, IO], - **kwargs: Any - ) -> _models.NetworkTapRule: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkTapRule] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkTapRule") - - request = build_create_request( - resource_group_name=resource_group_name, - network_tap_rule_name=network_tap_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("NetworkTapRule", pipeline_response) - - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = self._deserialize("NetworkTapRule", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}" - } - - @overload - async def begin_create( - self, - resource_group_name: str, - network_tap_rule_name: str, - body: _models.NetworkTapRule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkTapRule]: - """Create Network Tap Rule. - - Create Network Tap Rule resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_rule_name: Name of the Network Tap Rule. Required. - :type network_tap_rule_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTapRule - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkTapRule or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - network_tap_rule_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkTapRule]: - """Create Network Tap Rule. - - Create Network Tap Rule resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_rule_name: Name of the Network Tap Rule. Required. - :type network_tap_rule_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkTapRule or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - network_tap_rule_name: str, - body: Union[_models.NetworkTapRule, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkTapRule]: - """Create Network Tap Rule. - - Create Network Tap Rule resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_rule_name: Name of the Network Tap Rule. Required. - :type network_tap_rule_name: str - :param body: Request payload. Is either a NetworkTapRule type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTapRule or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkTapRule or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkTapRule] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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_tap_rule_name=network_tap_rule_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkTapRule", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}" - } - - @distributed_trace_async - async def get(self, resource_group_name: str, network_tap_rule_name: str, **kwargs: Any) -> _models.NetworkTapRule: - """Gets a Network Tap Rule. - - Get Network Tap Rule resource details. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_rule_name: Name of the Network Tap Rule. Required. - :type network_tap_rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkTapRule or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkTapRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkTapRule] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - network_tap_rule_name=network_tap_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("NetworkTapRule", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}" - } - - async def _update_initial( - self, - resource_group_name: str, - network_tap_rule_name: str, - body: Union[_models.NetworkTapRulePatch, IO], - **kwargs: Any - ) -> Optional[_models.NetworkTapRule]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.NetworkTapRule]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkTapRulePatch") - - request = build_update_request( - resource_group_name=resource_group_name, - network_tap_rule_name=network_tap_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("NetworkTapRule", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}" - } - - @overload - async def begin_update( - self, - resource_group_name: str, - network_tap_rule_name: str, - body: _models.NetworkTapRulePatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkTapRule]: - """Updates a Network Tap Rule. - - Update certain properties of the Network Tap Rule resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_rule_name: Name of the Network Tap Rule. Required. - :type network_tap_rule_name: str - :param body: Network Tap Rule properties to update. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTapRulePatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkTapRule or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - network_tap_rule_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkTapRule]: - """Updates a Network Tap Rule. - - Update certain properties of the Network Tap Rule resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_rule_name: Name of the Network Tap Rule. Required. - :type network_tap_rule_name: str - :param body: Network Tap Rule properties to update. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkTapRule or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - network_tap_rule_name: str, - body: Union[_models.NetworkTapRulePatch, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkTapRule]: - """Updates a Network Tap Rule. - - Update certain properties of the Network Tap Rule resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_rule_name: Name of the Network Tap Rule. Required. - :type network_tap_rule_name: str - :param body: Network Tap Rule properties to update. Is either a NetworkTapRulePatch type or a - IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTapRulePatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkTapRule or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkTapRule] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - network_tap_rule_name=network_tap_rule_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkTapRule", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, network_tap_rule_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - network_tap_rule_name=network_tap_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = 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) - - 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) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}" - } - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, network_tap_rule_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a Network Tap Rule. - - Delete Network Tap Rule resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_rule_name: Name of the Network Tap Rule. Required. - :type network_tap_rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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_tap_rule_name=network_tap_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, {}) - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}" - } - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.NetworkTapRule"]: - """List Network Tap Rules by resource group. - - List all the Network Tap Rule resources in the given resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkTapRule or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkTapRulesListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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("NetworkTapRulesListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.NetworkTapRule"]: - """List NetworkTapRules by subscription. - - List all the Network Tap Rule resources in the given subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkTapRule or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkTapRulesListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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("NetworkTapRulesListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkTapRules" - } - - async def _update_administrative_state_initial( - self, - resource_group_name: str, - network_tap_rule_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_administrative_state_request( - resource_group_name=resource_group_name, - network_tap_rule_name=network_tap_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_administrative_state_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_administrative_state_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}/updateAdministrativeState" - } - - @overload - async def begin_update_administrative_state( - self, - resource_group_name: str, - network_tap_rule_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Updates administrative state of Network Tap Rules. - - Implements the operation to the underlying resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_rule_name: Name of the Network Tap Rule. Required. - :type network_tap_rule_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update_administrative_state( - self, - resource_group_name: str, - network_tap_rule_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Updates administrative state of Network Tap Rules. - - Implements the operation to the underlying resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_rule_name: Name of the Network Tap Rule. Required. - :type network_tap_rule_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update_administrative_state( - self, - resource_group_name: str, - network_tap_rule_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Updates administrative state of Network Tap Rules. - - Implements the operation to the underlying resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_rule_name: Name of the Network Tap Rule. Required. - :type network_tap_rule_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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_administrative_state_initial( - resource_group_name=resource_group_name, - network_tap_rule_name=network_tap_rule_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_administrative_state.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}/updateAdministrativeState" - } - - async def _resync_initial( - self, resource_group_name: str, network_tap_rule_name: str, **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - request = build_resync_request( - resource_group_name=resource_group_name, - network_tap_rule_name=network_tap_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._resync_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _resync_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}/resync" - } - - @distributed_trace_async - async def begin_resync( - self, resource_group_name: str, network_tap_rule_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Resync the Network Tap Rule. - - Implements the operation to the underlying resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_rule_name: Name of the Network Tap Rule. Required. - :type network_tap_rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._resync_initial( - resource_group_name=resource_group_name, - network_tap_rule_name=network_tap_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): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_resync.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}/resync" - } - - async def _validate_configuration_initial( - self, resource_group_name: str, network_tap_rule_name: str, **kwargs: Any - ) -> _models.ValidateConfigurationResponse: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ValidateConfigurationResponse] = kwargs.pop("cls", None) - - request = build_validate_configuration_request( - resource_group_name=resource_group_name, - network_tap_rule_name=network_tap_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._validate_configuration_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _validate_configuration_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}/validateConfiguration" - } - - @distributed_trace_async - async def begin_validate_configuration( - self, resource_group_name: str, network_tap_rule_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.ValidateConfigurationResponse]: - """Validates the configuration of the Network Tap Rule. - - Implements the operation to the underlying resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_rule_name: Name of the Network Tap Rule. Required. - :type network_tap_rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ValidateConfigurationResponse or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ValidateConfigurationResponse] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._validate_configuration_initial( - resource_group_name=resource_group_name, - network_tap_rule_name=network_tap_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): - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}/validateConfiguration" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_taps_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_taps_operations.py deleted file mode 100644 index 37958712ff40..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_taps_operations.py +++ /dev/null @@ -1,1252 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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._network_taps_operations import ( - build_create_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_resync_request, - build_update_administrative_state_request, - build_update_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class NetworkTapsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricMgmtClient`'s - :attr:`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") - - async def _create_initial( - self, resource_group_name: str, network_tap_name: str, body: Union[_models.NetworkTap, IO], **kwargs: Any - ) -> _models.NetworkTap: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkTap] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkTap") - - request = build_create_request( - resource_group_name=resource_group_name, - network_tap_name=network_tap_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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("NetworkTap", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("NetworkTap", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}" - } - - @overload - async def begin_create( - self, - resource_group_name: str, - network_tap_name: str, - body: _models.NetworkTap, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkTap]: - """Create Network Tap. - - Creates a Network Tap. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_name: Name of the Network Tap. Required. - :type network_tap_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTap - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkTap or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTap] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - network_tap_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkTap]: - """Create Network Tap. - - Creates a Network Tap. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_name: Name of the Network Tap. Required. - :type network_tap_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkTap or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTap] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, resource_group_name: str, network_tap_name: str, body: Union[_models.NetworkTap, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkTap]: - """Create Network Tap. - - Creates a Network Tap. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_name: Name of the Network Tap. Required. - :type network_tap_name: str - :param body: Request payload. Is either a NetworkTap type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTap or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkTap or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTap] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkTap] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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_tap_name=network_tap_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkTap", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}" - } - - @distributed_trace_async - async def get(self, resource_group_name: str, network_tap_name: str, **kwargs: Any) -> _models.NetworkTap: - """Gets a Network Tap. - - Retrieves details of this Network Tap. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_name: Name of the Network Tap. Required. - :type network_tap_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkTap or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkTap - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkTap] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - network_tap_name=network_tap_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("NetworkTap", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}" - } - - async def _update_initial( - self, resource_group_name: str, network_tap_name: str, body: Union[_models.NetworkTapPatch, IO], **kwargs: Any - ) -> Optional[_models.NetworkTap]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.NetworkTap]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkTapPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - network_tap_name=network_tap_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("NetworkTap", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}" - } - - @overload - async def begin_update( - self, - resource_group_name: str, - network_tap_name: str, - body: _models.NetworkTapPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkTap]: - """Updates the Network Taps. - - API to update certain properties of the Network Tap resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_name: Name of the Network Tap. Required. - :type network_tap_name: str - :param body: Network Tap properties to update. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTapPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkTap or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTap] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - network_tap_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkTap]: - """Updates the Network Taps. - - API to update certain properties of the Network Tap resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_name: Name of the Network Tap. Required. - :type network_tap_name: str - :param body: Network Tap properties to update. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkTap or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTap] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, resource_group_name: str, network_tap_name: str, body: Union[_models.NetworkTapPatch, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkTap]: - """Updates the Network Taps. - - API to update certain properties of the Network Tap resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_name: Name of the Network Tap. Required. - :type network_tap_name: str - :param body: Network Tap properties to update. Is either a NetworkTapPatch type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTapPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkTap or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTap] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkTap] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - network_tap_name=network_tap_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkTap", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, network_tap_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - network_tap_name=network_tap_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}" - } - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, network_tap_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a Network Tap. - - Deletes Network Tap. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_name: Name of the Network Tap. Required. - :type network_tap_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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_tap_name=network_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, {}) - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}" - } - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.NetworkTap"]: - """List Network Taps by resource group. - - Displays Network Taps list by resource group GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkTap or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkTap] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkTapsListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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("NetworkTapsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.NetworkTap"]: - """List Network Taps by subscription. - - Displays Network Taps list by subscription GET method. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkTap or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkTap] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkTapsListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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("NetworkTapsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkTaps" - } - - async def _update_administrative_state_initial( - self, - resource_group_name: str, - network_tap_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForDeviceUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForDeviceUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_administrative_state_request( - resource_group_name=resource_group_name, - network_tap_name=network_tap_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_administrative_state_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_administrative_state_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}/updateAdministrativeState" - } - - @overload - async def begin_update_administrative_state( - self, - resource_group_name: str, - network_tap_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForDeviceUpdate]: - """Updates administrative state of Network Tap. - - Implements the operation to the underlying resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_name: Name of the Network Tap. Required. - :type network_tap_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForDeviceUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update_administrative_state( - self, - resource_group_name: str, - network_tap_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForDeviceUpdate]: - """Updates administrative state of Network Tap. - - Implements the operation to the underlying resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_name: Name of the Network Tap. Required. - :type network_tap_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForDeviceUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update_administrative_state( - self, - resource_group_name: str, - network_tap_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForDeviceUpdate]: - """Updates administrative state of Network Tap. - - Implements the operation to the underlying resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_name: Name of the Network Tap. Required. - :type network_tap_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForDeviceUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForDeviceUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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_administrative_state_initial( - resource_group_name=resource_group_name, - network_tap_name=network_tap_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_administrative_state.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}/updateAdministrativeState" - } - - async def _resync_initial( - self, resource_group_name: str, network_tap_name: str, **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - request = build_resync_request( - resource_group_name=resource_group_name, - network_tap_name=network_tap_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._resync_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _resync_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}/resync" - } - - @distributed_trace_async - async def begin_resync( - self, resource_group_name: str, network_tap_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Resync operation on the Network Tap. - - Implements the operation to the underlying resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_name: Name of the Network Tap. Required. - :type network_tap_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._resync_initial( - resource_group_name=resource_group_name, - network_tap_name=network_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): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_resync.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}/resync" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_to_network_interconnects_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_to_network_interconnects_operations.py deleted file mode 100644 index ea1d068786e2..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_network_to_network_interconnects_operations.py +++ /dev/null @@ -1,1384 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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._network_to_network_interconnects_operations import ( - build_create_request, - build_delete_request, - build_get_request, - build_list_by_network_fabric_request, - build_update_administrative_state_request, - build_update_npb_static_route_bfd_administrative_state_request, - build_update_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class NetworkToNetworkInterconnectsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricMgmtClient`'s - :attr:`network_to_network_interconnects` 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") - - async def _create_initial( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: Union[_models.NetworkToNetworkInterconnect, IO], - **kwargs: Any - ) -> _models.NetworkToNetworkInterconnect: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkToNetworkInterconnect] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkToNetworkInterconnect") - - request = build_create_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - network_to_network_interconnect_name=network_to_network_interconnect_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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("NetworkToNetworkInterconnect", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("NetworkToNetworkInterconnect", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}" - } - - @overload - async def begin_create( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: _models.NetworkToNetworkInterconnect, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkToNetworkInterconnect]: - """Configuration used to setup CE-PE connectivity. - - Configuration used to setup CE-PE connectivity PUT Method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. - Required. - :type network_to_network_interconnect_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkToNetworkInterconnect or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkToNetworkInterconnect]: - """Configuration used to setup CE-PE connectivity. - - Configuration used to setup CE-PE connectivity PUT Method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. - Required. - :type network_to_network_interconnect_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkToNetworkInterconnect or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: Union[_models.NetworkToNetworkInterconnect, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkToNetworkInterconnect]: - """Configuration used to setup CE-PE connectivity. - - Configuration used to setup CE-PE connectivity PUT Method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. - Required. - :type network_to_network_interconnect_name: str - :param body: Request payload. Is either a NetworkToNetworkInterconnect type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkToNetworkInterconnect or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkToNetworkInterconnect] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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_fabric_name=network_fabric_name, - network_to_network_interconnect_name=network_to_network_interconnect_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkToNetworkInterconnect", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}" - } - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - **kwargs: Any - ) -> _models.NetworkToNetworkInterconnect: - """Configuration used to setup CE-PE connectivity. - - Implements NetworkToNetworkInterconnects GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. - Required. - :type network_to_network_interconnect_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkToNetworkInterconnect or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkToNetworkInterconnect] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - network_to_network_interconnect_name=network_to_network_interconnect_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("NetworkToNetworkInterconnect", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}" - } - - async def _update_initial( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: Union[_models.NetworkToNetworkInterconnectPatch, IO], - **kwargs: Any - ) -> Optional[_models.NetworkToNetworkInterconnect]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.NetworkToNetworkInterconnect]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkToNetworkInterconnectPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - network_to_network_interconnect_name=network_to_network_interconnect_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("NetworkToNetworkInterconnect", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}" - } - - @overload - async def begin_update( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: _models.NetworkToNetworkInterconnectPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkToNetworkInterconnect]: - """Updates a Network To NetworkInterconnects. - - Update certain properties of the Network To NetworkInterconnects resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. - Required. - :type network_to_network_interconnect_name: str - :param body: Network to Network Interconnect properties to update. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnectPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkToNetworkInterconnect or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkToNetworkInterconnect]: - """Updates a Network To NetworkInterconnects. - - Update certain properties of the Network To NetworkInterconnects resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. - Required. - :type network_to_network_interconnect_name: str - :param body: Network to Network Interconnect properties to update. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkToNetworkInterconnect or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: Union[_models.NetworkToNetworkInterconnectPatch, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkToNetworkInterconnect]: - """Updates a Network To NetworkInterconnects. - - Update certain properties of the Network To NetworkInterconnects resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. - Required. - :type network_to_network_interconnect_name: str - :param body: Network to Network Interconnect properties to update. Is either a - NetworkToNetworkInterconnectPatch type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnectPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkToNetworkInterconnect or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkToNetworkInterconnect] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - network_fabric_name=network_fabric_name, - network_to_network_interconnect_name=network_to_network_interconnect_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkToNetworkInterconnect", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - network_to_network_interconnect_name=network_to_network_interconnect_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}" - } - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a NetworkToNetworkInterconnects. - - Implements NetworkToNetworkInterconnects DELETE method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. - Required. - :type network_to_network_interconnect_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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_fabric_name=network_fabric_name, - network_to_network_interconnect_name=network_to_network_interconnect_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}" - } - - @distributed_trace - def list_by_network_fabric( - self, resource_group_name: str, network_fabric_name: str, **kwargs: Any - ) -> AsyncIterable["_models.NetworkToNetworkInterconnect"]: - """Executes list operation to display Network To Network Interconnects within a Network Fabric. - - Implements Network To Network Interconnects list by Network Fabric GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkToNetworkInterconnect or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkToNetworkInterconnectsList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_network_fabric_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_network_fabric.metadata["url"], - 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._config.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("NetworkToNetworkInterconnectsList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_network_fabric.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects" - } - - async def _update_npb_static_route_bfd_administrative_state_initial( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_npb_static_route_bfd_administrative_state_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - network_to_network_interconnect_name=network_to_network_interconnect_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_npb_static_route_bfd_administrative_state_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_npb_static_route_bfd_administrative_state_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}/updateNpbStaticRouteBfdAdministrativeState" - } - - @overload - async def begin_update_npb_static_route_bfd_administrative_state( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Updates the NPB Static Route BFD Administrative State. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. - Required. - :type network_to_network_interconnect_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update_npb_static_route_bfd_administrative_state( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Updates the NPB Static Route BFD Administrative State. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. - Required. - :type network_to_network_interconnect_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update_npb_static_route_bfd_administrative_state( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Updates the NPB Static Route BFD Administrative State. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. - Required. - :type network_to_network_interconnect_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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_npb_static_route_bfd_administrative_state_initial( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - network_to_network_interconnect_name=network_to_network_interconnect_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_npb_static_route_bfd_administrative_state.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}/updateNpbStaticRouteBfdAdministrativeState" - } - - async def _update_administrative_state_initial( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_administrative_state_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - network_to_network_interconnect_name=network_to_network_interconnect_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_administrative_state_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_administrative_state_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}/updateAdministrativeState" - } - - @overload - async def begin_update_administrative_state( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Updates the Admin State. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. - Required. - :type network_to_network_interconnect_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update_administrative_state( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Updates the Admin State. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. - Required. - :type network_to_network_interconnect_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update_administrative_state( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Updates the Admin State. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. - Required. - :type network_to_network_interconnect_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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_administrative_state_initial( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - network_to_network_interconnect_name=network_to_network_interconnect_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_administrative_state.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}/updateAdministrativeState" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_operations.py index 2f4663861df8..32cf914079ee 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_operations.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_operations.py @@ -1,14 +1,18 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from collections.abc import MutableMapping +from io import IOBase +import json +from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -16,21 +20,237 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import AsyncHttpResponse, 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_list_request +from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from ..._utils.serialization import Deserializer, Serializer +from ..._validation import api_version_validation +from ...operations._operations import ( + build_access_control_lists_create_request, + build_access_control_lists_delete_request, + build_access_control_lists_get_request, + build_access_control_lists_list_by_resource_group_request, + build_access_control_lists_list_by_subscription_request, + build_access_control_lists_resync_request, + build_access_control_lists_update_administrative_state_request, + build_access_control_lists_update_request, + build_access_control_lists_validate_configuration_request, + build_external_networks_create_request, + build_external_networks_delete_request, + build_external_networks_get_request, + build_external_networks_list_by_l3_isolation_domain_request, + build_external_networks_update_administrative_state_request, + build_external_networks_update_bfd_administrative_state_request, + build_external_networks_update_request, + build_external_networks_update_static_route_bfd_administrative_state_request, + build_internal_networks_create_request, + build_internal_networks_delete_request, + build_internal_networks_get_request, + build_internal_networks_list_by_l3_isolation_domain_request, + build_internal_networks_update_administrative_state_request, + build_internal_networks_update_bfd_administrative_state_request, + build_internal_networks_update_bgp_administrative_state_request, + build_internal_networks_update_request, + build_internal_networks_update_static_route_bfd_administrative_state_request, + build_internet_gateway_rules_create_request, + build_internet_gateway_rules_delete_request, + build_internet_gateway_rules_get_request, + build_internet_gateway_rules_list_by_resource_group_request, + build_internet_gateway_rules_list_by_subscription_request, + build_internet_gateway_rules_update_request, + build_internet_gateways_create_request, + build_internet_gateways_delete_request, + build_internet_gateways_get_request, + build_internet_gateways_list_by_resource_group_request, + build_internet_gateways_list_by_subscription_request, + build_internet_gateways_update_request, + build_ip_communities_create_request, + build_ip_communities_delete_request, + build_ip_communities_get_request, + build_ip_communities_list_by_resource_group_request, + build_ip_communities_list_by_subscription_request, + build_ip_communities_update_request, + build_ip_extended_communities_create_request, + build_ip_extended_communities_delete_request, + build_ip_extended_communities_get_request, + build_ip_extended_communities_list_by_resource_group_request, + build_ip_extended_communities_list_by_subscription_request, + build_ip_extended_communities_update_request, + build_ip_prefixes_create_request, + build_ip_prefixes_delete_request, + build_ip_prefixes_get_request, + build_ip_prefixes_list_by_resource_group_request, + build_ip_prefixes_list_by_subscription_request, + build_ip_prefixes_update_request, + build_l2_isolation_domains_commit_configuration_request, + build_l2_isolation_domains_create_request, + build_l2_isolation_domains_delete_request, + build_l2_isolation_domains_get_request, + build_l2_isolation_domains_list_by_resource_group_request, + build_l2_isolation_domains_list_by_subscription_request, + build_l2_isolation_domains_update_administrative_state_request, + build_l2_isolation_domains_update_request, + build_l2_isolation_domains_validate_configuration_request, + build_l3_isolation_domains_commit_configuration_request, + build_l3_isolation_domains_create_request, + build_l3_isolation_domains_delete_request, + build_l3_isolation_domains_get_request, + build_l3_isolation_domains_list_by_resource_group_request, + build_l3_isolation_domains_list_by_subscription_request, + build_l3_isolation_domains_update_administrative_state_request, + build_l3_isolation_domains_update_request, + build_l3_isolation_domains_validate_configuration_request, + build_neighbor_groups_create_request, + build_neighbor_groups_delete_request, + build_neighbor_groups_get_request, + build_neighbor_groups_list_by_resource_group_request, + build_neighbor_groups_list_by_subscription_request, + build_neighbor_groups_resync_request, + build_neighbor_groups_update_request, + build_network_bootstrap_devices_create_request, + build_network_bootstrap_devices_delete_request, + build_network_bootstrap_devices_get_request, + build_network_bootstrap_devices_list_by_resource_group_request, + build_network_bootstrap_devices_list_by_subscription_request, + build_network_bootstrap_devices_reboot_request, + build_network_bootstrap_devices_refresh_configuration_request, + build_network_bootstrap_devices_resync_passwords_request, + build_network_bootstrap_devices_update_administrative_state_request, + build_network_bootstrap_devices_update_request, + build_network_bootstrap_devices_upgrade_request, + build_network_bootstrap_interfaces_create_request, + build_network_bootstrap_interfaces_delete_request, + build_network_bootstrap_interfaces_get_request, + build_network_bootstrap_interfaces_list_by_network_bootstrap_device_request, + build_network_bootstrap_interfaces_update_administrative_state_request, + build_network_bootstrap_interfaces_update_request, + build_network_device_skus_get_request, + build_network_device_skus_list_by_subscription_request, + build_network_devices_create_request, + build_network_devices_delete_request, + build_network_devices_get_request, + build_network_devices_list_by_resource_group_request, + build_network_devices_list_by_subscription_request, + build_network_devices_reboot_request, + build_network_devices_refresh_configuration_request, + build_network_devices_resync_certificates_request, + build_network_devices_resync_passwords_request, + build_network_devices_run_ro_command_request, + build_network_devices_run_rw_command_request, + build_network_devices_update_administrative_state_request, + build_network_devices_update_request, + build_network_devices_upgrade_request, + build_network_fabric_controllers_create_request, + build_network_fabric_controllers_delete_request, + build_network_fabric_controllers_get_request, + build_network_fabric_controllers_list_by_resource_group_request, + build_network_fabric_controllers_list_by_subscription_request, + build_network_fabric_controllers_update_request, + build_network_fabric_skus_get_request, + build_network_fabric_skus_list_by_subscription_request, + build_network_fabrics_arm_configuration_diff_request, + build_network_fabrics_commit_batch_status_request, + build_network_fabrics_commit_configuration_request, + build_network_fabrics_create_request, + build_network_fabrics_delete_request, + build_network_fabrics_deprovision_request, + build_network_fabrics_discard_commit_batch_request, + build_network_fabrics_get_request, + build_network_fabrics_get_topology_request, + build_network_fabrics_list_by_resource_group_request, + build_network_fabrics_list_by_subscription_request, + build_network_fabrics_lock_fabric_request, + build_network_fabrics_provision_request, + build_network_fabrics_refresh_configuration_request, + build_network_fabrics_resync_certificates_request, + build_network_fabrics_resync_passwords_request, + build_network_fabrics_rotate_certificates_request, + build_network_fabrics_rotate_passwords_request, + build_network_fabrics_update_infra_management_bfd_configuration_request, + build_network_fabrics_update_request, + build_network_fabrics_update_workload_management_bfd_configuration_request, + build_network_fabrics_upgrade_request, + build_network_fabrics_validate_configuration_request, + build_network_fabrics_view_device_configuration_request, + build_network_interfaces_create_request, + build_network_interfaces_delete_request, + build_network_interfaces_get_request, + build_network_interfaces_list_by_network_device_request, + build_network_interfaces_update_administrative_state_request, + build_network_interfaces_update_request, + build_network_monitors_create_request, + build_network_monitors_delete_request, + build_network_monitors_get_request, + build_network_monitors_list_by_resource_group_request, + build_network_monitors_list_by_subscription_request, + build_network_monitors_update_administrative_state_request, + build_network_monitors_update_request, + build_network_packet_brokers_create_request, + build_network_packet_brokers_delete_request, + build_network_packet_brokers_get_request, + build_network_packet_brokers_list_by_resource_group_request, + build_network_packet_brokers_list_by_subscription_request, + build_network_packet_brokers_update_request, + build_network_racks_create_request, + build_network_racks_delete_request, + build_network_racks_get_request, + build_network_racks_list_by_resource_group_request, + build_network_racks_list_by_subscription_request, + build_network_racks_update_request, + build_network_tap_rules_create_request, + build_network_tap_rules_delete_request, + build_network_tap_rules_get_request, + build_network_tap_rules_list_by_resource_group_request, + build_network_tap_rules_list_by_subscription_request, + build_network_tap_rules_resync_request, + build_network_tap_rules_update_administrative_state_request, + build_network_tap_rules_update_request, + build_network_tap_rules_validate_configuration_request, + build_network_taps_create_request, + build_network_taps_delete_request, + build_network_taps_get_request, + build_network_taps_list_by_resource_group_request, + build_network_taps_list_by_subscription_request, + build_network_taps_resync_request, + build_network_taps_update_administrative_state_request, + build_network_taps_update_request, + build_network_to_network_interconnects_create_request, + build_network_to_network_interconnects_delete_request, + build_network_to_network_interconnects_get_request, + build_network_to_network_interconnects_list_by_network_fabric_request, + build_network_to_network_interconnects_update_administrative_state_request, + build_network_to_network_interconnects_update_bfd_administrative_state_request, + build_network_to_network_interconnects_update_npb_static_route_bfd_administrative_state_request, + build_network_to_network_interconnects_update_request, + build_operations_list_request, + build_route_policies_commit_configuration_request, + build_route_policies_create_request, + build_route_policies_delete_request, + build_route_policies_get_request, + build_route_policies_list_by_resource_group_request, + build_route_policies_list_by_subscription_request, + build_route_policies_update_administrative_state_request, + build_route_policies_update_request, + build_route_policies_validate_configuration_request, +) +from .._configuration import ManagedNetworkFabricClientConfiguration T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] +JSON = MutableMapping[str, Any] +List = list class Operations: @@ -39,36 +259,819 @@ class Operations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricMgmtClient`'s + :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricClient`'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._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: - """Returns list of all operations. + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Operation"]: + """List the operations for the provider. - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Operation or the result of cls(response) + :return: An iterator like instance of Operation :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.Operation] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Operation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class AccessControlListsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricClient`'s + :attr:`access_control_lists` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, access_control_list_name: str, **kwargs: Any + ) -> _models.AccessControlList: + """Implements Access Control List GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :return: AccessControlList. The AccessControlList is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.AccessControlList + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AccessControlList] = kwargs.pop("cls", None) + + _request = build_access_control_lists_get_request( + resource_group_name=resource_group_name, + access_control_list_name=access_control_list_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.AccessControlList, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + access_control_list_name: str, + body: Union[_models.AccessControlList, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_access_control_lists_create_request( + resource_group_name=resource_group_name, + access_control_list_name=access_control_list_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + access_control_list_name: str, + body: _models.AccessControlList, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AccessControlList]: + """Implements Access Control List PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.AccessControlList + :keyword content_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 AccessControlList. The AccessControlList is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.AccessControlList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + access_control_list_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AccessControlList]: + """Implements Access Control List PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 AccessControlList. The AccessControlList is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.AccessControlList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + access_control_list_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AccessControlList]: + """Implements Access Control List PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :param body: Request payload. Required. + :type body: IO[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 AccessControlList. The AccessControlList is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.AccessControlList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + access_control_list_name: str, + body: Union[_models.AccessControlList, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.AccessControlList]: + """Implements Access Control List PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :param body: Request payload. Is one of the following types: AccessControlList, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.AccessControlList or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns AccessControlList. The AccessControlList is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.AccessControlList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AccessControlList] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + access_control_list_name=access_control_list_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.AccessControlList, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AccessControlList].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AccessControlList]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + access_control_list_name: str, + body: Union[_models.AccessControlListPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_access_control_lists_update_request( + resource_group_name=resource_group_name, + access_control_list_name=access_control_list_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + access_control_list_name: str, + body: _models.AccessControlListPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AccessControlList]: + """API to update certain properties of the Access Control List resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :param body: Access Control List properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.AccessControlListPatch + :keyword content_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 AccessControlList. The AccessControlList is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.AccessControlList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + access_control_list_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AccessControlList]: + """API to update certain properties of the Access Control List resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :param body: Access Control List properties to update. Required. + :type body: JSON + :keyword content_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 AccessControlList. The AccessControlList is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.AccessControlList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + access_control_list_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AccessControlList]: + """API to update certain properties of the Access Control List resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :param body: Access Control List properties to update. Required. + :type body: IO[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 AccessControlList. The AccessControlList is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.AccessControlList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + access_control_list_name: str, + body: Union[_models.AccessControlListPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.AccessControlList]: + """API to update certain properties of the Access Control List resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :param body: Access Control List properties to update. Is one of the following types: + AccessControlListPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.AccessControlListPatch or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns AccessControlList. The AccessControlList is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.AccessControlList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AccessControlList] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + access_control_list_name=access_control_list_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.AccessControlList, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AccessControlList].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AccessControlList]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, access_control_list_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_access_control_lists_delete_request( + resource_group_name=resource_group_name, + access_control_list_name=access_control_list_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, access_control_list_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Implements Access Control List DELETE method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + access_control_list_name=access_control_list_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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 + ) -> AsyncItemPaged["_models.AccessControlList"]: + """Implements AccessControlLists list by resource group GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of AccessControlList + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.AccessControlList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + cls: ClsType[List[_models.AccessControlList]] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -79,14 +1082,19 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( - api_version=api_version, - template_url=self.list.metadata["url"], + _request = build_access_control_lists_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -98,37 +1106,34147 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _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 + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.AccessControlList], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.ManagedNetworkFabric/operations"} + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.AccessControlList"]: + """Implements AccessControlLists list by subscription GET method. + + :return: An iterator like instance of AccessControlList + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.AccessControlList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AccessControlList]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_access_control_lists_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.AccessControlList], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "access_control_list_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _update_administrative_state_initial( + self, + resource_group_name: str, + access_control_list_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_access_control_lists_update_administrative_state_request( + resource_group_name=resource_group_name, + access_control_list_name=access_control_list_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + access_control_list_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + access_control_list_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + access_control_list_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :param body: Request payload. Required. + :type body: IO[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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "access_control_list_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_update_administrative_state( + self, + resource_group_name: str, + access_control_list_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateAdministrativeStateResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_administrative_state_initial( + resource_group_name=resource_group_name, + access_control_list_name=access_control_list_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.UpdateAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.UpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.UpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _resync_initial( + self, resource_group_name: str, access_control_list_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_access_control_lists_resync_request( + resource_group_name=resource_group_name, + access_control_list_name=access_control_list_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_resync( + self, resource_group_name: str, access_control_list_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :return: An instance of AsyncLROPoller that returns CommonPostActionResponseForStateUpdate. The + CommonPostActionResponseForStateUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._resync_initial( + resource_group_name=resource_group_name, + access_control_list_name=access_control_list_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.CommonPostActionResponseForStateUpdate, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _validate_configuration_initial( + self, resource_group_name: str, access_control_list_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_access_control_lists_validate_configuration_request( + resource_group_name=resource_group_name, + access_control_list_name=access_control_list_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_validate_configuration( + self, resource_group_name: str, access_control_list_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ValidateConfigurationResponse]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :return: An instance of AsyncLROPoller that returns ValidateConfigurationResponse. The + ValidateConfigurationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ValidateConfigurationResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._validate_configuration_initial( + resource_group_name=resource_group_name, + access_control_list_name=access_control_list_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ValidateConfigurationResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ValidateConfigurationResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ValidateConfigurationResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class InternetGatewayRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricClient`'s + :attr:`internet_gateway_rules` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, internet_gateway_rule_name: str, **kwargs: Any + ) -> _models.InternetGatewayRule: + """Gets an Internet Gateway Rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. + :type internet_gateway_rule_name: str + :return: InternetGatewayRule. The InternetGatewayRule is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.InternetGatewayRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.InternetGatewayRule] = kwargs.pop("cls", None) + + _request = build_internet_gateway_rules_get_request( + resource_group_name=resource_group_name, + internet_gateway_rule_name=internet_gateway_rule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.InternetGatewayRule, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + internet_gateway_rule_name: str, + body: Union[_models.InternetGatewayRule, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_internet_gateway_rules_create_request( + resource_group_name=resource_group_name, + internet_gateway_rule_name=internet_gateway_rule_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + internet_gateway_rule_name: str, + body: _models.InternetGatewayRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InternetGatewayRule]: + """Creates an Internet Gateway rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. + :type internet_gateway_rule_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.InternetGatewayRule + :keyword content_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 InternetGatewayRule. The + InternetGatewayRule is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + internet_gateway_rule_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InternetGatewayRule]: + """Creates an Internet Gateway rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. + :type internet_gateway_rule_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 InternetGatewayRule. The + InternetGatewayRule is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + internet_gateway_rule_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InternetGatewayRule]: + """Creates an Internet Gateway rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. + :type internet_gateway_rule_name: str + :param body: Request payload. Required. + :type body: IO[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 InternetGatewayRule. The + InternetGatewayRule is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + internet_gateway_rule_name: str, + body: Union[_models.InternetGatewayRule, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.InternetGatewayRule]: + """Creates an Internet Gateway rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. + :type internet_gateway_rule_name: str + :param body: Request payload. Is one of the following types: InternetGatewayRule, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.InternetGatewayRule or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns InternetGatewayRule. The + InternetGatewayRule is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InternetGatewayRule] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + internet_gateway_rule_name=internet_gateway_rule_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.InternetGatewayRule, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.InternetGatewayRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.InternetGatewayRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + internet_gateway_rule_name: str, + body: Union[_models.InternetGatewayRulePatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_internet_gateway_rules_update_request( + resource_group_name=resource_group_name, + internet_gateway_rule_name=internet_gateway_rule_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + internet_gateway_rule_name: str, + body: _models.InternetGatewayRulePatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InternetGatewayRule]: + """API to update certain properties of the Internet Gateway Rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. + :type internet_gateway_rule_name: str + :param body: Internet Gateway Rule properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.InternetGatewayRulePatch + :keyword content_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 InternetGatewayRule. The + InternetGatewayRule is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + internet_gateway_rule_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InternetGatewayRule]: + """API to update certain properties of the Internet Gateway Rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. + :type internet_gateway_rule_name: str + :param body: Internet Gateway Rule properties to update. Required. + :type body: JSON + :keyword content_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 InternetGatewayRule. The + InternetGatewayRule is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + internet_gateway_rule_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InternetGatewayRule]: + """API to update certain properties of the Internet Gateway Rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. + :type internet_gateway_rule_name: str + :param body: Internet Gateway Rule properties to update. Required. + :type body: IO[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 InternetGatewayRule. The + InternetGatewayRule is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + internet_gateway_rule_name: str, + body: Union[_models.InternetGatewayRulePatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.InternetGatewayRule]: + """API to update certain properties of the Internet Gateway Rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. + :type internet_gateway_rule_name: str + :param body: Internet Gateway Rule properties to update. Is one of the following types: + InternetGatewayRulePatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.InternetGatewayRulePatch or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns InternetGatewayRule. The + InternetGatewayRule is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InternetGatewayRule] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + internet_gateway_rule_name=internet_gateway_rule_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.InternetGatewayRule, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.InternetGatewayRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.InternetGatewayRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, internet_gateway_rule_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_internet_gateway_rules_delete_request( + resource_group_name=resource_group_name, + internet_gateway_rule_name=internet_gateway_rule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, internet_gateway_rule_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Implements Internet Gateway Rules DELETE method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. + :type internet_gateway_rule_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + internet_gateway_rule_name=internet_gateway_rule_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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 + ) -> AsyncItemPaged["_models.InternetGatewayRule"]: + """Implements Internet Gateway Rules list by resource group GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of InternetGatewayRule + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.InternetGatewayRule]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_internet_gateway_rules_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.InternetGatewayRule], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> AsyncItemPaged["_models.InternetGatewayRule"]: + """List all Internet Gateway rules in the given subscription. + + :return: An iterator like instance of InternetGatewayRule + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.InternetGatewayRule]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_internet_gateway_rules_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.InternetGatewayRule], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class InternetGatewaysOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricClient`'s + :attr:`internet_gateways` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_group_name: str, internet_gateway_name: str, **kwargs: Any) -> _models.InternetGateway: + """Implements Gateway GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_name: Name of the Internet Gateway. Required. + :type internet_gateway_name: str + :return: InternetGateway. The InternetGateway is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.InternetGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.InternetGateway] = kwargs.pop("cls", None) + + _request = build_internet_gateways_get_request( + resource_group_name=resource_group_name, + internet_gateway_name=internet_gateway_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.InternetGateway, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + internet_gateway_name: str, + body: Union[_models.InternetGateway, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_internet_gateways_create_request( + resource_group_name=resource_group_name, + internet_gateway_name=internet_gateway_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + internet_gateway_name: str, + body: _models.InternetGateway, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InternetGateway]: + """Creates a Network Fabric Service Internet Gateway resource instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_name: Name of the Internet Gateway. Required. + :type internet_gateway_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.InternetGateway + :keyword content_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 InternetGateway. The InternetGateway is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternetGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + internet_gateway_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InternetGateway]: + """Creates a Network Fabric Service Internet Gateway resource instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_name: Name of the Internet Gateway. Required. + :type internet_gateway_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 InternetGateway. The InternetGateway is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternetGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + internet_gateway_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InternetGateway]: + """Creates a Network Fabric Service Internet Gateway resource instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_name: Name of the Internet Gateway. Required. + :type internet_gateway_name: str + :param body: Request payload. Required. + :type body: IO[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 InternetGateway. The InternetGateway is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternetGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + internet_gateway_name: str, + body: Union[_models.InternetGateway, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.InternetGateway]: + """Creates a Network Fabric Service Internet Gateway resource instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_name: Name of the Internet Gateway. Required. + :type internet_gateway_name: str + :param body: Request payload. Is one of the following types: InternetGateway, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.InternetGateway or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns InternetGateway. The InternetGateway is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternetGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InternetGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + internet_gateway_name=internet_gateway_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.InternetGateway, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.InternetGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.InternetGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + internet_gateway_name: str, + body: Union[_models.InternetGatewayPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_internet_gateways_update_request( + resource_group_name=resource_group_name, + internet_gateway_name=internet_gateway_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + internet_gateway_name: str, + body: _models.InternetGatewayPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InternetGateway]: + """Execute patch on Network Fabric Service Internet Gateway. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_name: Name of the Internet Gateway. Required. + :type internet_gateway_name: str + :param body: API to update certain properties of the InternetGateway resource.. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.InternetGatewayPatch + :keyword content_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 InternetGateway. The InternetGateway is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternetGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + internet_gateway_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InternetGateway]: + """Execute patch on Network Fabric Service Internet Gateway. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_name: Name of the Internet Gateway. Required. + :type internet_gateway_name: str + :param body: API to update certain properties of the InternetGateway resource.. Required. + :type body: JSON + :keyword content_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 InternetGateway. The InternetGateway is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternetGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + internet_gateway_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InternetGateway]: + """Execute patch on Network Fabric Service Internet Gateway. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_name: Name of the Internet Gateway. Required. + :type internet_gateway_name: str + :param body: API to update certain properties of the InternetGateway resource.. Required. + :type body: IO[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 InternetGateway. The InternetGateway is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternetGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + internet_gateway_name: str, + body: Union[_models.InternetGatewayPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.InternetGateway]: + """Execute patch on Network Fabric Service Internet Gateway. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_name: Name of the Internet Gateway. Required. + :type internet_gateway_name: str + :param body: API to update certain properties of the InternetGateway resource.. Is one of the + following types: InternetGatewayPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.InternetGatewayPatch or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns InternetGateway. The InternetGateway is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternetGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InternetGateway] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + internet_gateway_name=internet_gateway_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.InternetGateway, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.InternetGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.InternetGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, internet_gateway_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_internet_gateways_delete_request( + resource_group_name=resource_group_name, + internet_gateway_name=internet_gateway_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, internet_gateway_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Execute a delete on Network Fabric Service Internet Gateway. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_name: Name of the Internet Gateway. Required. + :type internet_gateway_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + internet_gateway_name=internet_gateway_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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 + ) -> AsyncItemPaged["_models.InternetGateway"]: + """Displays Internet Gateways list by resource group GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of InternetGateway + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.InternetGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.InternetGateway]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_internet_gateways_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.InternetGateway], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> AsyncItemPaged["_models.InternetGateway"]: + """Displays Internet Gateways list by subscription GET method. + + :return: An iterator like instance of InternetGateway + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.InternetGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.InternetGateway]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_internet_gateways_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.InternetGateway], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class IpCommunitiesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricClient`'s + :attr:`ip_communities` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_group_name: str, ip_community_name: str, **kwargs: Any) -> _models.IpCommunity: + """Implements an IP Community GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_community_name: Name of the IP Community. Required. + :type ip_community_name: str + :return: IpCommunity. The IpCommunity is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.IpCommunity + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.IpCommunity] = kwargs.pop("cls", None) + + _request = build_ip_communities_get_request( + resource_group_name=resource_group_name, + ip_community_name=ip_community_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.IpCommunity, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + ip_community_name: str, + body: Union[_models.IpCommunity, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ip_communities_create_request( + resource_group_name=resource_group_name, + ip_community_name=ip_community_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + ip_community_name: str, + body: _models.IpCommunity, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IpCommunity]: + """Implements an IP Community PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_community_name: Name of the IP Community. Required. + :type ip_community_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.IpCommunity + :keyword content_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 IpCommunity. The IpCommunity is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + ip_community_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IpCommunity]: + """Implements an IP Community PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_community_name: Name of the IP Community. Required. + :type ip_community_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 IpCommunity. The IpCommunity is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + ip_community_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IpCommunity]: + """Implements an IP Community PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_community_name: Name of the IP Community. Required. + :type ip_community_name: str + :param body: Request payload. Required. + :type body: IO[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 IpCommunity. The IpCommunity is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + ip_community_name: str, + body: Union[_models.IpCommunity, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.IpCommunity]: + """Implements an IP Community PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_community_name: Name of the IP Community. Required. + :type ip_community_name: str + :param body: Request payload. Is one of the following types: IpCommunity, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.IpCommunity or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns IpCommunity. The IpCommunity is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IpCommunity] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + ip_community_name=ip_community_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.IpCommunity, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.IpCommunity].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.IpCommunity]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + ip_community_name: str, + body: Union[_models.IpCommunityPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ip_communities_update_request( + resource_group_name=resource_group_name, + ip_community_name=ip_community_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + ip_community_name: str, + body: _models.IpCommunityPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IpCommunity]: + """API to update certain properties of the IP Community resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_community_name: Name of the IP Community. Required. + :type ip_community_name: str + :param body: IP Community properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.IpCommunityPatch + :keyword content_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 IpCommunity. The IpCommunity is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + ip_community_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IpCommunity]: + """API to update certain properties of the IP Community resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_community_name: Name of the IP Community. Required. + :type ip_community_name: str + :param body: IP Community properties to update. Required. + :type body: JSON + :keyword content_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 IpCommunity. The IpCommunity is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + ip_community_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IpCommunity]: + """API to update certain properties of the IP Community resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_community_name: Name of the IP Community. Required. + :type ip_community_name: str + :param body: IP Community properties to update. Required. + :type body: IO[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 IpCommunity. The IpCommunity is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + ip_community_name: str, + body: Union[_models.IpCommunityPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.IpCommunity]: + """API to update certain properties of the IP Community resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_community_name: Name of the IP Community. Required. + :type ip_community_name: str + :param body: IP Community properties to update. Is one of the following types: + IpCommunityPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.IpCommunityPatch or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns IpCommunity. The IpCommunity is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IpCommunity] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + ip_community_name=ip_community_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.IpCommunity, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.IpCommunity].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.IpCommunity]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, ip_community_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_ip_communities_delete_request( + resource_group_name=resource_group_name, + ip_community_name=ip_community_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, ip_community_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Implements IP Community DELETE method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_community_name: Name of the IP Community. Required. + :type ip_community_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + ip_community_name=ip_community_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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) -> AsyncItemPaged["_models.IpCommunity"]: + """Implements IP Communities list by resource group GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of IpCommunity + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.IpCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.IpCommunity]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_communities_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.IpCommunity], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> AsyncItemPaged["_models.IpCommunity"]: + """Implements IP Communities list by subscription GET method. + + :return: An iterator like instance of IpCommunity + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.IpCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.IpCommunity]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_communities_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.IpCommunity], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class IpExtendedCommunitiesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricClient`'s + :attr:`ip_extended_communities` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, ip_extended_community_name: str, **kwargs: Any + ) -> _models.IpExtendedCommunity: + """Implements IP Extended Community GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_extended_community_name: Name of the IP Extended Community. Required. + :type ip_extended_community_name: str + :return: IpExtendedCommunity. The IpExtendedCommunity is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.IpExtendedCommunity] = kwargs.pop("cls", None) + + _request = build_ip_extended_communities_get_request( + resource_group_name=resource_group_name, + ip_extended_community_name=ip_extended_community_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.IpExtendedCommunity, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + ip_extended_community_name: str, + body: Union[_models.IpExtendedCommunity, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ip_extended_communities_create_request( + resource_group_name=resource_group_name, + ip_extended_community_name=ip_extended_community_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + ip_extended_community_name: str, + body: _models.IpExtendedCommunity, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IpExtendedCommunity]: + """Implements IP Extended Community PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_extended_community_name: Name of the IP Extended Community. Required. + :type ip_extended_community_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity + :keyword content_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 IpExtendedCommunity. The + IpExtendedCommunity is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + ip_extended_community_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IpExtendedCommunity]: + """Implements IP Extended Community PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_extended_community_name: Name of the IP Extended Community. Required. + :type ip_extended_community_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 IpExtendedCommunity. The + IpExtendedCommunity is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + ip_extended_community_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IpExtendedCommunity]: + """Implements IP Extended Community PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_extended_community_name: Name of the IP Extended Community. Required. + :type ip_extended_community_name: str + :param body: Request payload. Required. + :type body: IO[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 IpExtendedCommunity. The + IpExtendedCommunity is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + ip_extended_community_name: str, + body: Union[_models.IpExtendedCommunity, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.IpExtendedCommunity]: + """Implements IP Extended Community PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_extended_community_name: Name of the IP Extended Community. Required. + :type ip_extended_community_name: str + :param body: Request payload. Is one of the following types: IpExtendedCommunity, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns IpExtendedCommunity. The + IpExtendedCommunity is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IpExtendedCommunity] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + ip_extended_community_name=ip_extended_community_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.IpExtendedCommunity, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.IpExtendedCommunity].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.IpExtendedCommunity]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + ip_extended_community_name: str, + body: Union[_models.IpExtendedCommunityPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ip_extended_communities_update_request( + resource_group_name=resource_group_name, + ip_extended_community_name=ip_extended_community_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + ip_extended_community_name: str, + body: _models.IpExtendedCommunityPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IpExtendedCommunity]: + """API to update certain properties of the IP Extended Community resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_extended_community_name: Name of the IP Extended Community. Required. + :type ip_extended_community_name: str + :param body: IP Extended Community properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityPatch + :keyword content_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 IpExtendedCommunity. The + IpExtendedCommunity is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + ip_extended_community_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IpExtendedCommunity]: + """API to update certain properties of the IP Extended Community resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_extended_community_name: Name of the IP Extended Community. Required. + :type ip_extended_community_name: str + :param body: IP Extended Community properties to update. Required. + :type body: JSON + :keyword content_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 IpExtendedCommunity. The + IpExtendedCommunity is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + ip_extended_community_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IpExtendedCommunity]: + """API to update certain properties of the IP Extended Community resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_extended_community_name: Name of the IP Extended Community. Required. + :type ip_extended_community_name: str + :param body: IP Extended Community properties to update. Required. + :type body: IO[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 IpExtendedCommunity. The + IpExtendedCommunity is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + ip_extended_community_name: str, + body: Union[_models.IpExtendedCommunityPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.IpExtendedCommunity]: + """API to update certain properties of the IP Extended Community resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_extended_community_name: Name of the IP Extended Community. Required. + :type ip_extended_community_name: str + :param body: IP Extended Community properties to update. Is one of the following types: + IpExtendedCommunityPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityPatch or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns IpExtendedCommunity. The + IpExtendedCommunity is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IpExtendedCommunity] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + ip_extended_community_name=ip_extended_community_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.IpExtendedCommunity, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.IpExtendedCommunity].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.IpExtendedCommunity]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, ip_extended_community_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_ip_extended_communities_delete_request( + resource_group_name=resource_group_name, + ip_extended_community_name=ip_extended_community_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, ip_extended_community_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Implements IP Extended Community DELETE method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_extended_community_name: Name of the IP Extended Community. Required. + :type ip_extended_community_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + ip_extended_community_name=ip_extended_community_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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 + ) -> AsyncItemPaged["_models.IpExtendedCommunity"]: + """Implements IpExtendedCommunities list by resource group GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of IpExtendedCommunity + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.IpExtendedCommunity]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_extended_communities_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.IpExtendedCommunity], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> AsyncItemPaged["_models.IpExtendedCommunity"]: + """Implements IpExtendedCommunities list by subscription GET method. + + :return: An iterator like instance of IpExtendedCommunity + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.IpExtendedCommunity]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_extended_communities_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.IpExtendedCommunity], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class IpPrefixesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricClient`'s + :attr:`ip_prefixes` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_group_name: str, ip_prefix_name: str, **kwargs: Any) -> _models.IpPrefix: + """Implements IP Prefix GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_prefix_name: Name of the IP Prefix. Required. + :type ip_prefix_name: str + :return: IpPrefix. The IpPrefix is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.IpPrefix + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.IpPrefix] = kwargs.pop("cls", None) + + _request = build_ip_prefixes_get_request( + resource_group_name=resource_group_name, + ip_prefix_name=ip_prefix_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.IpPrefix, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + ip_prefix_name: str, + body: Union[_models.IpPrefix, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ip_prefixes_create_request( + resource_group_name=resource_group_name, + ip_prefix_name=ip_prefix_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + ip_prefix_name: str, + body: _models.IpPrefix, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IpPrefix]: + """Implements IP Prefix PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_prefix_name: Name of the IP Prefix. Required. + :type ip_prefix_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.IpPrefix + :keyword content_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 IpPrefix. The IpPrefix is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + ip_prefix_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IpPrefix]: + """Implements IP Prefix PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_prefix_name: Name of the IP Prefix. Required. + :type ip_prefix_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 IpPrefix. The IpPrefix is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + ip_prefix_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IpPrefix]: + """Implements IP Prefix PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_prefix_name: Name of the IP Prefix. Required. + :type ip_prefix_name: str + :param body: Request payload. Required. + :type body: IO[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 IpPrefix. The IpPrefix is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + ip_prefix_name: str, + body: Union[_models.IpPrefix, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.IpPrefix]: + """Implements IP Prefix PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_prefix_name: Name of the IP Prefix. Required. + :type ip_prefix_name: str + :param body: Request payload. Is one of the following types: IpPrefix, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.IpPrefix or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns IpPrefix. The IpPrefix is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IpPrefix] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + ip_prefix_name=ip_prefix_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.IpPrefix, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.IpPrefix].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.IpPrefix]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + ip_prefix_name: str, + body: Union[_models.IpPrefixPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ip_prefixes_update_request( + resource_group_name=resource_group_name, + ip_prefix_name=ip_prefix_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + ip_prefix_name: str, + body: _models.IpPrefixPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IpPrefix]: + """API to update certain properties of the IP Prefix resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_prefix_name: Name of the IP Prefix. Required. + :type ip_prefix_name: str + :param body: IP Prefix properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.IpPrefixPatch + :keyword content_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 IpPrefix. The IpPrefix is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + ip_prefix_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IpPrefix]: + """API to update certain properties of the IP Prefix resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_prefix_name: Name of the IP Prefix. Required. + :type ip_prefix_name: str + :param body: IP Prefix properties to update. Required. + :type body: JSON + :keyword content_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 IpPrefix. The IpPrefix is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + ip_prefix_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IpPrefix]: + """API to update certain properties of the IP Prefix resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_prefix_name: Name of the IP Prefix. Required. + :type ip_prefix_name: str + :param body: IP Prefix properties to update. Required. + :type body: IO[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 IpPrefix. The IpPrefix is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + ip_prefix_name: str, + body: Union[_models.IpPrefixPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.IpPrefix]: + """API to update certain properties of the IP Prefix resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_prefix_name: Name of the IP Prefix. Required. + :type ip_prefix_name: str + :param body: IP Prefix properties to update. Is one of the following types: IpPrefixPatch, + JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.IpPrefixPatch or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns IpPrefix. The IpPrefix is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.IpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IpPrefix] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + ip_prefix_name=ip_prefix_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.IpPrefix, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.IpPrefix].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.IpPrefix]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, ip_prefix_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_ip_prefixes_delete_request( + resource_group_name=resource_group_name, + ip_prefix_name=ip_prefix_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, ip_prefix_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Implements IP Prefix DELETE method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_prefix_name: Name of the IP Prefix. Required. + :type ip_prefix_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + ip_prefix_name=ip_prefix_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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) -> AsyncItemPaged["_models.IpPrefix"]: + """Implements IpPrefixes list by resource group GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of IpPrefix + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.IpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.IpPrefix]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_prefixes_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.IpPrefix], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> AsyncItemPaged["_models.IpPrefix"]: + """Implements IpPrefixes list by subscription GET method. + + :return: An iterator like instance of IpPrefix + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.IpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.IpPrefix]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_prefixes_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.IpPrefix], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class L2IsolationDomainsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricClient`'s + :attr:`l2_isolation_domains` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, l2_isolation_domain_name: str, **kwargs: Any + ) -> _models.L2IsolationDomain: + """Implements L2 Isolation Domain GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :return: L2IsolationDomain. The L2IsolationDomain is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.L2IsolationDomain + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.L2IsolationDomain] = kwargs.pop("cls", None) + + _request = build_l2_isolation_domains_get_request( + resource_group_name=resource_group_name, + l2_isolation_domain_name=l2_isolation_domain_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.L2IsolationDomain, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + l2_isolation_domain_name: str, + body: Union[_models.L2IsolationDomain, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_l2_isolation_domains_create_request( + resource_group_name=resource_group_name, + l2_isolation_domain_name=l2_isolation_domain_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + l2_isolation_domain_name: str, + body: _models.L2IsolationDomain, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.L2IsolationDomain]: + """Creates layer 2 network connectivity between compute nodes within a rack and across racks.The + configuration is applied on the devices only after the isolation domain is enabled. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.L2IsolationDomain + :keyword content_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 L2IsolationDomain. The L2IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + l2_isolation_domain_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.L2IsolationDomain]: + """Creates layer 2 network connectivity between compute nodes within a rack and across racks.The + configuration is applied on the devices only after the isolation domain is enabled. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 L2IsolationDomain. The L2IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + l2_isolation_domain_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.L2IsolationDomain]: + """Creates layer 2 network connectivity between compute nodes within a rack and across racks.The + configuration is applied on the devices only after the isolation domain is enabled. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :param body: Request payload. Required. + :type body: IO[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 L2IsolationDomain. The L2IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + l2_isolation_domain_name: str, + body: Union[_models.L2IsolationDomain, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.L2IsolationDomain]: + """Creates layer 2 network connectivity between compute nodes within a rack and across racks.The + configuration is applied on the devices only after the isolation domain is enabled. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :param body: Request payload. Is one of the following types: L2IsolationDomain, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.L2IsolationDomain or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns L2IsolationDomain. The L2IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.L2IsolationDomain] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + l2_isolation_domain_name=l2_isolation_domain_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.L2IsolationDomain, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.L2IsolationDomain].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.L2IsolationDomain]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + l2_isolation_domain_name: str, + body: Union[_models.L2IsolationDomainPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_l2_isolation_domains_update_request( + resource_group_name=resource_group_name, + l2_isolation_domain_name=l2_isolation_domain_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + l2_isolation_domain_name: str, + body: _models.L2IsolationDomainPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.L2IsolationDomain]: + """API to update certain properties of the L2 Isolation Domain resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :param body: API to update certain properties of the L2 Isolation Domain resource.. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.L2IsolationDomainPatch + :keyword content_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 L2IsolationDomain. The L2IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + l2_isolation_domain_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.L2IsolationDomain]: + """API to update certain properties of the L2 Isolation Domain resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :param body: API to update certain properties of the L2 Isolation Domain resource.. Required. + :type body: JSON + :keyword content_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 L2IsolationDomain. The L2IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + l2_isolation_domain_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.L2IsolationDomain]: + """API to update certain properties of the L2 Isolation Domain resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :param body: API to update certain properties of the L2 Isolation Domain resource.. Required. + :type body: IO[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 L2IsolationDomain. The L2IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + l2_isolation_domain_name: str, + body: Union[_models.L2IsolationDomainPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.L2IsolationDomain]: + """API to update certain properties of the L2 Isolation Domain resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :param body: API to update certain properties of the L2 Isolation Domain resource.. Is one of + the following types: L2IsolationDomainPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.L2IsolationDomainPatch or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns L2IsolationDomain. The L2IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.L2IsolationDomain] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + l2_isolation_domain_name=l2_isolation_domain_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.L2IsolationDomain, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.L2IsolationDomain].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.L2IsolationDomain]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, l2_isolation_domain_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_l2_isolation_domains_delete_request( + resource_group_name=resource_group_name, + l2_isolation_domain_name=l2_isolation_domain_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, l2_isolation_domain_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes layer 2 connectivity between compute nodes by managed by named L2 Isolation name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + l2_isolation_domain_name=l2_isolation_domain_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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 + ) -> AsyncItemPaged["_models.L2IsolationDomain"]: + """Displays L2IsolationDomains list by resource group GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of L2IsolationDomain + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.L2IsolationDomain]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_l2_isolation_domains_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.L2IsolationDomain], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> AsyncItemPaged["_models.L2IsolationDomain"]: + """Displays L2IsolationDomains list by subscription GET method. + + :return: An iterator like instance of L2IsolationDomain + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.L2IsolationDomain]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_l2_isolation_domains_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.L2IsolationDomain], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l2_isolation_domain_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _update_administrative_state_initial( + self, + resource_group_name: str, + l2_isolation_domain_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_l2_isolation_domains_update_administrative_state_request( + resource_group_name=resource_group_name, + l2_isolation_domain_name=l2_isolation_domain_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + l2_isolation_domain_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Enables isolation domain across the fabric or on specified racks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + l2_isolation_domain_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Enables isolation domain across the fabric or on specified racks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + l2_isolation_domain_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Enables isolation domain across the fabric or on specified racks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :param body: Request payload. Required. + :type body: IO[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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l2_isolation_domain_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_update_administrative_state( + self, + resource_group_name: str, + l2_isolation_domain_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Enables isolation domain across the fabric or on specified racks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateAdministrativeStateResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_administrative_state_initial( + resource_group_name=resource_group_name, + l2_isolation_domain_name=l2_isolation_domain_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.UpdateAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.UpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.UpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _validate_configuration_initial( + self, resource_group_name: str, l2_isolation_domain_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_l2_isolation_domains_validate_configuration_request( + resource_group_name=resource_group_name, + l2_isolation_domain_name=l2_isolation_domain_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_validate_configuration( + self, resource_group_name: str, l2_isolation_domain_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ValidateConfigurationResponse]: + """Validates the configuration of the resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :return: An instance of AsyncLROPoller that returns ValidateConfigurationResponse. The + ValidateConfigurationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ValidateConfigurationResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._validate_configuration_initial( + resource_group_name=resource_group_name, + l2_isolation_domain_name=l2_isolation_domain_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ValidateConfigurationResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ValidateConfigurationResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ValidateConfigurationResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _commit_configuration_initial( + self, resource_group_name: str, l2_isolation_domain_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_l2_isolation_domains_commit_configuration_request( + resource_group_name=resource_group_name, + l2_isolation_domain_name=l2_isolation_domain_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_commit_configuration( + self, resource_group_name: str, l2_isolation_domain_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: + """Commits the configuration of the given resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :return: An instance of AsyncLROPoller that returns CommonPostActionResponseForStateUpdate. The + CommonPostActionResponseForStateUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._commit_configuration_initial( + resource_group_name=resource_group_name, + l2_isolation_domain_name=l2_isolation_domain_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.CommonPostActionResponseForStateUpdate, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class L3IsolationDomainsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricClient`'s + :attr:`l3_isolation_domains` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any + ) -> _models.L3IsolationDomain: + """Retrieves details of this L3 Isolation Domain. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :return: L3IsolationDomain. The L3IsolationDomain is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.L3IsolationDomain + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.L3IsolationDomain] = kwargs.pop("cls", None) + + _request = build_l3_isolation_domains_get_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.L3IsolationDomain, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + body: Union[_models.L3IsolationDomain, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_l3_isolation_domains_create_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + body: _models.L3IsolationDomain, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.L3IsolationDomain]: + """Create isolation domain resources for layer 3 connectivity between compute nodes and for + communication with external services .This configuration is applied on the devices only after + the creation of networks is completed and isolation domain is enabled. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.L3IsolationDomain + :keyword content_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 L3IsolationDomain. The L3IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.L3IsolationDomain]: + """Create isolation domain resources for layer 3 connectivity between compute nodes and for + communication with external services .This configuration is applied on the devices only after + the creation of networks is completed and isolation domain is enabled. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 L3IsolationDomain. The L3IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.L3IsolationDomain]: + """Create isolation domain resources for layer 3 connectivity between compute nodes and for + communication with external services .This configuration is applied on the devices only after + the creation of networks is completed and isolation domain is enabled. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param body: Request payload. Required. + :type body: IO[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 L3IsolationDomain. The L3IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + body: Union[_models.L3IsolationDomain, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.L3IsolationDomain]: + """Create isolation domain resources for layer 3 connectivity between compute nodes and for + communication with external services .This configuration is applied on the devices only after + the creation of networks is completed and isolation domain is enabled. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param body: Request payload. Is one of the following types: L3IsolationDomain, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.L3IsolationDomain or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns L3IsolationDomain. The L3IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.L3IsolationDomain] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + l3_isolation_domain_name=l3_isolation_domain_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.L3IsolationDomain, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.L3IsolationDomain].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.L3IsolationDomain]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + body: Union[_models.L3IsolationDomainPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_l3_isolation_domains_update_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + body: _models.L3IsolationDomainPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.L3IsolationDomain]: + """API to update certain properties of the L3 Isolation Domain resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param body: API to update certain properties of the L3 Isolation Domain resource. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.L3IsolationDomainPatch + :keyword content_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 L3IsolationDomain. The L3IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.L3IsolationDomain]: + """API to update certain properties of the L3 Isolation Domain resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param body: API to update certain properties of the L3 Isolation Domain resource. Required. + :type body: JSON + :keyword content_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 L3IsolationDomain. The L3IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.L3IsolationDomain]: + """API to update certain properties of the L3 Isolation Domain resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param body: API to update certain properties of the L3 Isolation Domain resource. Required. + :type body: IO[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 L3IsolationDomain. The L3IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + body: Union[_models.L3IsolationDomainPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.L3IsolationDomain]: + """API to update certain properties of the L3 Isolation Domain resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param body: API to update certain properties of the L3 Isolation Domain resource. Is one of + the following types: L3IsolationDomainPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.L3IsolationDomainPatch or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns L3IsolationDomain. The L3IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.L3IsolationDomain] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + l3_isolation_domain_name=l3_isolation_domain_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.L3IsolationDomain, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.L3IsolationDomain].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.L3IsolationDomain]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_l3_isolation_domains_delete_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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 + ) -> AsyncItemPaged["_models.L3IsolationDomain"]: + """Displays L3IsolationDomains list by resource group GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of L3IsolationDomain + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.L3IsolationDomain]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_l3_isolation_domains_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.L3IsolationDomain], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> AsyncItemPaged["_models.L3IsolationDomain"]: + """Displays L3IsolationDomains list by subscription GET method. + + :return: An iterator like instance of L3IsolationDomain + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.L3IsolationDomain]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_l3_isolation_domains_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.L3IsolationDomain], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _update_administrative_state_initial( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_l3_isolation_domains_update_administrative_state_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the administrative state of the L3 Isolation Domain resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the administrative state of the L3 Isolation Domain resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the administrative state of the L3 Isolation Domain resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param body: Request payload. Required. + :type body: IO[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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_update_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the administrative state of the L3 Isolation Domain resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateAdministrativeStateResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_administrative_state_initial( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.UpdateAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.UpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.UpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _validate_configuration_initial( + self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_l3_isolation_domains_validate_configuration_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_validate_configuration( + self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ValidateConfigurationResponse]: + """Validates the configuration of the resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :return: An instance of AsyncLROPoller that returns ValidateConfigurationResponse. The + ValidateConfigurationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ValidateConfigurationResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._validate_configuration_initial( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ValidateConfigurationResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ValidateConfigurationResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ValidateConfigurationResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _commit_configuration_initial( + self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_l3_isolation_domains_commit_configuration_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_commit_configuration( + self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: + """Commits the configuration of the given resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :return: An instance of AsyncLROPoller that returns CommonPostActionResponseForStateUpdate. The + CommonPostActionResponseForStateUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._commit_configuration_initial( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.CommonPostActionResponseForStateUpdate, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class InternalNetworksOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricClient`'s + :attr:`internal_networks` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, l3_isolation_domain_name: str, internal_network_name: str, **kwargs: Any + ) -> _models.InternalNetwork: + """Gets a InternalNetworks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :return: InternalNetwork. The InternalNetwork is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.InternalNetwork + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.InternalNetwork] = kwargs.pop("cls", None) + + _request = build_internal_networks_get_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + internal_network_name=internal_network_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.InternalNetwork, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: Union[_models.InternalNetwork, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_internal_networks_create_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + internal_network_name=internal_network_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: _models.InternalNetwork, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InternalNetwork]: + """Creates InternalNetwork PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.InternalNetwork + :keyword content_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 InternalNetwork. The InternalNetwork is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InternalNetwork]: + """Creates InternalNetwork PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 InternalNetwork. The InternalNetwork is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InternalNetwork]: + """Creates InternalNetwork PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Required. + :type body: IO[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 InternalNetwork. The InternalNetwork is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: Union[_models.InternalNetwork, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.InternalNetwork]: + """Creates InternalNetwork PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Is one of the following types: InternalNetwork, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.InternalNetwork or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns InternalNetwork. The InternalNetwork is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InternalNetwork] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + l3_isolation_domain_name=l3_isolation_domain_name, + internal_network_name=internal_network_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.InternalNetwork, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.InternalNetwork].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.InternalNetwork]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: Union[_models.InternalNetworkPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_internal_networks_update_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + internal_network_name=internal_network_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: _models.InternalNetworkPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InternalNetwork]: + """Updates a InternalNetworks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: InternalNetwork properties to update. Only annotations are supported. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.InternalNetworkPatch + :keyword content_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 InternalNetwork. The InternalNetwork is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InternalNetwork]: + """Updates a InternalNetworks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: InternalNetwork properties to update. Only annotations are supported. Required. + :type body: JSON + :keyword content_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 InternalNetwork. The InternalNetwork is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InternalNetwork]: + """Updates a InternalNetworks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: InternalNetwork properties to update. Only annotations are supported. Required. + :type body: IO[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 InternalNetwork. The InternalNetwork is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: Union[_models.InternalNetworkPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.InternalNetwork]: + """Updates a InternalNetworks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: InternalNetwork properties to update. Only annotations are supported. Is one of + the following types: InternalNetworkPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.InternalNetworkPatch or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns InternalNetwork. The InternalNetwork is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InternalNetwork] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + l3_isolation_domain_name=l3_isolation_domain_name, + internal_network_name=internal_network_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.InternalNetwork, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.InternalNetwork].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.InternalNetwork]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, l3_isolation_domain_name: str, internal_network_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_internal_networks_delete_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + internal_network_name=internal_network_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, l3_isolation_domain_name: str, internal_network_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Implements InternalNetworks DELETE method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + internal_network_name=internal_network_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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_l3_isolation_domain( + self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.InternalNetwork"]: + """Displays InternalNetworks list by resource group GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :return: An iterator like instance of InternalNetwork + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.InternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.InternalNetwork]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_internal_networks_list_by_l3_isolation_domain_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.InternalNetwork], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "internal_network_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _update_administrative_state_initial( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_internal_networks_update_administrative_state_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + internal_network_name=internal_network_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Executes update operation to enable or disable administrative State for InternalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Executes update operation to enable or disable administrative State for InternalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Executes update operation to enable or disable administrative State for InternalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Required. + :type body: IO[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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "internal_network_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_update_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Executes update operation to enable or disable administrative State for InternalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateAdministrativeStateResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_administrative_state_initial( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + internal_network_name=internal_network_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.UpdateAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.UpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.UpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "internal_network_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _update_bgp_administrative_state_initial( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: Union[_models.InternalNetworkUpdateBgpAdministrativeStateRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_internal_networks_update_bgp_administrative_state_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + internal_network_name=internal_network_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_bgp_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: _models.InternalNetworkUpdateBgpAdministrativeStateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InternalNetworkUpdateBgpAdministrativeStateResponse]: + """Update BGP state for internalNetwork. Allowed only on edge devices. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Required. + :type body: + ~azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBgpAdministrativeStateRequest + :keyword content_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 + InternalNetworkUpdateBgpAdministrativeStateResponse. The + InternalNetworkUpdateBgpAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBgpAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_bgp_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InternalNetworkUpdateBgpAdministrativeStateResponse]: + """Update BGP state for internalNetwork. Allowed only on edge devices. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 + InternalNetworkUpdateBgpAdministrativeStateResponse. The + InternalNetworkUpdateBgpAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBgpAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_bgp_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InternalNetworkUpdateBgpAdministrativeStateResponse]: + """Update BGP state for internalNetwork. Allowed only on edge devices. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Required. + :type body: IO[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 + InternalNetworkUpdateBgpAdministrativeStateResponse. The + InternalNetworkUpdateBgpAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBgpAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "internal_network_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_update_bgp_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: Union[_models.InternalNetworkUpdateBgpAdministrativeStateRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.InternalNetworkUpdateBgpAdministrativeStateResponse]: + """Update BGP state for internalNetwork. Allowed only on edge devices. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Is one of the following types: + InternalNetworkUpdateBgpAdministrativeStateRequest, JSON, IO[bytes] Required. + :type body: + ~azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBgpAdministrativeStateRequest or + JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns + InternalNetworkUpdateBgpAdministrativeStateResponse. The + InternalNetworkUpdateBgpAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBgpAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InternalNetworkUpdateBgpAdministrativeStateResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_bgp_administrative_state_initial( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + internal_network_name=internal_network_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.InternalNetworkUpdateBgpAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.InternalNetworkUpdateBgpAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.InternalNetworkUpdateBgpAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "internal_network_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _update_static_route_bfd_administrative_state_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_internal_networks_update_static_route_bfd_administrative_state_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + internal_network_name=internal_network_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_static_route_bfd_administrative_state( # pylint: disable=name-too-long + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Update Static Route BFD administrative state for internalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_static_route_bfd_administrative_state( # pylint: disable=name-too-long + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Update Static Route BFD administrative state for internalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_static_route_bfd_administrative_state( # pylint: disable=name-too-long + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Update Static Route BFD administrative state for internalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Required. + :type body: IO[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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "internal_network_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_update_static_route_bfd_administrative_state( # pylint: disable=name-too-long + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Update Static Route BFD administrative state for internalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateAdministrativeStateResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_static_route_bfd_administrative_state_initial( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + internal_network_name=internal_network_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.UpdateAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.UpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.UpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "internal_network_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _update_bfd_administrative_state_initial( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: Union[_models.InternalNetworkUpdateBfdAdministrativeStateRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_internal_networks_update_bfd_administrative_state_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + internal_network_name=internal_network_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_bfd_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: _models.InternalNetworkUpdateBfdAdministrativeStateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InternalNetworkUpdateBfdAdministrativeStateResponse]: + """BFD administrative state for either static or bgp for internalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Required. + :type body: + ~azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBfdAdministrativeStateRequest + :keyword content_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 + InternalNetworkUpdateBfdAdministrativeStateResponse. The + InternalNetworkUpdateBfdAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBfdAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_bfd_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InternalNetworkUpdateBfdAdministrativeStateResponse]: + """BFD administrative state for either static or bgp for internalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 + InternalNetworkUpdateBfdAdministrativeStateResponse. The + InternalNetworkUpdateBfdAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBfdAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_bfd_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InternalNetworkUpdateBfdAdministrativeStateResponse]: + """BFD administrative state for either static or bgp for internalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Required. + :type body: IO[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 + InternalNetworkUpdateBfdAdministrativeStateResponse. The + InternalNetworkUpdateBfdAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBfdAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "internal_network_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_update_bfd_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: Union[_models.InternalNetworkUpdateBfdAdministrativeStateRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.InternalNetworkUpdateBfdAdministrativeStateResponse]: + """BFD administrative state for either static or bgp for internalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Is one of the following types: + InternalNetworkUpdateBfdAdministrativeStateRequest, JSON, IO[bytes] Required. + :type body: + ~azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBfdAdministrativeStateRequest or + JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns + InternalNetworkUpdateBfdAdministrativeStateResponse. The + InternalNetworkUpdateBfdAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBfdAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InternalNetworkUpdateBfdAdministrativeStateResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_bfd_administrative_state_initial( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + internal_network_name=internal_network_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.InternalNetworkUpdateBfdAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.InternalNetworkUpdateBfdAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.InternalNetworkUpdateBfdAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class ExternalNetworksOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricClient`'s + :attr:`external_networks` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, l3_isolation_domain_name: str, external_network_name: str, **kwargs: Any + ) -> _models.ExternalNetwork: + """Implements ExternalNetworks GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :return: ExternalNetwork. The ExternalNetwork is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.ExternalNetwork + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ExternalNetwork] = kwargs.pop("cls", None) + + _request = build_external_networks_get_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + external_network_name=external_network_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ExternalNetwork, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: Union[_models.ExternalNetwork, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_external_networks_create_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + external_network_name=external_network_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: _models.ExternalNetwork, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExternalNetwork]: + """Creates ExternalNetwork PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.ExternalNetwork + :keyword content_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 ExternalNetwork. The ExternalNetwork is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExternalNetwork]: + """Creates ExternalNetwork PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 ExternalNetwork. The ExternalNetwork is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExternalNetwork]: + """Creates ExternalNetwork PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Required. + :type body: IO[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 ExternalNetwork. The ExternalNetwork is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: Union[_models.ExternalNetwork, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExternalNetwork]: + """Creates ExternalNetwork PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Is one of the following types: ExternalNetwork, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.ExternalNetwork or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ExternalNetwork. The ExternalNetwork is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExternalNetwork] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + l3_isolation_domain_name=l3_isolation_domain_name, + external_network_name=external_network_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ExternalNetwork, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExternalNetwork].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExternalNetwork]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: Union[_models.ExternalNetworkPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_external_networks_update_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + external_network_name=external_network_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: _models.ExternalNetworkPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExternalNetwork]: + """API to update certain properties of the ExternalNetworks resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: ExternalNetwork properties to update. Only annotations are supported. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.ExternalNetworkPatch + :keyword content_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 ExternalNetwork. The ExternalNetwork is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExternalNetwork]: + """API to update certain properties of the ExternalNetworks resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: ExternalNetwork properties to update. Only annotations are supported. Required. + :type body: JSON + :keyword content_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 ExternalNetwork. The ExternalNetwork is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExternalNetwork]: + """API to update certain properties of the ExternalNetworks resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: ExternalNetwork properties to update. Only annotations are supported. Required. + :type body: IO[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 ExternalNetwork. The ExternalNetwork is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: Union[_models.ExternalNetworkPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExternalNetwork]: + """API to update certain properties of the ExternalNetworks resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: ExternalNetwork properties to update. Only annotations are supported. Is one of + the following types: ExternalNetworkPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.ExternalNetworkPatch or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ExternalNetwork. The ExternalNetwork is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExternalNetwork] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + l3_isolation_domain_name=l3_isolation_domain_name, + external_network_name=external_network_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ExternalNetwork, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExternalNetwork].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExternalNetwork]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, l3_isolation_domain_name: str, external_network_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_external_networks_delete_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + external_network_name=external_network_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, l3_isolation_domain_name: str, external_network_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Implements ExternalNetworks DELETE method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + external_network_name=external_network_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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_l3_isolation_domain( + self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ExternalNetwork"]: + """Implements External Networks list by resource group GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :return: An iterator like instance of ExternalNetwork + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ExternalNetwork]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_external_networks_list_by_l3_isolation_domain_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ExternalNetwork], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "external_network_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _update_administrative_state_initial( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_external_networks_update_administrative_state_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + external_network_name=external_network_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Executes update operation to enable or disable administrative State for externalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Executes update operation to enable or disable administrative State for externalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Executes update operation to enable or disable administrative State for externalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Required. + :type body: IO[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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "external_network_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_update_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Executes update operation to enable or disable administrative State for externalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateAdministrativeStateResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_administrative_state_initial( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + external_network_name=external_network_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.UpdateAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.UpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.UpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "external_network_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _update_static_route_bfd_administrative_state_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_external_networks_update_static_route_bfd_administrative_state_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + external_network_name=external_network_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_static_route_bfd_administrative_state( # pylint: disable=name-too-long + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Update Static Route BFD for external Network. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_static_route_bfd_administrative_state( # pylint: disable=name-too-long + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Update Static Route BFD for external Network. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_static_route_bfd_administrative_state( # pylint: disable=name-too-long + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Update Static Route BFD for external Network. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Required. + :type body: IO[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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "external_network_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_update_static_route_bfd_administrative_state( # pylint: disable=name-too-long + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Update Static Route BFD for external Network. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateAdministrativeStateResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_static_route_bfd_administrative_state_initial( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + external_network_name=external_network_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.UpdateAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.UpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.UpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "external_network_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _update_bfd_administrative_state_initial( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: Union[_models.ExternalNetworkUpdateBfdAdministrativeStateRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_external_networks_update_bfd_administrative_state_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + external_network_name=external_network_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_bfd_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: _models.ExternalNetworkUpdateBfdAdministrativeStateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExternalNetworkUpdateBfdAdministrativeStateResponse]: + """BFD administrative state for either static or bgp for internalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Required. + :type body: + ~azure.mgmt.managednetworkfabric.models.ExternalNetworkUpdateBfdAdministrativeStateRequest + :keyword content_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 + ExternalNetworkUpdateBfdAdministrativeStateResponse. The + ExternalNetworkUpdateBfdAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetworkUpdateBfdAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_bfd_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExternalNetworkUpdateBfdAdministrativeStateResponse]: + """BFD administrative state for either static or bgp for internalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 + ExternalNetworkUpdateBfdAdministrativeStateResponse. The + ExternalNetworkUpdateBfdAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetworkUpdateBfdAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_bfd_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExternalNetworkUpdateBfdAdministrativeStateResponse]: + """BFD administrative state for either static or bgp for internalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Required. + :type body: IO[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 + ExternalNetworkUpdateBfdAdministrativeStateResponse. The + ExternalNetworkUpdateBfdAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetworkUpdateBfdAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "external_network_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_update_bfd_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: Union[_models.ExternalNetworkUpdateBfdAdministrativeStateRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExternalNetworkUpdateBfdAdministrativeStateResponse]: + """BFD administrative state for either static or bgp for internalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Is one of the following types: + ExternalNetworkUpdateBfdAdministrativeStateRequest, JSON, IO[bytes] Required. + :type body: + ~azure.mgmt.managednetworkfabric.models.ExternalNetworkUpdateBfdAdministrativeStateRequest or + JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns + ExternalNetworkUpdateBfdAdministrativeStateResponse. The + ExternalNetworkUpdateBfdAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetworkUpdateBfdAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExternalNetworkUpdateBfdAdministrativeStateResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_bfd_administrative_state_initial( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + external_network_name=external_network_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ExternalNetworkUpdateBfdAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExternalNetworkUpdateBfdAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExternalNetworkUpdateBfdAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class NeighborGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricClient`'s + :attr:`neighbor_groups` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_group_name: str, neighbor_group_name: str, **kwargs: Any) -> _models.NeighborGroup: + """Gets the Neighbor Group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param neighbor_group_name: Name of the Neighbor Group. Required. + :type neighbor_group_name: str + :return: NeighborGroup. The NeighborGroup is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.NeighborGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NeighborGroup] = kwargs.pop("cls", None) + + _request = build_neighbor_groups_get_request( + resource_group_name=resource_group_name, + neighbor_group_name=neighbor_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NeighborGroup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + neighbor_group_name: str, + body: Union[_models.NeighborGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_neighbor_groups_create_request( + resource_group_name=resource_group_name, + neighbor_group_name=neighbor_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + neighbor_group_name: str, + body: _models.NeighborGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NeighborGroup]: + """Implements the Neighbor Group PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param neighbor_group_name: Name of the Neighbor Group. Required. + :type neighbor_group_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NeighborGroup + :keyword content_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 NeighborGroup. The NeighborGroup is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NeighborGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + neighbor_group_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NeighborGroup]: + """Implements the Neighbor Group PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param neighbor_group_name: Name of the Neighbor Group. Required. + :type neighbor_group_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NeighborGroup. The NeighborGroup is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NeighborGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + neighbor_group_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NeighborGroup]: + """Implements the Neighbor Group PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param neighbor_group_name: Name of the Neighbor Group. Required. + :type neighbor_group_name: str + :param body: Request payload. Required. + :type body: IO[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 NeighborGroup. The NeighborGroup is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NeighborGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + neighbor_group_name: str, + body: Union[_models.NeighborGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NeighborGroup]: + """Implements the Neighbor Group PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param neighbor_group_name: Name of the Neighbor Group. Required. + :type neighbor_group_name: str + :param body: Request payload. Is one of the following types: NeighborGroup, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NeighborGroup or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns NeighborGroup. The NeighborGroup is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NeighborGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NeighborGroup] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + neighbor_group_name=neighbor_group_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NeighborGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NeighborGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NeighborGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + neighbor_group_name: str, + body: Union[_models.NeighborGroupPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_neighbor_groups_update_request( + resource_group_name=resource_group_name, + neighbor_group_name=neighbor_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + neighbor_group_name: str, + body: _models.NeighborGroupPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NeighborGroup]: + """Updates the Neighbor Group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param neighbor_group_name: Name of the Neighbor Group. Required. + :type neighbor_group_name: str + :param body: Neighbor Group properties to update. Only annotations are supported. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NeighborGroupPatch + :keyword content_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 NeighborGroup. The NeighborGroup is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NeighborGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + neighbor_group_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NeighborGroup]: + """Updates the Neighbor Group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param neighbor_group_name: Name of the Neighbor Group. Required. + :type neighbor_group_name: str + :param body: Neighbor Group properties to update. Only annotations are supported. Required. + :type body: JSON + :keyword content_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 NeighborGroup. The NeighborGroup is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NeighborGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + neighbor_group_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NeighborGroup]: + """Updates the Neighbor Group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param neighbor_group_name: Name of the Neighbor Group. Required. + :type neighbor_group_name: str + :param body: Neighbor Group properties to update. Only annotations are supported. Required. + :type body: IO[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 NeighborGroup. The NeighborGroup is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NeighborGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + neighbor_group_name: str, + body: Union[_models.NeighborGroupPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NeighborGroup]: + """Updates the Neighbor Group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param neighbor_group_name: Name of the Neighbor Group. Required. + :type neighbor_group_name: str + :param body: Neighbor Group properties to update. Only annotations are supported. Is one of the + following types: NeighborGroupPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NeighborGroupPatch or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns NeighborGroup. The NeighborGroup is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NeighborGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NeighborGroup] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + neighbor_group_name=neighbor_group_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NeighborGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NeighborGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NeighborGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, neighbor_group_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_neighbor_groups_delete_request( + resource_group_name=resource_group_name, + neighbor_group_name=neighbor_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, neighbor_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Implements Neighbor Group DELETE method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param neighbor_group_name: Name of the Neighbor Group. Required. + :type neighbor_group_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + neighbor_group_name=neighbor_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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 + ) -> AsyncItemPaged["_models.NeighborGroup"]: + """Displays NeighborGroups list by resource group GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of NeighborGroup + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NeighborGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NeighborGroup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_neighbor_groups_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NeighborGroup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> AsyncItemPaged["_models.NeighborGroup"]: + """Displays NeighborGroups list by subscription GET method. + + :return: An iterator like instance of NeighborGroup + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NeighborGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NeighborGroup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_neighbor_groups_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NeighborGroup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "neighbor_group_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def _resync_initial( + self, resource_group_name: str, neighbor_group_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_neighbor_groups_resync_request( + resource_group_name=resource_group_name, + neighbor_group_name=neighbor_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "neighbor_group_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_resync( + self, resource_group_name: str, neighbor_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.NeighborGroupResyncResponse]: + """Resync the Neighbor Group after a configuration change. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param neighbor_group_name: Name of the Neighbor Group. Required. + :type neighbor_group_name: str + :return: An instance of AsyncLROPoller that returns NeighborGroupResyncResponse. The + NeighborGroupResyncResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NeighborGroupResyncResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NeighborGroupResyncResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._resync_initial( + resource_group_name=resource_group_name, + neighbor_group_name=neighbor_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NeighborGroupResyncResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NeighborGroupResyncResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NeighborGroupResyncResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class NetworkDeviceSkusOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricClient`'s + :attr:`network_device_skus` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, network_device_sku_name: str, **kwargs: Any) -> _models.NetworkDeviceSku: + """Get a Network Device SKU details. + + :param network_device_sku_name: Name of the Network Device SKU. Required. + :type network_device_sku_name: str + :return: NetworkDeviceSku. The NetworkDeviceSku is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkDeviceSku + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkDeviceSku] = kwargs.pop("cls", None) + + _request = build_network_device_skus_get_request( + network_device_sku_name=network_device_sku_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NetworkDeviceSku, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.NetworkDeviceSku"]: + """List Network Device SKUs for the given subscription. + + :return: An iterator like instance of NetworkDeviceSku + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkDeviceSku] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkDeviceSku]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_device_skus_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkDeviceSku], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class NetworkDevicesOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricClient`'s + :attr:`network_devices` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_group_name: str, network_device_name: str, **kwargs: Any) -> _models.NetworkDevice: + """Gets the Network Device resource details. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :return: NetworkDevice. The NetworkDevice is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkDevice + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkDevice] = kwargs.pop("cls", None) + + _request = build_network_devices_get_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NetworkDevice, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + network_device_name: str, + body: Union[_models.NetworkDevice, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_devices_create_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + network_device_name: str, + body: _models.NetworkDevice, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkDevice]: + """Create a Network Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkDevice + :keyword content_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 NetworkDevice. The NetworkDevice is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + network_device_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkDevice]: + """Create a Network Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NetworkDevice. The NetworkDevice is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + network_device_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkDevice]: + """Create a Network Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Required. + :type body: IO[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 NetworkDevice. The NetworkDevice is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + network_device_name: str, + body: Union[_models.NetworkDevice, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkDevice]: + """Create a Network Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Is one of the following types: NetworkDevice, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkDevice or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns NetworkDevice. The NetworkDevice is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkDevice] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_device_name=network_device_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkDevice, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkDevice].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkDevice]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + network_device_name: str, + body: Union[_models.NetworkDevicePatchParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_devices_update_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + network_device_name: str, + body: _models.NetworkDevicePatchParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkDevice]: + """Update certain properties of the Network Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Network Device properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkDevicePatchParameters + :keyword content_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 NetworkDevice. The NetworkDevice is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + network_device_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkDevice]: + """Update certain properties of the Network Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Network Device properties to update. Required. + :type body: JSON + :keyword content_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 NetworkDevice. The NetworkDevice is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + network_device_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkDevice]: + """Update certain properties of the Network Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Network Device properties to update. Required. + :type body: IO[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 NetworkDevice. The NetworkDevice is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + network_device_name: str, + body: Union[_models.NetworkDevicePatchParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkDevice]: + """Update certain properties of the Network Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Network Device properties to update. Is one of the following types: + NetworkDevicePatchParameters, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkDevicePatchParameters or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns NetworkDevice. The NetworkDevice is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkDevice] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + network_device_name=network_device_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkDevice, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkDevice].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkDevice]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, network_device_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_devices_delete_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_device_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete the Network Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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 + ) -> AsyncItemPaged["_models.NetworkDevice"]: + """List all the Network Device resources in a given resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of NetworkDevice + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkDevice]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_devices_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkDevice], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> AsyncItemPaged["_models.NetworkDevice"]: + """List all the Network Device resources in a given subscription. + + :return: An iterator like instance of NetworkDevice + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkDevice]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_devices_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkDevice], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _reboot_initial( + self, + resource_group_name: str, + network_device_name: str, + body: Union[_models.RebootProperties, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_devices_reboot_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_reboot( + self, + resource_group_name: str, + network_device_name: str, + body: _models.RebootProperties, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Reboot the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.RebootProperties + :keyword content_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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_reboot( + self, + resource_group_name: str, + network_device_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Reboot the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_reboot( + self, + resource_group_name: str, + network_device_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Reboot the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Required. + :type body: IO[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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_reboot( + self, + resource_group_name: str, + network_device_name: str, + body: Union[_models.RebootProperties, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Reboot the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Is one of the following types: RebootProperties, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.RebootProperties or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._reboot_initial( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.OperationStatusResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.OperationStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.OperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_device_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def _refresh_configuration_initial( + self, resource_group_name: str, network_device_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_devices_refresh_configuration_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_device_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_refresh_configuration( + self, resource_group_name: str, network_device_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkDeviceRefreshConfigurationResponse]: + """Refreshes the configuration the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :return: An instance of AsyncLROPoller that returns NetworkDeviceRefreshConfigurationResponse. + The NetworkDeviceRefreshConfigurationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDeviceRefreshConfigurationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkDeviceRefreshConfigurationResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._refresh_configuration_initial( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkDeviceRefreshConfigurationResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkDeviceRefreshConfigurationResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkDeviceRefreshConfigurationResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _update_administrative_state_initial( + self, + resource_group_name: str, + network_device_name: str, + body: Union[_models.UpdateDeviceAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_devices_update_administrative_state_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_device_name: str, + body: _models.UpdateDeviceAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkDeviceUpdateAdministrativeStateResponse]: + """Updates the Administrative state of the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateDeviceAdministrativeState + :keyword content_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 + NetworkDeviceUpdateAdministrativeStateResponse. The + NetworkDeviceUpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDeviceUpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_device_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkDeviceUpdateAdministrativeStateResponse]: + """Updates the Administrative state of the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 + NetworkDeviceUpdateAdministrativeStateResponse. The + NetworkDeviceUpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDeviceUpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_device_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkDeviceUpdateAdministrativeStateResponse]: + """Updates the Administrative state of the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Required. + :type body: IO[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 + NetworkDeviceUpdateAdministrativeStateResponse. The + NetworkDeviceUpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDeviceUpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_device_name: str, + body: Union[_models.UpdateDeviceAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkDeviceUpdateAdministrativeStateResponse]: + """Updates the Administrative state of the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Is one of the following types: UpdateDeviceAdministrativeState, + JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateDeviceAdministrativeState or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns + NetworkDeviceUpdateAdministrativeStateResponse. The + NetworkDeviceUpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDeviceUpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkDeviceUpdateAdministrativeStateResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_administrative_state_initial( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkDeviceUpdateAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkDeviceUpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkDeviceUpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _upgrade_initial( + self, + resource_group_name: str, + network_device_name: str, + body: Union[_models.NetworkDeviceUpgradeRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_devices_upgrade_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_upgrade( + self, + resource_group_name: str, + network_device_name: str, + body: _models.NetworkDeviceUpgradeRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkDeviceUpgradeResponse]: + """Upgrades the version of the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkDeviceUpgradeRequest + :keyword content_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 NetworkDeviceUpgradeResponse. The + NetworkDeviceUpgradeResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDeviceUpgradeResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_upgrade( + self, + resource_group_name: str, + network_device_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkDeviceUpgradeResponse]: + """Upgrades the version of the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NetworkDeviceUpgradeResponse. The + NetworkDeviceUpgradeResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDeviceUpgradeResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_upgrade( + self, + resource_group_name: str, + network_device_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkDeviceUpgradeResponse]: + """Upgrades the version of the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Required. + :type body: IO[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 NetworkDeviceUpgradeResponse. The + NetworkDeviceUpgradeResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDeviceUpgradeResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_upgrade( + self, + resource_group_name: str, + network_device_name: str, + body: Union[_models.NetworkDeviceUpgradeRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkDeviceUpgradeResponse]: + """Upgrades the version of the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Is one of the following types: NetworkDeviceUpgradeRequest, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkDeviceUpgradeRequest or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns NetworkDeviceUpgradeResponse. The + NetworkDeviceUpgradeResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDeviceUpgradeResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkDeviceUpgradeResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._upgrade_initial( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkDeviceUpgradeResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkDeviceUpgradeResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkDeviceUpgradeResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2024-06-15-preview", + params_added_on={ + "2024-06-15-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2024-06-15-preview", "2025-07-15"], + ) + async def _run_ro_command_initial( + self, + resource_group_name: str, + network_device_name: str, + body: Union[_models.DeviceRoCommand, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_devices_run_ro_command_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_run_ro_command( + self, + resource_group_name: str, + network_device_name: str, + body: _models.DeviceRoCommand, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CommonPostActionResponseForDeviceROCommandsOperationStatusResult]: + """Run the RO Command on the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request the command. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.DeviceRoCommand + :keyword content_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 + CommonPostActionResponseForDeviceROCommandsOperationStatusResult. The + CommonPostActionResponseForDeviceROCommandsOperationStatusResult is compatible with + MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceROCommandsOperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_run_ro_command( + self, + resource_group_name: str, + network_device_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CommonPostActionResponseForDeviceROCommandsOperationStatusResult]: + """Run the RO Command on the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request the command. Required. + :type body: JSON + :keyword content_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 + CommonPostActionResponseForDeviceROCommandsOperationStatusResult. The + CommonPostActionResponseForDeviceROCommandsOperationStatusResult is compatible with + MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceROCommandsOperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_run_ro_command( + self, + resource_group_name: str, + network_device_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CommonPostActionResponseForDeviceROCommandsOperationStatusResult]: + """Run the RO Command on the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request the command. Required. + :type body: IO[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 + CommonPostActionResponseForDeviceROCommandsOperationStatusResult. The + CommonPostActionResponseForDeviceROCommandsOperationStatusResult is compatible with + MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceROCommandsOperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2024-06-15-preview", + params_added_on={ + "2024-06-15-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2024-06-15-preview", "2025-07-15"], + ) + async def begin_run_ro_command( + self, + resource_group_name: str, + network_device_name: str, + body: Union[_models.DeviceRoCommand, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.CommonPostActionResponseForDeviceROCommandsOperationStatusResult]: + """Run the RO Command on the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request the command. Is one of the following types: DeviceRoCommand, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.DeviceRoCommand or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns + CommonPostActionResponseForDeviceROCommandsOperationStatusResult. The + CommonPostActionResponseForDeviceROCommandsOperationStatusResult is compatible with + MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceROCommandsOperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CommonPostActionResponseForDeviceROCommandsOperationStatusResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._run_ro_command_initial( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize( + _models.CommonPostActionResponseForDeviceROCommandsOperationStatusResult, response.json() + ) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[ + _models.CommonPostActionResponseForDeviceROCommandsOperationStatusResult + ].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.CommonPostActionResponseForDeviceROCommandsOperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _run_rw_command_initial( + self, + resource_group_name: str, + network_device_name: str, + body: Union[_models.DeviceRwCommand, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_devices_run_rw_command_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_run_rw_command( + self, + resource_group_name: str, + network_device_name: str, + body: _models.DeviceRwCommand, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkDeviceRunRwCommandResponse]: + """Run the RW Command on the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request the command. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.DeviceRwCommand + :keyword content_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 NetworkDeviceRunRwCommandResponse. The + NetworkDeviceRunRwCommandResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDeviceRunRwCommandResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_run_rw_command( + self, + resource_group_name: str, + network_device_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkDeviceRunRwCommandResponse]: + """Run the RW Command on the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request the command. Required. + :type body: JSON + :keyword content_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 NetworkDeviceRunRwCommandResponse. The + NetworkDeviceRunRwCommandResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDeviceRunRwCommandResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_run_rw_command( + self, + resource_group_name: str, + network_device_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkDeviceRunRwCommandResponse]: + """Run the RW Command on the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request the command. Required. + :type body: IO[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 NetworkDeviceRunRwCommandResponse. The + NetworkDeviceRunRwCommandResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDeviceRunRwCommandResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_run_rw_command( + self, + resource_group_name: str, + network_device_name: str, + body: Union[_models.DeviceRwCommand, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkDeviceRunRwCommandResponse]: + """Run the RW Command on the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request the command. Is one of the following types: DeviceRwCommand, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.DeviceRwCommand or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns NetworkDeviceRunRwCommandResponse. The + NetworkDeviceRunRwCommandResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDeviceRunRwCommandResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkDeviceRunRwCommandResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._run_rw_command_initial( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkDeviceRunRwCommandResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkDeviceRunRwCommandResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkDeviceRunRwCommandResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_device_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def _resync_passwords_initial( + self, resource_group_name: str, network_device_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_devices_resync_passwords_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_device_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_resync_passwords( + self, resource_group_name: str, network_device_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkDeviceResyncPasswordsResponse]: + """Resync the latest passwords to the Network Device. + + Updates the Network Device to use the latest passwords. Does not generate new passwords. Allows + network devices missed during a previous password rotation to be brought back into sync. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :return: An instance of AsyncLROPoller that returns NetworkDeviceResyncPasswordsResponse. The + NetworkDeviceResyncPasswordsResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDeviceResyncPasswordsResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkDeviceResyncPasswordsResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._resync_passwords_initial( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkDeviceResyncPasswordsResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkDeviceResyncPasswordsResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkDeviceResyncPasswordsResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_device_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def _resync_certificates_initial( + self, resource_group_name: str, network_device_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_devices_resync_certificates_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_device_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_resync_certificates( + self, resource_group_name: str, network_device_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFabricResyncCertificatesResponse]: + """Resync the latest certificates to the Network Device. + + Updates the Network Device to use the latest certificates. Does not generate new certificates. + Allows network devices missed during a previous certificate rotation to be brought back into + sync. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :return: An instance of AsyncLROPoller that returns NetworkFabricResyncCertificatesResponse. + The NetworkFabricResyncCertificatesResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricResyncCertificatesResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkFabricResyncCertificatesResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._resync_certificates_initial( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkFabricResyncCertificatesResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkFabricResyncCertificatesResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkFabricResyncCertificatesResponse]( + 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.managednetworkfabric.aio.ManagedNetworkFabricClient`'s + :attr:`network_interfaces` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_device_name: str, network_interface_name: str, **kwargs: Any + ) -> _models.NetworkInterface: + """Get the Network Interface resource details. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param network_interface_name: Name of the Network Interface. Required. + :type network_interface_name: str + :return: NetworkInterface. The NetworkInterface is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkInterface + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkInterface] = kwargs.pop("cls", None) + + _request = build_network_interfaces_get_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NetworkInterface, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + network_device_name: str, + network_interface_name: str, + body: Union[_models.NetworkInterface, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_interfaces_create_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + network_device_name: str, + network_interface_name: str, + body: _models.NetworkInterface, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkInterface]: + """Create a Network Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param network_interface_name: Name of the Network Interface. Required. + :type network_interface_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.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 NetworkInterface. The NetworkInterface is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + network_device_name: str, + network_interface_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkInterface]: + """Create a Network Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param network_interface_name: Name of the Network Interface. Required. + :type network_interface_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NetworkInterface. The NetworkInterface is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + network_device_name: str, + network_interface_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkInterface]: + """Create a Network Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param network_interface_name: Name of the Network Interface. Required. + :type network_interface_name: str + :param body: Request payload. Required. + :type body: IO[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 NetworkInterface. The NetworkInterface is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + network_device_name: str, + network_interface_name: str, + body: Union[_models.NetworkInterface, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkInterface]: + """Create a Network Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param network_interface_name: Name of the Network Interface. Required. + :type network_interface_name: str + :param body: Request payload. Is one of the following types: NetworkInterface, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkInterface or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns NetworkInterface. The NetworkInterface is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + 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_initial( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + network_interface_name=network_interface_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkInterface, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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 + ) + + async def _update_initial( + self, + resource_group_name: str, + network_device_name: str, + network_interface_name: str, + body: Union[_models.NetworkInterfacePatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_interfaces_update_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + network_device_name: str, + network_interface_name: str, + body: _models.NetworkInterfacePatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkInterface]: + """Update certain properties of the Network Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param network_interface_name: Name of the Network Interface. Required. + :type network_interface_name: str + :param body: NetworkInterface properties to update. Only tags are supported. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkInterfacePatch + :keyword content_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 NetworkInterface. The NetworkInterface is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + network_device_name: str, + network_interface_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkInterface]: + """Update certain properties of the Network Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param network_interface_name: Name of the Network Interface. Required. + :type network_interface_name: str + :param body: NetworkInterface properties to update. Only tags are supported. Required. + :type body: JSON + :keyword content_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 NetworkInterface. The NetworkInterface is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + network_device_name: str, + network_interface_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkInterface]: + """Update certain properties of the Network Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param network_interface_name: Name of the Network Interface. Required. + :type network_interface_name: str + :param body: NetworkInterface properties to update. Only tags are supported. Required. + :type body: IO[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 NetworkInterface. The NetworkInterface is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + network_device_name: str, + network_interface_name: str, + body: Union[_models.NetworkInterfacePatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkInterface]: + """Update certain properties of the Network Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param network_interface_name: Name of the Network Interface. Required. + :type network_interface_name: str + :param body: NetworkInterface properties to update. Only tags are supported. Is one of the + following types: NetworkInterfacePatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkInterfacePatch or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns NetworkInterface. The NetworkInterface is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + 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_initial( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + network_interface_name=network_interface_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkInterface, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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 + ) + + async def _delete_initial( + self, resource_group_name: str, network_device_name: str, network_interface_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_interfaces_delete_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_device_name: str, network_interface_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete the Network Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param network_interface_name: Name of the Network Interface. Required. + :type network_interface_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + network_interface_name=network_interface_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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_network_device( + self, resource_group_name: str, network_device_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.NetworkInterface"]: + """List all the Network Interface resources in a given resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :return: An iterator like instance of NetworkInterface + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkInterface]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_by_network_device_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkInterface], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_device_name", + "network_interface_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _update_administrative_state_initial( + self, + resource_group_name: str, + network_device_name: str, + network_interface_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_interfaces_update_administrative_state_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_device_name: str, + network_interface_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Update the admin state of the Network Interface. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param network_interface_name: Name of the Network Interface. Required. + :type network_interface_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_device_name: str, + network_interface_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Update the admin state of the Network Interface. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param network_interface_name: Name of the Network Interface. Required. + :type network_interface_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_device_name: str, + network_interface_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Update the admin state of the Network Interface. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param network_interface_name: Name of the Network Interface. Required. + :type network_interface_name: str + :param body: Request payload. Required. + :type body: IO[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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_device_name", + "network_interface_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_device_name: str, + network_interface_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Update the admin state of the Network Interface. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param network_interface_name: Name of the Network Interface. Required. + :type network_interface_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateAdministrativeStateResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_administrative_state_initial( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + network_interface_name=network_interface_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.UpdateAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.UpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.UpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class NetworkFabricControllersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricClient`'s + :attr:`network_fabric_controllers` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_fabric_controller_name: str, **kwargs: Any + ) -> _models.NetworkFabricController: + """Shows the provisioning status of Network Fabric Controller. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. + :type network_fabric_controller_name: str + :return: NetworkFabricController. The NetworkFabricController is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkFabricController + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkFabricController] = kwargs.pop("cls", None) + + _request = build_network_fabric_controllers_get_request( + resource_group_name=resource_group_name, + network_fabric_controller_name=network_fabric_controller_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NetworkFabricController, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + network_fabric_controller_name: str, + body: Union[_models.NetworkFabricController, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_fabric_controllers_create_request( + resource_group_name=resource_group_name, + network_fabric_controller_name=network_fabric_controller_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + network_fabric_controller_name: str, + body: _models.NetworkFabricController, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFabricController]: + """Creates a Network Fabric Controller. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. + :type network_fabric_controller_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabricController + :keyword content_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 NetworkFabricController. The + NetworkFabricController is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + network_fabric_controller_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFabricController]: + """Creates a Network Fabric Controller. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. + :type network_fabric_controller_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NetworkFabricController. The + NetworkFabricController is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + network_fabric_controller_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFabricController]: + """Creates a Network Fabric Controller. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. + :type network_fabric_controller_name: str + :param body: Request payload. Required. + :type body: IO[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 NetworkFabricController. The + NetworkFabricController is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + network_fabric_controller_name: str, + body: Union[_models.NetworkFabricController, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFabricController]: + """Creates a Network Fabric Controller. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. + :type network_fabric_controller_name: str + :param body: Request payload. Is one of the following types: NetworkFabricController, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabricController or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns NetworkFabricController. The + NetworkFabricController is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkFabricController] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_fabric_controller_name=network_fabric_controller_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkFabricController, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkFabricController].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkFabricController]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + network_fabric_controller_name: str, + body: Union[_models.NetworkFabricControllerPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_fabric_controllers_update_request( + resource_group_name=resource_group_name, + network_fabric_controller_name=network_fabric_controller_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + network_fabric_controller_name: str, + body: _models.NetworkFabricControllerPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFabricController]: + """Updates are currently not supported for the Network Fabric Controller resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. + :type network_fabric_controller_name: str + :param body: Network Fabric Controller properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabricControllerPatch + :keyword content_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 NetworkFabricController. The + NetworkFabricController is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + network_fabric_controller_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFabricController]: + """Updates are currently not supported for the Network Fabric Controller resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. + :type network_fabric_controller_name: str + :param body: Network Fabric Controller properties to update. Required. + :type body: JSON + :keyword content_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 NetworkFabricController. The + NetworkFabricController is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + network_fabric_controller_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFabricController]: + """Updates are currently not supported for the Network Fabric Controller resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. + :type network_fabric_controller_name: str + :param body: Network Fabric Controller properties to update. Required. + :type body: IO[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 NetworkFabricController. The + NetworkFabricController is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + network_fabric_controller_name: str, + body: Union[_models.NetworkFabricControllerPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFabricController]: + """Updates are currently not supported for the Network Fabric Controller resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. + :type network_fabric_controller_name: str + :param body: Network Fabric Controller properties to update. Is one of the following types: + NetworkFabricControllerPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabricControllerPatch or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns NetworkFabricController. The + NetworkFabricController is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkFabricController] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + network_fabric_controller_name=network_fabric_controller_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkFabricController, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkFabricController].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkFabricController]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, network_fabric_controller_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_fabric_controllers_delete_request( + resource_group_name=resource_group_name, + network_fabric_controller_name=network_fabric_controller_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_fabric_controller_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the Network Fabric Controller resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. + :type network_fabric_controller_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + network_fabric_controller_name=network_fabric_controller_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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 + ) -> AsyncItemPaged["_models.NetworkFabricController"]: + """Lists all the NetworkFabricControllers thats available in the resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of NetworkFabricController + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkFabricController]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_fabric_controllers_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkFabricController], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> AsyncItemPaged["_models.NetworkFabricController"]: + """Lists all the NetworkFabricControllers by subscription. + + :return: An iterator like instance of NetworkFabricController + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkFabricController]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_fabric_controllers_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkFabricController], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class NetworkFabricSkusOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricClient`'s + :attr:`network_fabric_skus` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, network_fabric_sku_name: str, **kwargs: Any) -> _models.NetworkFabricSku: + """Implements Network Fabric SKU GET method. + + :param network_fabric_sku_name: Name of the Network Fabric SKU. Required. + :type network_fabric_sku_name: str + :return: NetworkFabricSku. The NetworkFabricSku is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkFabricSku + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkFabricSku] = kwargs.pop("cls", None) + + _request = build_network_fabric_skus_get_request( + network_fabric_sku_name=network_fabric_sku_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NetworkFabricSku, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.NetworkFabricSku"]: + """Implements Network Fabric SKUs list by subscription GET method. + + :return: An iterator like instance of NetworkFabricSku + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkFabricSku] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkFabricSku]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_fabric_skus_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkFabricSku], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class NetworkFabricsOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricClient`'s + :attr:`network_fabrics` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_group_name: str, network_fabric_name: str, **kwargs: Any) -> _models.NetworkFabric: + """Get Network Fabric resource details. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :return: NetworkFabric. The NetworkFabric is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkFabric + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkFabric] = kwargs.pop("cls", None) + + _request = build_network_fabrics_get_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NetworkFabric, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.NetworkFabric, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_fabrics_create_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + network_fabric_name: str, + body: _models.NetworkFabric, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFabric]: + """Create Network Fabric resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabric + :keyword content_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 NetworkFabric. The NetworkFabric is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabric] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + network_fabric_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFabric]: + """Create Network Fabric resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NetworkFabric. The NetworkFabric is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabric] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + network_fabric_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFabric]: + """Create Network Fabric resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: IO[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 NetworkFabric. The NetworkFabric is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabric] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.NetworkFabric, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFabric]: + """Create Network Fabric resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Is one of the following types: NetworkFabric, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabric or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns NetworkFabric. The NetworkFabric is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabric] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkFabric] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_fabric_name=network_fabric_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkFabric, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkFabric].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkFabric]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.NetworkFabricPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_fabrics_update_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + network_fabric_name: str, + body: _models.NetworkFabricPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFabric]: + """Update certain properties of the Network Fabric resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Network Fabric properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabricPatch + :keyword content_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 NetworkFabric. The NetworkFabric is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabric] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + network_fabric_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFabric]: + """Update certain properties of the Network Fabric resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Network Fabric properties to update. Required. + :type body: JSON + :keyword content_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 NetworkFabric. The NetworkFabric is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabric] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + network_fabric_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFabric]: + """Update certain properties of the Network Fabric resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Network Fabric properties to update. Required. + :type body: IO[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 NetworkFabric. The NetworkFabric is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabric] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.NetworkFabricPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFabric]: + """Update certain properties of the Network Fabric resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Network Fabric properties to update. Is one of the following types: + NetworkFabricPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabricPatch or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns NetworkFabric. The NetworkFabric is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabric] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkFabric] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + network_fabric_name=network_fabric_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkFabric, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkFabric].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkFabric]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_fabrics_delete_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete Network Fabric resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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 + ) -> AsyncItemPaged["_models.NetworkFabric"]: + """List all the Network Fabric resources in the given resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of NetworkFabric + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkFabric] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkFabric]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_fabrics_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkFabric], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> AsyncItemPaged["_models.NetworkFabric"]: + """List all the Network Fabric resources in the given subscription. + + :return: An iterator like instance of NetworkFabric + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkFabric] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkFabric]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_fabrics_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkFabric], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def _provision_initial( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_fabrics_provision_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_provision( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Provisions the underlying resources in the given Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :return: An instance of AsyncLROPoller that returns OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._provision_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.OperationStatusResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.OperationStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.OperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def _deprovision_initial( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_fabrics_deprovision_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_deprovision( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Deprovisions the underlying resources in the given Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :return: An instance of AsyncLROPoller that returns OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._deprovision_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.OperationStatusResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.OperationStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.OperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _upgrade_initial( + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.UpgradeNetworkFabricProperties, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_fabrics_upgrade_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_upgrade( + self, + resource_group_name: str, + network_fabric_name: str, + body: _models.UpgradeNetworkFabricProperties, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Upgrades the version of the underlying resources in the given Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Network Fabric properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpgradeNetworkFabricProperties + :keyword content_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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_upgrade( + self, + resource_group_name: str, + network_fabric_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Upgrades the version of the underlying resources in the given Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Network Fabric properties to update. Required. + :type body: JSON + :keyword content_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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_upgrade( + self, + resource_group_name: str, + network_fabric_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Upgrades the version of the underlying resources in the given Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Network Fabric properties to update. Required. + :type body: IO[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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_upgrade( + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.UpgradeNetworkFabricProperties, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Upgrades the version of the underlying resources in the given Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Network Fabric properties to update. Is one of the following types: + UpgradeNetworkFabricProperties, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpgradeNetworkFabricProperties or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._upgrade_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.OperationStatusResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.OperationStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.OperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def _refresh_configuration_initial( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_fabrics_refresh_configuration_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_refresh_configuration( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Refreshes the configuration of the underlying resources in the given Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :return: An instance of AsyncLROPoller that returns OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._refresh_configuration_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.OperationStatusResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.OperationStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.OperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _update_workload_management_bfd_configuration_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_fabrics_update_workload_management_bfd_configuration_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_workload_management_bfd_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_fabric_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the Workload Management BFD Configuration of the underlying resources in the given + Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_workload_management_bfd_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_fabric_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the Workload Management BFD Configuration of the underlying resources in the given + Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_workload_management_bfd_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_fabric_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the Workload Management BFD Configuration of the underlying resources in the given + Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: IO[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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_update_workload_management_bfd_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the Workload Management BFD Configuration of the underlying resources in the given + Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateAdministrativeStateResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_workload_management_bfd_configuration_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.UpdateAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.UpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.UpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _update_infra_management_bfd_configuration_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_fabrics_update_infra_management_bfd_configuration_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_infra_management_bfd_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_fabric_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the Infra Management BFD Configuration of the underlying resources in the given Network + Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_infra_management_bfd_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_fabric_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the Infra Management BFD Configuration of the underlying resources in the given Network + Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_infra_management_bfd_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_fabric_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the Infra Management BFD Configuration of the underlying resources in the given Network + Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: IO[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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_update_infra_management_bfd_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the Infra Management BFD Configuration of the underlying resources in the given Network + Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateAdministrativeStateResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_infra_management_bfd_configuration_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.UpdateAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.UpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.UpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _validate_configuration_initial( + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.ValidateConfigurationProperties, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_fabrics_validate_configuration_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_validate_configuration( + self, + resource_group_name: str, + network_fabric_name: str, + body: _models.ValidateConfigurationProperties, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ValidateConfigurationResponse]: + """Validates the configuration of the underlying resources in the given Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Validate configuration properties. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.ValidateConfigurationProperties + :keyword content_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 ValidateConfigurationResponse. The + ValidateConfigurationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_validate_configuration( + self, + resource_group_name: str, + network_fabric_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ValidateConfigurationResponse]: + """Validates the configuration of the underlying resources in the given Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Validate configuration properties. Required. + :type body: JSON + :keyword content_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 ValidateConfigurationResponse. The + ValidateConfigurationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_validate_configuration( + self, + resource_group_name: str, + network_fabric_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ValidateConfigurationResponse]: + """Validates the configuration of the underlying resources in the given Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Validate configuration properties. Required. + :type body: IO[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 ValidateConfigurationResponse. The + ValidateConfigurationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_validate_configuration( + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.ValidateConfigurationProperties, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ValidateConfigurationResponse]: + """Validates the configuration of the underlying resources in the given Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Validate configuration properties. Is one of the following types: + ValidateConfigurationProperties, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.ValidateConfigurationProperties or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns ValidateConfigurationResponse. The + ValidateConfigurationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ValidateConfigurationResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._validate_configuration_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ValidateConfigurationResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ValidateConfigurationResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ValidateConfigurationResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def _get_topology_initial( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_fabrics_get_topology_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_get_topology( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.GetTopologyResponse]: + """Gets Topology of the underlying resources in the given Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :return: An instance of AsyncLROPoller that returns GetTopologyResponse. The + GetTopologyResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.GetTopologyResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.GetTopologyResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_topology_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.GetTopologyResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.GetTopologyResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.GetTopologyResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _commit_configuration_initial( + self, + resource_group_name: str, + network_fabric_name: str, + body: Optional[Union[_models.CommitConfigurationRequest, JSON, IO[bytes]]] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" if body else None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_network_fabrics_commit_configuration_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_commit_configuration( + self, + resource_group_name: str, + network_fabric_name: str, + body: Optional[_models.CommitConfigurationRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CommitConfigurationResponse]: + """Atomic update of the given Network Fabric instance. Sync update of NFA resources at Fabric + level. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: The content of the action request. Default value is None. + :type body: ~azure.mgmt.managednetworkfabric.models.CommitConfigurationRequest + :keyword content_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 CommitConfigurationResponse. The + CommitConfigurationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommitConfigurationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_commit_configuration( + self, + resource_group_name: str, + network_fabric_name: str, + body: Optional[JSON] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CommitConfigurationResponse]: + """Atomic update of the given Network Fabric instance. Sync update of NFA resources at Fabric + level. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: The content of the action request. Default value is None. + :type body: JSON + :keyword content_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 CommitConfigurationResponse. The + CommitConfigurationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommitConfigurationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_commit_configuration( + self, + resource_group_name: str, + network_fabric_name: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CommitConfigurationResponse]: + """Atomic update of the given Network Fabric instance. Sync update of NFA resources at Fabric + level. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: The content of the action request. Default value is None. + :type body: IO[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 CommitConfigurationResponse. The + CommitConfigurationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommitConfigurationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_commit_configuration( + self, + resource_group_name: str, + network_fabric_name: str, + body: Optional[Union[_models.CommitConfigurationRequest, JSON, IO[bytes]]] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.CommitConfigurationResponse]: + """Atomic update of the given Network Fabric instance. Sync update of NFA resources at Fabric + level. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: The content of the action request. Is one of the following types: + CommitConfigurationRequest, JSON, IO[bytes] Default value is None. + :type body: ~azure.mgmt.managednetworkfabric.models.CommitConfigurationRequest or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns CommitConfigurationResponse. The + CommitConfigurationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommitConfigurationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None + cls: ClsType[_models.CommitConfigurationResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._commit_configuration_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.CommitConfigurationResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.CommitConfigurationResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.CommitConfigurationResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _commit_batch_status_initial( + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.CommitBatchStatusRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_fabrics_commit_batch_status_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_commit_batch_status( + self, + resource_group_name: str, + network_fabric_name: str, + body: _models.CommitBatchStatusRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CommitBatchStatusOperationResponse]: + """Post action: Returns a status of commit batch operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.CommitBatchStatusRequest + :keyword content_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 CommitBatchStatusOperationResponse. The + CommitBatchStatusOperationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommitBatchStatusOperationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_commit_batch_status( + self, + resource_group_name: str, + network_fabric_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CommitBatchStatusOperationResponse]: + """Post action: Returns a status of commit batch operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 CommitBatchStatusOperationResponse. The + CommitBatchStatusOperationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommitBatchStatusOperationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_commit_batch_status( + self, + resource_group_name: str, + network_fabric_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CommitBatchStatusOperationResponse]: + """Post action: Returns a status of commit batch operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: IO[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 CommitBatchStatusOperationResponse. The + CommitBatchStatusOperationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommitBatchStatusOperationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_commit_batch_status( + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.CommitBatchStatusRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.CommitBatchStatusOperationResponse]: + """Post action: Returns a status of commit batch operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Is one of the following types: CommitBatchStatusRequest, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.CommitBatchStatusRequest or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns CommitBatchStatusOperationResponse. The + CommitBatchStatusOperationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommitBatchStatusOperationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CommitBatchStatusOperationResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._commit_batch_status_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.CommitBatchStatusOperationResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.CommitBatchStatusOperationResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.CommitBatchStatusOperationResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _discard_commit_batch_initial( + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.DiscardCommitBatchRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_fabrics_discard_commit_batch_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_discard_commit_batch( + self, + resource_group_name: str, + network_fabric_name: str, + body: _models.DiscardCommitBatchRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DiscardCommitBatchOperationResponse]: + """Post action: Discards a Batch operation in progress. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.DiscardCommitBatchRequest + :keyword content_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 DiscardCommitBatchOperationResponse. The + DiscardCommitBatchOperationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.DiscardCommitBatchOperationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_discard_commit_batch( + self, + resource_group_name: str, + network_fabric_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DiscardCommitBatchOperationResponse]: + """Post action: Discards a Batch operation in progress. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 DiscardCommitBatchOperationResponse. The + DiscardCommitBatchOperationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.DiscardCommitBatchOperationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_discard_commit_batch( + self, + resource_group_name: str, + network_fabric_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DiscardCommitBatchOperationResponse]: + """Post action: Discards a Batch operation in progress. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: IO[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 DiscardCommitBatchOperationResponse. The + DiscardCommitBatchOperationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.DiscardCommitBatchOperationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_discard_commit_batch( + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.DiscardCommitBatchRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.DiscardCommitBatchOperationResponse]: + """Post action: Discards a Batch operation in progress. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Is one of the following types: DiscardCommitBatchRequest, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.DiscardCommitBatchRequest or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns DiscardCommitBatchOperationResponse. The + DiscardCommitBatchOperationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.DiscardCommitBatchOperationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DiscardCommitBatchOperationResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._discard_commit_batch_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.DiscardCommitBatchOperationResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.DiscardCommitBatchOperationResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.DiscardCommitBatchOperationResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _lock_fabric_initial( + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.NetworkFabricLockRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_fabrics_lock_fabric_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_lock_fabric( + self, + resource_group_name: str, + network_fabric_name: str, + body: _models.NetworkFabricLockRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Post action: Triggers network fabric lock operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabricLockRequest + :keyword content_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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_lock_fabric( + self, + resource_group_name: str, + network_fabric_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Post action: Triggers network fabric lock operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_lock_fabric( + self, + resource_group_name: str, + network_fabric_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Post action: Triggers network fabric lock operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: IO[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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_lock_fabric( + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.NetworkFabricLockRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Post action: Triggers network fabric lock operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Is one of the following types: NetworkFabricLockRequest, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabricLockRequest or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._lock_fabric_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.OperationStatusResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.OperationStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.OperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def _view_device_configuration_initial( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_fabrics_view_device_configuration_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_view_device_configuration( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ViewDeviceConfigurationOperationResponse]: + """Post action: Triggers view of network fabric configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :return: An instance of AsyncLROPoller that returns ViewDeviceConfigurationOperationResponse. + The ViewDeviceConfigurationOperationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ViewDeviceConfigurationOperationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ViewDeviceConfigurationOperationResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._view_device_configuration_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ViewDeviceConfigurationOperationResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ViewDeviceConfigurationOperationResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ViewDeviceConfigurationOperationResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def _arm_configuration_diff_initial( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_fabrics_arm_configuration_diff_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_arm_configuration_diff( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ArmConfigurationDiffOperationResponse]: + """Post action: Triggers diff of NetworkFabric ARM Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :return: An instance of AsyncLROPoller that returns ArmConfigurationDiffOperationResponse. The + ArmConfigurationDiffOperationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ArmConfigurationDiffOperationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ArmConfigurationDiffOperationResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._arm_configuration_diff_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ArmConfigurationDiffOperationResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ArmConfigurationDiffOperationResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ArmConfigurationDiffOperationResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def _rotate_passwords_initial( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_fabrics_rotate_passwords_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_rotate_passwords( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFabricRotatePasswordsResponse]: + """Rotate all passwords on the Terminal Server and Network Devices. + + Creates new passwords, then updates the Terminal Server and Network Devices to use the new + passwords. + + Note that disabled devices cannot be updated and must be resynchronized with the new passwords + once they are enabled. + + Fails if any of the devices could not be updated with the new password. + Failed devices should be resynchronized with the new passwords once possible. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :return: An instance of AsyncLROPoller that returns NetworkFabricRotatePasswordsResponse. The + NetworkFabricRotatePasswordsResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricRotatePasswordsResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkFabricRotatePasswordsResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._rotate_passwords_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkFabricRotatePasswordsResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkFabricRotatePasswordsResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkFabricRotatePasswordsResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def _resync_passwords_initial( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_fabrics_resync_passwords_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_resync_passwords( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFabricResyncPasswordsResponse]: + """Resync the latest passwords to the Terminal Server and Network Devices. + + Updates the Terminal Server and all Network Devices to use the latest passwords. Does not + generate new passwords. + + Allows devices to be brought back in sync after a partially successful password rotation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :return: An instance of AsyncLROPoller that returns NetworkFabricResyncPasswordsResponse. The + NetworkFabricResyncPasswordsResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricResyncPasswordsResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkFabricResyncPasswordsResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._resync_passwords_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkFabricResyncPasswordsResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkFabricResyncPasswordsResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkFabricResyncPasswordsResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def _rotate_certificates_initial( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_fabrics_rotate_certificates_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_rotate_certificates( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFabricRotateCertificatesResponse]: + """Rotate all certificates on Network Devices. + + Creates new certificates, then updates the Network Devices to use the new certificates. Note + that disabled devices cannot be updated and must be resynchronized with the new certificates + once they are enabled. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :return: An instance of AsyncLROPoller that returns NetworkFabricRotateCertificatesResponse. + The NetworkFabricRotateCertificatesResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricRotateCertificatesResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkFabricRotateCertificatesResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._rotate_certificates_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkFabricRotateCertificatesResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkFabricRotateCertificatesResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkFabricRotateCertificatesResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def _resync_certificates_initial( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_fabrics_resync_certificates_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_resync_certificates( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFabricResyncCertificatesResponse]: + """Re-sync all certificates on Network Devices. + + Updates all Network Devices to use the latest certificates. Does not generate new certificates. + Allows network devices missed during a previous certificate rotation to be brought back into + sync. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :return: An instance of AsyncLROPoller that returns NetworkFabricResyncCertificatesResponse. + The NetworkFabricResyncCertificatesResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricResyncCertificatesResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkFabricResyncCertificatesResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._resync_certificates_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkFabricResyncCertificatesResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkFabricResyncCertificatesResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkFabricResyncCertificatesResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class NetworkToNetworkInterconnectsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricClient`'s + :attr:`network_to_network_interconnects` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + **kwargs: Any + ) -> _models.NetworkToNetworkInterconnect: + """Implements NetworkToNetworkInterconnects GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :return: NetworkToNetworkInterconnect. The NetworkToNetworkInterconnect is compatible with + MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkToNetworkInterconnect] = kwargs.pop("cls", None) + + _request = build_network_to_network_interconnects_get_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + network_to_network_interconnect_name=network_to_network_interconnect_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NetworkToNetworkInterconnect, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: Union[_models.NetworkToNetworkInterconnect, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_to_network_interconnects_create_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + network_to_network_interconnect_name=network_to_network_interconnect_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: _models.NetworkToNetworkInterconnect, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkToNetworkInterconnect]: + """Configuration used to setup CE-PE connectivity PUT Method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect + :keyword content_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 NetworkToNetworkInterconnect. The + NetworkToNetworkInterconnect is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkToNetworkInterconnect]: + """Configuration used to setup CE-PE connectivity PUT Method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NetworkToNetworkInterconnect. The + NetworkToNetworkInterconnect is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkToNetworkInterconnect]: + """Configuration used to setup CE-PE connectivity PUT Method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Required. + :type body: IO[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 NetworkToNetworkInterconnect. The + NetworkToNetworkInterconnect is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: Union[_models.NetworkToNetworkInterconnect, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkToNetworkInterconnect]: + """Configuration used to setup CE-PE connectivity PUT Method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Is one of the following types: NetworkToNetworkInterconnect, + JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns NetworkToNetworkInterconnect. The + NetworkToNetworkInterconnect is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkToNetworkInterconnect] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_fabric_name=network_fabric_name, + network_to_network_interconnect_name=network_to_network_interconnect_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkToNetworkInterconnect, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkToNetworkInterconnect].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkToNetworkInterconnect]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: Union[_models.NetworkToNetworkInterconnectPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_to_network_interconnects_update_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + network_to_network_interconnect_name=network_to_network_interconnect_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: _models.NetworkToNetworkInterconnectPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkToNetworkInterconnect]: + """Update certain properties of the Network To NetworkInterconnects resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Network to Network Interconnect properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnectPatch + :keyword content_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 NetworkToNetworkInterconnect. The + NetworkToNetworkInterconnect is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkToNetworkInterconnect]: + """Update certain properties of the Network To NetworkInterconnects resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Network to Network Interconnect properties to update. Required. + :type body: JSON + :keyword content_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 NetworkToNetworkInterconnect. The + NetworkToNetworkInterconnect is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkToNetworkInterconnect]: + """Update certain properties of the Network To NetworkInterconnects resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Network to Network Interconnect properties to update. Required. + :type body: IO[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 NetworkToNetworkInterconnect. The + NetworkToNetworkInterconnect is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: Union[_models.NetworkToNetworkInterconnectPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkToNetworkInterconnect]: + """Update certain properties of the Network To NetworkInterconnects resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Network to Network Interconnect properties to update. Is one of the following + types: NetworkToNetworkInterconnectPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnectPatch or JSON + or IO[bytes] + :return: An instance of AsyncLROPoller that returns NetworkToNetworkInterconnect. The + NetworkToNetworkInterconnect is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkToNetworkInterconnect] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + network_fabric_name=network_fabric_name, + network_to_network_interconnect_name=network_to_network_interconnect_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkToNetworkInterconnect, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkToNetworkInterconnect].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkToNetworkInterconnect]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_to_network_interconnects_delete_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + network_to_network_interconnect_name=network_to_network_interconnect_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Implements NetworkToNetworkInterconnects DELETE method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + network_to_network_interconnect_name=network_to_network_interconnect_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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_network_fabric( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.NetworkToNetworkInterconnect"]: + """Implements Network To Network Interconnects list by Network Fabric GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :return: An iterator like instance of NetworkToNetworkInterconnect + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkToNetworkInterconnect]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_to_network_interconnects_list_by_network_fabric_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkToNetworkInterconnect], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "network_to_network_interconnect_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _update_npb_static_route_bfd_administrative_state_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_to_network_interconnects_update_npb_static_route_bfd_administrative_state_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + network_to_network_interconnect_name=network_to_network_interconnect_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_npb_static_route_bfd_administrative_state( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the NPB Static Route BFD Administrative State. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_npb_static_route_bfd_administrative_state( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the NPB Static Route BFD Administrative State. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_npb_static_route_bfd_administrative_state( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the NPB Static Route BFD Administrative State. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Required. + :type body: IO[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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "network_to_network_interconnect_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_update_npb_static_route_bfd_administrative_state( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the NPB Static Route BFD Administrative State. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateAdministrativeStateResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_npb_static_route_bfd_administrative_state_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + network_to_network_interconnect_name=network_to_network_interconnect_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.UpdateAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.UpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.UpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "network_to_network_interconnect_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _update_administrative_state_initial( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_to_network_interconnects_update_administrative_state_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + network_to_network_interconnect_name=network_to_network_interconnect_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the Admin State. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the Admin State. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the Admin State. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Required. + :type body: IO[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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "network_to_network_interconnect_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the Admin State. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateAdministrativeStateResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_administrative_state_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + network_to_network_interconnect_name=network_to_network_interconnect_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.UpdateAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.UpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.UpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "network_to_network_interconnect_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _update_bfd_administrative_state_initial( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: Union[_models.NniUpdateBfdAdministrativeStateRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_to_network_interconnects_update_bfd_administrative_state_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + network_to_network_interconnect_name=network_to_network_interconnect_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_bfd_administrative_state( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: _models.NniUpdateBfdAdministrativeStateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NniUpdateBfdAdministrativeStateResponse]: + """Updates the Admin State. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NniUpdateBfdAdministrativeStateRequest + :keyword content_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 NniUpdateBfdAdministrativeStateResponse. + The NniUpdateBfdAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NniUpdateBfdAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_bfd_administrative_state( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NniUpdateBfdAdministrativeStateResponse]: + """Updates the Admin State. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NniUpdateBfdAdministrativeStateResponse. + The NniUpdateBfdAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NniUpdateBfdAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_bfd_administrative_state( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NniUpdateBfdAdministrativeStateResponse]: + """Updates the Admin State. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Required. + :type body: IO[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 NniUpdateBfdAdministrativeStateResponse. + The NniUpdateBfdAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NniUpdateBfdAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "network_to_network_interconnect_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_update_bfd_administrative_state( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: Union[_models.NniUpdateBfdAdministrativeStateRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NniUpdateBfdAdministrativeStateResponse]: + """Updates the Admin State. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Is one of the following types: + NniUpdateBfdAdministrativeStateRequest, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NniUpdateBfdAdministrativeStateRequest or + JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns NniUpdateBfdAdministrativeStateResponse. + The NniUpdateBfdAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NniUpdateBfdAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NniUpdateBfdAdministrativeStateResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_bfd_administrative_state_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + network_to_network_interconnect_name=network_to_network_interconnect_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NniUpdateBfdAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NniUpdateBfdAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NniUpdateBfdAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class NetworkPacketBrokersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricClient`'s + :attr:`network_packet_brokers` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_packet_broker_name: str, **kwargs: Any + ) -> _models.NetworkPacketBroker: + """Retrieves details of this Network Packet Broker. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_packet_broker_name: Name of the Network Packet Broker. Required. + :type network_packet_broker_name: str + :return: NetworkPacketBroker. The NetworkPacketBroker is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkPacketBroker] = kwargs.pop("cls", None) + + _request = build_network_packet_brokers_get_request( + resource_group_name=resource_group_name, + network_packet_broker_name=network_packet_broker_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NetworkPacketBroker, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + network_packet_broker_name: str, + body: Union[_models.NetworkPacketBroker, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_packet_brokers_create_request( + resource_group_name=resource_group_name, + network_packet_broker_name=network_packet_broker_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + network_packet_broker_name: str, + body: _models.NetworkPacketBroker, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkPacketBroker]: + """Creates a Network Packet Broker. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_packet_broker_name: Name of the Network Packet Broker. Required. + :type network_packet_broker_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker + :keyword content_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 NetworkPacketBroker. The + NetworkPacketBroker is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + network_packet_broker_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkPacketBroker]: + """Creates a Network Packet Broker. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_packet_broker_name: Name of the Network Packet Broker. Required. + :type network_packet_broker_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NetworkPacketBroker. The + NetworkPacketBroker is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + network_packet_broker_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkPacketBroker]: + """Creates a Network Packet Broker. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_packet_broker_name: Name of the Network Packet Broker. Required. + :type network_packet_broker_name: str + :param body: Request payload. Required. + :type body: IO[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 NetworkPacketBroker. The + NetworkPacketBroker is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + network_packet_broker_name: str, + body: Union[_models.NetworkPacketBroker, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkPacketBroker]: + """Creates a Network Packet Broker. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_packet_broker_name: Name of the Network Packet Broker. Required. + :type network_packet_broker_name: str + :param body: Request payload. Is one of the following types: NetworkPacketBroker, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns NetworkPacketBroker. The + NetworkPacketBroker is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkPacketBroker] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_packet_broker_name=network_packet_broker_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkPacketBroker, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkPacketBroker].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkPacketBroker]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + network_packet_broker_name: str, + body: Union[_models.NetworkPacketBrokerPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_packet_brokers_update_request( + resource_group_name=resource_group_name, + network_packet_broker_name=network_packet_broker_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + network_packet_broker_name: str, + body: _models.NetworkPacketBrokerPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkPacketBroker]: + """API to update certain properties of the Network Packet Broker resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_packet_broker_name: Name of the Network Packet Broker. Required. + :type network_packet_broker_name: str + :param body: Network Packet Broker properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkPacketBrokerPatch + :keyword content_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 NetworkPacketBroker. The + NetworkPacketBroker is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + network_packet_broker_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkPacketBroker]: + """API to update certain properties of the Network Packet Broker resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_packet_broker_name: Name of the Network Packet Broker. Required. + :type network_packet_broker_name: str + :param body: Network Packet Broker properties to update. Required. + :type body: JSON + :keyword content_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 NetworkPacketBroker. The + NetworkPacketBroker is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + network_packet_broker_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkPacketBroker]: + """API to update certain properties of the Network Packet Broker resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_packet_broker_name: Name of the Network Packet Broker. Required. + :type network_packet_broker_name: str + :param body: Network Packet Broker properties to update. Required. + :type body: IO[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 NetworkPacketBroker. The + NetworkPacketBroker is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + network_packet_broker_name: str, + body: Union[_models.NetworkPacketBrokerPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkPacketBroker]: + """API to update certain properties of the Network Packet Broker resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_packet_broker_name: Name of the Network Packet Broker. Required. + :type network_packet_broker_name: str + :param body: Network Packet Broker properties to update. Is one of the following types: + NetworkPacketBrokerPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkPacketBrokerPatch or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns NetworkPacketBroker. The + NetworkPacketBroker is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkPacketBroker] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + network_packet_broker_name=network_packet_broker_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkPacketBroker, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkPacketBroker].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkPacketBroker]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, network_packet_broker_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_packet_brokers_delete_request( + resource_group_name=resource_group_name, + network_packet_broker_name=network_packet_broker_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_packet_broker_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes Network Packet Broker. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_packet_broker_name: Name of the Network Packet Broker. Required. + :type network_packet_broker_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + network_packet_broker_name=network_packet_broker_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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 + ) -> AsyncItemPaged["_models.NetworkPacketBroker"]: + """Displays NetworkPacketBrokers list by resource group GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of NetworkPacketBroker + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkPacketBroker]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_packet_brokers_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkPacketBroker], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> AsyncItemPaged["_models.NetworkPacketBroker"]: + """Displays Network Packet Brokers list by subscription GET method. + + :return: An iterator like instance of NetworkPacketBroker + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkPacketBroker]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_packet_brokers_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkPacketBroker], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class NetworkRacksOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricClient`'s + :attr:`network_racks` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_group_name: str, network_rack_name: str, **kwargs: Any) -> _models.NetworkRack: + """Get Network Rack resource details. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_rack_name: Name of the Network Rack. Required. + :type network_rack_name: str + :return: NetworkRack. The NetworkRack is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkRack + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkRack] = kwargs.pop("cls", None) + + _request = build_network_racks_get_request( + resource_group_name=resource_group_name, + network_rack_name=network_rack_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NetworkRack, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + network_rack_name: str, + body: Union[_models.NetworkRack, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_racks_create_request( + resource_group_name=resource_group_name, + network_rack_name=network_rack_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + network_rack_name: str, + body: _models.NetworkRack, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkRack]: + """Create Network Rack resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_rack_name: Name of the Network Rack. Required. + :type network_rack_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkRack + :keyword content_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 NetworkRack. The NetworkRack is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkRack] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + network_rack_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkRack]: + """Create Network Rack resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_rack_name: Name of the Network Rack. Required. + :type network_rack_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NetworkRack. The NetworkRack is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkRack] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + network_rack_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkRack]: + """Create Network Rack resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_rack_name: Name of the Network Rack. Required. + :type network_rack_name: str + :param body: Request payload. Required. + :type body: IO[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 NetworkRack. The NetworkRack is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkRack] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + network_rack_name: str, + body: Union[_models.NetworkRack, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkRack]: + """Create Network Rack resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_rack_name: Name of the Network Rack. Required. + :type network_rack_name: str + :param body: Request payload. Is one of the following types: NetworkRack, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkRack or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns NetworkRack. The NetworkRack is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkRack] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkRack] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_rack_name=network_rack_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkRack, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkRack].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkRack]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + network_rack_name: str, + body: Union[_models.NetworkRackPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_racks_update_request( + resource_group_name=resource_group_name, + network_rack_name=network_rack_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + network_rack_name: str, + body: _models.NetworkRackPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkRack]: + """Update certain properties of the Network Rack resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_rack_name: Name of the Network Rack. Required. + :type network_rack_name: str + :param body: Network Rack properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkRackPatch + :keyword content_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 NetworkRack. The NetworkRack is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkRack] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + network_rack_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkRack]: + """Update certain properties of the Network Rack resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_rack_name: Name of the Network Rack. Required. + :type network_rack_name: str + :param body: Network Rack properties to update. Required. + :type body: JSON + :keyword content_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 NetworkRack. The NetworkRack is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkRack] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + network_rack_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkRack]: + """Update certain properties of the Network Rack resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_rack_name: Name of the Network Rack. Required. + :type network_rack_name: str + :param body: Network Rack properties to update. Required. + :type body: IO[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 NetworkRack. The NetworkRack is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkRack] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + network_rack_name: str, + body: Union[_models.NetworkRackPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkRack]: + """Update certain properties of the Network Rack resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_rack_name: Name of the Network Rack. Required. + :type network_rack_name: str + :param body: Network Rack properties to update. Is one of the following types: + NetworkRackPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkRackPatch or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns NetworkRack. The NetworkRack is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkRack] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkRack] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + network_rack_name=network_rack_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkRack, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkRack].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkRack]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, network_rack_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_racks_delete_request( + resource_group_name=resource_group_name, + network_rack_name=network_rack_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_rack_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete Network Rack resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_rack_name: Name of the Network Rack. Required. + :type network_rack_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + network_rack_name=network_rack_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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) -> AsyncItemPaged["_models.NetworkRack"]: + """List all Network Rack resources in the given resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of NetworkRack + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkRack] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkRack]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_racks_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkRack], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> AsyncItemPaged["_models.NetworkRack"]: + """List all Network Rack resources in the given subscription. + + :return: An iterator like instance of NetworkRack + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkRack] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkRack]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_racks_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkRack], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class NetworkTapRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricClient`'s + :attr:`network_tap_rules` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_group_name: str, network_tap_rule_name: str, **kwargs: Any) -> _models.NetworkTapRule: + """Get Network Tap Rule resource details. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :return: NetworkTapRule. The NetworkTapRule is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkTapRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkTapRule] = kwargs.pop("cls", None) + + _request = build_network_tap_rules_get_request( + resource_group_name=resource_group_name, + network_tap_rule_name=network_tap_rule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NetworkTapRule, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + network_tap_rule_name: str, + body: Union[_models.NetworkTapRule, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_tap_rules_create_request( + resource_group_name=resource_group_name, + network_tap_rule_name=network_tap_rule_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + network_tap_rule_name: str, + body: _models.NetworkTapRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkTapRule]: + """Create Network Tap Rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTapRule + :keyword content_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 NetworkTapRule. The NetworkTapRule is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + network_tap_rule_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkTapRule]: + """Create Network Tap Rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NetworkTapRule. The NetworkTapRule is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + network_tap_rule_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkTapRule]: + """Create Network Tap Rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :param body: Request payload. Required. + :type body: IO[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 NetworkTapRule. The NetworkTapRule is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + network_tap_rule_name: str, + body: Union[_models.NetworkTapRule, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkTapRule]: + """Create Network Tap Rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :param body: Request payload. Is one of the following types: NetworkTapRule, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTapRule or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns NetworkTapRule. The NetworkTapRule is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkTapRule] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_tap_rule_name=network_tap_rule_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkTapRule, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkTapRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkTapRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + network_tap_rule_name: str, + body: Union[_models.NetworkTapRulePatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_tap_rules_update_request( + resource_group_name=resource_group_name, + network_tap_rule_name=network_tap_rule_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + network_tap_rule_name: str, + body: _models.NetworkTapRulePatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkTapRule]: + """Update certain properties of the Network Tap Rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :param body: Network Tap Rule properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTapRulePatch + :keyword content_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 NetworkTapRule. The NetworkTapRule is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + network_tap_rule_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkTapRule]: + """Update certain properties of the Network Tap Rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :param body: Network Tap Rule properties to update. Required. + :type body: JSON + :keyword content_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 NetworkTapRule. The NetworkTapRule is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + network_tap_rule_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkTapRule]: + """Update certain properties of the Network Tap Rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :param body: Network Tap Rule properties to update. Required. + :type body: IO[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 NetworkTapRule. The NetworkTapRule is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + network_tap_rule_name: str, + body: Union[_models.NetworkTapRulePatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkTapRule]: + """Update certain properties of the Network Tap Rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :param body: Network Tap Rule properties to update. Is one of the following types: + NetworkTapRulePatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTapRulePatch or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns NetworkTapRule. The NetworkTapRule is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkTapRule] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + network_tap_rule_name=network_tap_rule_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkTapRule, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkTapRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkTapRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, network_tap_rule_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_tap_rules_delete_request( + resource_group_name=resource_group_name, + network_tap_rule_name=network_tap_rule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_tap_rule_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete Network Tap Rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + network_tap_rule_name=network_tap_rule_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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 + ) -> AsyncItemPaged["_models.NetworkTapRule"]: + """List all the Network Tap Rule resources in the given resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of NetworkTapRule + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkTapRule]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_tap_rules_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkTapRule], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> AsyncItemPaged["_models.NetworkTapRule"]: + """List all the Network Tap Rule resources in the given subscription. + + :return: An iterator like instance of NetworkTapRule + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkTapRule]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_tap_rules_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkTapRule], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _update_administrative_state_initial( + self, + resource_group_name: str, + network_tap_rule_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_tap_rules_update_administrative_state_request( + resource_group_name=resource_group_name, + network_tap_rule_name=network_tap_rule_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_tap_rule_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 CommonPostActionResponseForStateUpdate. The + CommonPostActionResponseForStateUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_tap_rule_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 CommonPostActionResponseForStateUpdate. The + CommonPostActionResponseForStateUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_tap_rule_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :param body: Request payload. Required. + :type body: IO[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 CommonPostActionResponseForStateUpdate. The + CommonPostActionResponseForStateUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_tap_rule_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns CommonPostActionResponseForStateUpdate. The + CommonPostActionResponseForStateUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_administrative_state_initial( + resource_group_name=resource_group_name, + network_tap_rule_name=network_tap_rule_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.CommonPostActionResponseForStateUpdate, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_tap_rule_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def _resync_initial( + self, resource_group_name: str, network_tap_rule_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_tap_rules_resync_request( + resource_group_name=resource_group_name, + network_tap_rule_name=network_tap_rule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_tap_rule_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_resync( + self, resource_group_name: str, network_tap_rule_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkTapRuleResyncResponse]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :return: An instance of AsyncLROPoller that returns NetworkTapRuleResyncResponse. The + NetworkTapRuleResyncResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapRuleResyncResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkTapRuleResyncResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._resync_initial( + resource_group_name=resource_group_name, + network_tap_rule_name=network_tap_rule_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkTapRuleResyncResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkTapRuleResyncResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkTapRuleResyncResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _validate_configuration_initial( + self, resource_group_name: str, network_tap_rule_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_tap_rules_validate_configuration_request( + resource_group_name=resource_group_name, + network_tap_rule_name=network_tap_rule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_validate_configuration( + self, resource_group_name: str, network_tap_rule_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ValidateConfigurationResponse]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :return: An instance of AsyncLROPoller that returns ValidateConfigurationResponse. The + ValidateConfigurationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ValidateConfigurationResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._validate_configuration_initial( + resource_group_name=resource_group_name, + network_tap_rule_name=network_tap_rule_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ValidateConfigurationResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ValidateConfigurationResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ValidateConfigurationResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class NetworkTapsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricClient`'s + :attr:`network_taps` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_group_name: str, network_tap_name: str, **kwargs: Any) -> _models.NetworkTap: + """Retrieves details of this Network Tap. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_name: Name of the Network Tap. Required. + :type network_tap_name: str + :return: NetworkTap. The NetworkTap is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkTap + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkTap] = kwargs.pop("cls", None) + + _request = build_network_taps_get_request( + resource_group_name=resource_group_name, + network_tap_name=network_tap_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NetworkTap, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + network_tap_name: str, + body: Union[_models.NetworkTap, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_taps_create_request( + resource_group_name=resource_group_name, + network_tap_name=network_tap_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + network_tap_name: str, + body: _models.NetworkTap, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkTap]: + """Creates a Network Tap. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_name: Name of the Network Tap. Required. + :type network_tap_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTap + :keyword content_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 NetworkTap. The NetworkTap is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + network_tap_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkTap]: + """Creates a Network Tap. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_name: Name of the Network Tap. Required. + :type network_tap_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NetworkTap. The NetworkTap is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + network_tap_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkTap]: + """Creates a Network Tap. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_name: Name of the Network Tap. Required. + :type network_tap_name: str + :param body: Request payload. Required. + :type body: IO[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 NetworkTap. The NetworkTap is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + network_tap_name: str, + body: Union[_models.NetworkTap, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkTap]: + """Creates a Network Tap. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_name: Name of the Network Tap. Required. + :type network_tap_name: str + :param body: Request payload. Is one of the following types: NetworkTap, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTap or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns NetworkTap. The NetworkTap is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkTap] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_tap_name=network_tap_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkTap, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkTap].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkTap]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + network_tap_name: str, + body: Union[_models.NetworkTapPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_taps_update_request( + resource_group_name=resource_group_name, + network_tap_name=network_tap_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + network_tap_name: str, + body: _models.NetworkTapPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkTap]: + """API to update certain properties of the Network Tap resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_name: Name of the Network Tap. Required. + :type network_tap_name: str + :param body: Network Tap properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTapPatch + :keyword content_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 NetworkTap. The NetworkTap is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + network_tap_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkTap]: + """API to update certain properties of the Network Tap resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_name: Name of the Network Tap. Required. + :type network_tap_name: str + :param body: Network Tap properties to update. Required. + :type body: JSON + :keyword content_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 NetworkTap. The NetworkTap is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + network_tap_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkTap]: + """API to update certain properties of the Network Tap resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_name: Name of the Network Tap. Required. + :type network_tap_name: str + :param body: Network Tap properties to update. Required. + :type body: IO[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 NetworkTap. The NetworkTap is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + network_tap_name: str, + body: Union[_models.NetworkTapPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkTap]: + """API to update certain properties of the Network Tap resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_name: Name of the Network Tap. Required. + :type network_tap_name: str + :param body: Network Tap properties to update. Is one of the following types: NetworkTapPatch, + JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTapPatch or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns NetworkTap. The NetworkTap is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkTap] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + network_tap_name=network_tap_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkTap, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkTap].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkTap]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, network_tap_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_taps_delete_request( + resource_group_name=resource_group_name, + network_tap_name=network_tap_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_tap_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes Network Tap. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_name: Name of the Network Tap. Required. + :type network_tap_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + network_tap_name=network_tap_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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) -> AsyncItemPaged["_models.NetworkTap"]: + """Displays Network Taps list by resource group GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of NetworkTap + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkTap]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_taps_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkTap], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> AsyncItemPaged["_models.NetworkTap"]: + """Displays Network Taps list by subscription GET method. + + :return: An iterator like instance of NetworkTap + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkTap]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_taps_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkTap], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_tap_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _update_administrative_state_initial( + self, + resource_group_name: str, + network_tap_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_taps_update_administrative_state_request( + resource_group_name=resource_group_name, + network_tap_name=network_tap_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_tap_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_name: Name of the Network Tap. Required. + :type network_tap_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_tap_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_name: Name of the Network Tap. Required. + :type network_tap_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_tap_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_name: Name of the Network Tap. Required. + :type network_tap_name: str + :param body: Request payload. Required. + :type body: IO[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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_tap_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_tap_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_name: Name of the Network Tap. Required. + :type network_tap_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateAdministrativeStateResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_administrative_state_initial( + resource_group_name=resource_group_name, + network_tap_name=network_tap_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.UpdateAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.UpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.UpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_tap_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def _resync_initial( + self, resource_group_name: str, network_tap_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_taps_resync_request( + resource_group_name=resource_group_name, + network_tap_name=network_tap_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_tap_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_resync( + self, resource_group_name: str, network_tap_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkTapResyncResponse]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_name: Name of the Network Tap. Required. + :type network_tap_name: str + :return: An instance of AsyncLROPoller that returns NetworkTapResyncResponse. The + NetworkTapResyncResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapResyncResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkTapResyncResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._resync_initial( + resource_group_name=resource_group_name, + network_tap_name=network_tap_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkTapResyncResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkTapResyncResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkTapResyncResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class RoutePoliciesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricClient`'s + :attr:`route_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_group_name: str, route_policy_name: str, **kwargs: Any) -> _models.RoutePolicy: + """Implements Route Policy GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :return: RoutePolicy. The RoutePolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.RoutePolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.RoutePolicy] = kwargs.pop("cls", None) + + _request = build_route_policies_get_request( + resource_group_name=resource_group_name, + route_policy_name=route_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RoutePolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + route_policy_name: str, + body: Union[_models.RoutePolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_route_policies_create_request( + resource_group_name=resource_group_name, + route_policy_name=route_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + route_policy_name: str, + body: _models.RoutePolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RoutePolicy]: + """Implements Route Policy PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.RoutePolicy + :keyword content_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 RoutePolicy. The RoutePolicy is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.RoutePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + route_policy_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RoutePolicy]: + """Implements Route Policy PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 RoutePolicy. The RoutePolicy is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.RoutePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + route_policy_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RoutePolicy]: + """Implements Route Policy PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :param body: Request payload. Required. + :type body: IO[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 RoutePolicy. The RoutePolicy is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.RoutePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + route_policy_name: str, + body: Union[_models.RoutePolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.RoutePolicy]: + """Implements Route Policy PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :param body: Request payload. Is one of the following types: RoutePolicy, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.RoutePolicy or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns RoutePolicy. The RoutePolicy is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.RoutePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RoutePolicy] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + route_policy_name=route_policy_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.RoutePolicy, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.RoutePolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.RoutePolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + route_policy_name: str, + body: Union[_models.RoutePolicyPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_route_policies_update_request( + resource_group_name=resource_group_name, + route_policy_name=route_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + route_policy_name: str, + body: _models.RoutePolicyPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RoutePolicy]: + """API to update certain properties of the Route Policy resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :param body: Route Policy properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.RoutePolicyPatch + :keyword content_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 RoutePolicy. The RoutePolicy is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.RoutePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + route_policy_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RoutePolicy]: + """API to update certain properties of the Route Policy resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :param body: Route Policy properties to update. Required. + :type body: JSON + :keyword content_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 RoutePolicy. The RoutePolicy is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.RoutePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + route_policy_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RoutePolicy]: + """API to update certain properties of the Route Policy resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :param body: Route Policy properties to update. Required. + :type body: IO[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 RoutePolicy. The RoutePolicy is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.RoutePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + route_policy_name: str, + body: Union[_models.RoutePolicyPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.RoutePolicy]: + """API to update certain properties of the Route Policy resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :param body: Route Policy properties to update. Is one of the following types: + RoutePolicyPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.RoutePolicyPatch or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns RoutePolicy. The RoutePolicy is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.RoutePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RoutePolicy] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_policy_name=route_policy_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.RoutePolicy, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.RoutePolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.RoutePolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, route_policy_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_route_policies_delete_request( + resource_group_name=resource_group_name, + route_policy_name=route_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, route_policy_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Implements Route Policy DELETE method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + route_policy_name=route_policy_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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) -> AsyncItemPaged["_models.RoutePolicy"]: + """Implements RoutePolicies list by resource group GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of RoutePolicy + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.RoutePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.RoutePolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_policies_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RoutePolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> AsyncItemPaged["_models.RoutePolicy"]: + """Implements RoutePolicies list by subscription GET method. + + :return: An iterator like instance of RoutePolicy + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.RoutePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.RoutePolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_policies_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RoutePolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "route_policy_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _update_administrative_state_initial( + self, + resource_group_name: str, + route_policy_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_route_policies_update_administrative_state_request( + resource_group_name=resource_group_name, + route_policy_name=route_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + route_policy_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Updated the admin state for this Route Policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + route_policy_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Updated the admin state for this Route Policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + route_policy_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Updated the admin state for this Route Policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :param body: Request payload. Required. + :type body: IO[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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "route_policy_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_update_administrative_state( + self, + resource_group_name: str, + route_policy_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateAdministrativeStateResponse]: + """Updated the admin state for this Route Policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateAdministrativeStateResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_administrative_state_initial( + resource_group_name=resource_group_name, + route_policy_name=route_policy_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.UpdateAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.UpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.UpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _validate_configuration_initial( + self, resource_group_name: str, route_policy_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_route_policies_validate_configuration_request( + resource_group_name=resource_group_name, + route_policy_name=route_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_validate_configuration( + self, resource_group_name: str, route_policy_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ValidateConfigurationResponse]: + """Validates the configuration of the resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :return: An instance of AsyncLROPoller that returns ValidateConfigurationResponse. The + ValidateConfigurationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ValidateConfigurationResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._validate_configuration_initial( + resource_group_name=resource_group_name, + route_policy_name=route_policy_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ValidateConfigurationResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ValidateConfigurationResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ValidateConfigurationResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _commit_configuration_initial( + self, resource_group_name: str, route_policy_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_route_policies_commit_configuration_request( + resource_group_name=resource_group_name, + route_policy_name=route_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_commit_configuration( + self, resource_group_name: str, route_policy_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: + """Commits the configuration of the given resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :return: An instance of AsyncLROPoller that returns CommonPostActionResponseForStateUpdate. The + CommonPostActionResponseForStateUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._commit_configuration_initial( + resource_group_name=resource_group_name, + route_policy_name=route_policy_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.CommonPostActionResponseForStateUpdate, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class NetworkMonitorsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricClient`'s + :attr:`network_monitors` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2024-06-15-preview", + params_added_on={ + "2024-06-15-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_monitor_name", + "accept", + ] + }, + api_versions_list=["2024-06-15-preview", "2025-07-15"], + ) + async def get(self, resource_group_name: str, network_monitor_name: str, **kwargs: Any) -> _models.NetworkMonitor: + """Implements NetworkMonitor GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_monitor_name: Name of the Network Monitor. Required. + :type network_monitor_name: str + :return: NetworkMonitor. The NetworkMonitor is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkMonitor + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkMonitor] = kwargs.pop("cls", None) + + _request = build_network_monitors_get_request( + resource_group_name=resource_group_name, + network_monitor_name=network_monitor_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NetworkMonitor, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2024-06-15-preview", + params_added_on={ + "2024-06-15-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_monitor_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2024-06-15-preview", "2025-07-15"], + ) + async def _create_initial( + self, + resource_group_name: str, + network_monitor_name: str, + body: Union[_models.NetworkMonitor, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_monitors_create_request( + resource_group_name=resource_group_name, + network_monitor_name=network_monitor_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + network_monitor_name: str, + body: _models.NetworkMonitor, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkMonitor]: + """Creates NetworkMonitor resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_monitor_name: Name of the Network Monitor. Required. + :type network_monitor_name: str + :param body: Resource create parameters. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkMonitor + :keyword content_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 NetworkMonitor. The NetworkMonitor is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkMonitor] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + network_monitor_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkMonitor]: + """Creates NetworkMonitor resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_monitor_name: Name of the Network Monitor. Required. + :type network_monitor_name: str + :param body: Resource create parameters. Required. + :type body: JSON + :keyword content_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 NetworkMonitor. The NetworkMonitor is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkMonitor] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + network_monitor_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkMonitor]: + """Creates NetworkMonitor resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_monitor_name: Name of the Network Monitor. Required. + :type network_monitor_name: str + :param body: Resource create parameters. Required. + :type body: IO[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 NetworkMonitor. The NetworkMonitor is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkMonitor] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2024-06-15-preview", + params_added_on={ + "2024-06-15-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_monitor_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2024-06-15-preview", "2025-07-15"], + ) + async def begin_create( + self, + resource_group_name: str, + network_monitor_name: str, + body: Union[_models.NetworkMonitor, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkMonitor]: + """Creates NetworkMonitor resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_monitor_name: Name of the Network Monitor. Required. + :type network_monitor_name: str + :param body: Resource create parameters. Is one of the following types: NetworkMonitor, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkMonitor or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns NetworkMonitor. The NetworkMonitor is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkMonitor] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkMonitor] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_monitor_name=network_monitor_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkMonitor, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkMonitor].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkMonitor]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2024-06-15-preview", + params_added_on={ + "2024-06-15-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_monitor_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2024-06-15-preview", "2025-07-15"], + ) + async def _update_initial( + self, + resource_group_name: str, + network_monitor_name: str, + body: Union[_models.NetworkMonitorPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_monitors_update_request( + resource_group_name=resource_group_name, + network_monitor_name=network_monitor_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + network_monitor_name: str, + body: _models.NetworkMonitorPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkMonitor]: + """API to update certain properties of the NetworkMonitor resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_monitor_name: Name of the Network Monitor. Required. + :type network_monitor_name: str + :param body: The resource properties to be updated. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkMonitorPatch + :keyword content_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 NetworkMonitor. The NetworkMonitor is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkMonitor] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + network_monitor_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkMonitor]: + """API to update certain properties of the NetworkMonitor resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_monitor_name: Name of the Network Monitor. Required. + :type network_monitor_name: str + :param body: The resource properties to be updated. Required. + :type body: JSON + :keyword content_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 NetworkMonitor. The NetworkMonitor is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkMonitor] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + network_monitor_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkMonitor]: + """API to update certain properties of the NetworkMonitor resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_monitor_name: Name of the Network Monitor. Required. + :type network_monitor_name: str + :param body: The resource properties to be updated. Required. + :type body: IO[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 NetworkMonitor. The NetworkMonitor is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkMonitor] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2024-06-15-preview", + params_added_on={ + "2024-06-15-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_monitor_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2024-06-15-preview", "2025-07-15"], + ) + async def begin_update( + self, + resource_group_name: str, + network_monitor_name: str, + body: Union[_models.NetworkMonitorPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkMonitor]: + """API to update certain properties of the NetworkMonitor resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_monitor_name: Name of the Network Monitor. Required. + :type network_monitor_name: str + :param body: The resource properties to be updated. Is one of the following types: + NetworkMonitorPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkMonitorPatch or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns NetworkMonitor. The NetworkMonitor is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkMonitor] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkMonitor] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + network_monitor_name=network_monitor_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkMonitor, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkMonitor].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkMonitor]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2024-06-15-preview", + params_added_on={ + "2024-06-15-preview": ["api_version", "subscription_id", "resource_group_name", "network_monitor_name"] + }, + api_versions_list=["2024-06-15-preview", "2025-07-15"], + ) + async def _delete_initial( + self, resource_group_name: str, network_monitor_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_monitors_delete_request( + resource_group_name=resource_group_name, + network_monitor_name=network_monitor_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2024-06-15-preview", + params_added_on={ + "2024-06-15-preview": ["api_version", "subscription_id", "resource_group_name", "network_monitor_name"] + }, + api_versions_list=["2024-06-15-preview", "2025-07-15"], + ) + async def begin_delete( + self, resource_group_name: str, network_monitor_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes layer 2 connectivity between compute nodes by managed by named NetworkMonitor name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_monitor_name: Name of the Network Monitor. Required. + :type network_monitor_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + network_monitor_name=network_monitor_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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 + @api_version_validation( + method_added_on="2024-06-15-preview", + params_added_on={"2024-06-15-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, + api_versions_list=["2024-06-15-preview", "2025-07-15"], + ) + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.NetworkMonitor"]: + """Displays NetworkMonitors list by resource group GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of NetworkMonitor + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkMonitor] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkMonitor]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_monitors_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkMonitor], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + @api_version_validation( + method_added_on="2024-06-15-preview", + params_added_on={"2024-06-15-preview": ["api_version", "subscription_id", "accept"]}, + api_versions_list=["2024-06-15-preview", "2025-07-15"], + ) + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.NetworkMonitor"]: + """Displays NetworkMonitors list by subscription GET method. + + :return: An iterator like instance of NetworkMonitor + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkMonitor] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkMonitor]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_monitors_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkMonitor], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2024-06-15-preview", + params_added_on={ + "2024-06-15-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_monitor_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2024-06-15-preview", "2025-07-15"], + ) + async def _update_administrative_state_initial( + self, + resource_group_name: str, + network_monitor_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_monitors_update_administrative_state_request( + resource_group_name=resource_group_name, + network_monitor_name=network_monitor_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_monitor_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CommonPostActionResponseForDeviceUpdate]: + """Enables isolation domain across the fabric or on specified racks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_monitor_name: Name of the Network Monitor. Required. + :type network_monitor_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 CommonPostActionResponseForDeviceUpdate. + The CommonPostActionResponseForDeviceUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_monitor_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CommonPostActionResponseForDeviceUpdate]: + """Enables isolation domain across the fabric or on specified racks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_monitor_name: Name of the Network Monitor. Required. + :type network_monitor_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 CommonPostActionResponseForDeviceUpdate. + The CommonPostActionResponseForDeviceUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_monitor_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CommonPostActionResponseForDeviceUpdate]: + """Enables isolation domain across the fabric or on specified racks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_monitor_name: Name of the Network Monitor. Required. + :type network_monitor_name: str + :param body: Request payload. Required. + :type body: IO[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 CommonPostActionResponseForDeviceUpdate. + The CommonPostActionResponseForDeviceUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2024-06-15-preview", + params_added_on={ + "2024-06-15-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_monitor_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2024-06-15-preview", "2025-07-15"], + ) + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_monitor_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.CommonPostActionResponseForDeviceUpdate]: + """Enables isolation domain across the fabric or on specified racks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_monitor_name: Name of the Network Monitor. Required. + :type network_monitor_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns CommonPostActionResponseForDeviceUpdate. + The CommonPostActionResponseForDeviceUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CommonPostActionResponseForDeviceUpdate] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_administrative_state_initial( + resource_group_name=resource_group_name, + network_monitor_name=network_monitor_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.CommonPostActionResponseForDeviceUpdate, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.CommonPostActionResponseForDeviceUpdate].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.CommonPostActionResponseForDeviceUpdate]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class NetworkBootstrapDevicesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricClient`'s + :attr:`network_bootstrap_devices` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def get( + self, resource_group_name: str, network_bootstrap_device_name: str, **kwargs: Any + ) -> _models.NetworkBootstrapDevice: + """Gets a Network Bootstrap Device resource details. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :return: NetworkBootstrapDevice. The NetworkBootstrapDevice is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevice + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkBootstrapDevice] = kwargs.pop("cls", None) + + _request = build_network_bootstrap_devices_get_request( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NetworkBootstrapDevice, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _create_initial( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: Union[_models.NetworkBootstrapDevice, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_bootstrap_devices_create_request( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: _models.NetworkBootstrapDevice, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkBootstrapDevice]: + """Creates a Network Bootstrap Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevice + :keyword content_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 NetworkBootstrapDevice. The + NetworkBootstrapDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkBootstrapDevice]: + """Creates a Network Bootstrap Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NetworkBootstrapDevice. The + NetworkBootstrapDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkBootstrapDevice]: + """Creates a Network Bootstrap Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Request payload. Required. + :type body: IO[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 NetworkBootstrapDevice. The + NetworkBootstrapDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_create( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: Union[_models.NetworkBootstrapDevice, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkBootstrapDevice]: + """Creates a Network Bootstrap Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Request payload. Is one of the following types: NetworkBootstrapDevice, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevice or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns NetworkBootstrapDevice. The + NetworkBootstrapDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkBootstrapDevice] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_bootstrap_device_name=network_bootstrap_device_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkBootstrapDevice, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkBootstrapDevice].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkBootstrapDevice]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _update_initial( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: Union[_models.NetworkBootstrapDevicePatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_bootstrap_devices_update_request( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: _models.NetworkBootstrapDevicePatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkBootstrapDevice]: + """Update certain properties of the Network Bootstrap Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Network Bootstrap Device properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevicePatch + :keyword content_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 NetworkBootstrapDevice. The + NetworkBootstrapDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkBootstrapDevice]: + """Update certain properties of the Network Bootstrap Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Network Bootstrap Device properties to update. Required. + :type body: JSON + :keyword content_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 NetworkBootstrapDevice. The + NetworkBootstrapDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkBootstrapDevice]: + """Update certain properties of the Network Bootstrap Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Network Bootstrap Device properties to update. Required. + :type body: IO[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 NetworkBootstrapDevice. The + NetworkBootstrapDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_update( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: Union[_models.NetworkBootstrapDevicePatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkBootstrapDevice]: + """Update certain properties of the Network Bootstrap Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Network Bootstrap Device properties to update. Is one of the following types: + NetworkBootstrapDevicePatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevicePatch or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns NetworkBootstrapDevice. The + NetworkBootstrapDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkBootstrapDevice] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + network_bootstrap_device_name=network_bootstrap_device_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkBootstrapDevice, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkBootstrapDevice].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkBootstrapDevice]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_bootstrap_device_name"] + }, + api_versions_list=["2025-07-15"], + ) + async def _delete_initial( + self, resource_group_name: str, network_bootstrap_device_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_bootstrap_devices_delete_request( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_bootstrap_device_name"] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_delete( + self, resource_group_name: str, network_bootstrap_device_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a Network Bootstrap Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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 + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={"2025-07-15": ["api_version", "subscription_id", "resource_group_name", "accept"]}, + api_versions_list=["2025-07-15"], + ) + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.NetworkBootstrapDevice"]: + """Lists all the Network Bootstrap Device resources in a given resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of NetworkBootstrapDevice + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkBootstrapDevice]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_bootstrap_devices_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkBootstrapDevice], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={"2025-07-15": ["api_version", "subscription_id", "accept"]}, + api_versions_list=["2025-07-15"], + ) + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.NetworkBootstrapDevice"]: + """List all the Network Bootstrap Device resources in a given subscription. + + :return: An iterator like instance of NetworkBootstrapDevice + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkBootstrapDevice]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_bootstrap_devices_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkBootstrapDevice], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _reboot_initial( + self, resource_group_name: str, network_bootstrap_device_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_bootstrap_devices_reboot_request( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_reboot( + self, resource_group_name: str, network_bootstrap_device_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkBootstrapDeviceRebootResponse]: + """Reboot the Network Bootstrap Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :return: An instance of AsyncLROPoller that returns NetworkBootstrapDeviceRebootResponse. The + NetworkBootstrapDeviceRebootResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDeviceRebootResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkBootstrapDeviceRebootResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._reboot_initial( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkBootstrapDeviceRebootResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkBootstrapDeviceRebootResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkBootstrapDeviceRebootResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _refresh_configuration_initial( + self, resource_group_name: str, network_bootstrap_device_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_bootstrap_devices_refresh_configuration_request( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_refresh_configuration( + self, resource_group_name: str, network_bootstrap_device_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkBootstrapDeviceRefreshConfigurationResponse]: + """Refreshes the configuration of Network Bootstrap Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :return: An instance of AsyncLROPoller that returns + NetworkBootstrapDeviceRefreshConfigurationResponse. The + NetworkBootstrapDeviceRefreshConfigurationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDeviceRefreshConfigurationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkBootstrapDeviceRefreshConfigurationResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._refresh_configuration_initial( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkBootstrapDeviceRefreshConfigurationResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkBootstrapDeviceRefreshConfigurationResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkBootstrapDeviceRefreshConfigurationResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _upgrade_initial( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: Union[_models.UpdateVersion, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_bootstrap_devices_upgrade_request( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_upgrade( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: _models.UpdateVersion, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkBootstrapDeviceUpgradeResponse]: + """Upgrades the version of the Network Bootstrap Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateVersion + :keyword content_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 NetworkBootstrapDeviceUpgradeResponse. The + NetworkBootstrapDeviceUpgradeResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDeviceUpgradeResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_upgrade( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkBootstrapDeviceUpgradeResponse]: + """Upgrades the version of the Network Bootstrap Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NetworkBootstrapDeviceUpgradeResponse. The + NetworkBootstrapDeviceUpgradeResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDeviceUpgradeResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_upgrade( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkBootstrapDeviceUpgradeResponse]: + """Upgrades the version of the Network Bootstrap Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Request payload. Required. + :type body: IO[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 NetworkBootstrapDeviceUpgradeResponse. The + NetworkBootstrapDeviceUpgradeResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDeviceUpgradeResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_upgrade( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: Union[_models.UpdateVersion, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkBootstrapDeviceUpgradeResponse]: + """Upgrades the version of the Network Bootstrap Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Request payload. Is one of the following types: UpdateVersion, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateVersion or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns NetworkBootstrapDeviceUpgradeResponse. The + NetworkBootstrapDeviceUpgradeResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDeviceUpgradeResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkBootstrapDeviceUpgradeResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._upgrade_initial( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkBootstrapDeviceUpgradeResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkBootstrapDeviceUpgradeResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkBootstrapDeviceUpgradeResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _update_administrative_state_initial( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: Union[_models.UpdateDeviceAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_bootstrap_devices_update_administrative_state_request( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: _models.UpdateDeviceAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkBootstrapDeviceUpdateAdministrativeStateResponse]: + """Updates the Administrative state of the Network Bootstrap Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateDeviceAdministrativeState + :keyword content_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 + NetworkBootstrapDeviceUpdateAdministrativeStateResponse. The + NetworkBootstrapDeviceUpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDeviceUpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkBootstrapDeviceUpdateAdministrativeStateResponse]: + """Updates the Administrative state of the Network Bootstrap Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 + NetworkBootstrapDeviceUpdateAdministrativeStateResponse. The + NetworkBootstrapDeviceUpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDeviceUpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkBootstrapDeviceUpdateAdministrativeStateResponse]: + """Updates the Administrative state of the Network Bootstrap Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Request payload. Required. + :type body: IO[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 + NetworkBootstrapDeviceUpdateAdministrativeStateResponse. The + NetworkBootstrapDeviceUpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDeviceUpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: Union[_models.UpdateDeviceAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkBootstrapDeviceUpdateAdministrativeStateResponse]: + """Updates the Administrative state of the Network Bootstrap Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Request payload. Is one of the following types: UpdateDeviceAdministrativeState, + JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateDeviceAdministrativeState or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns + NetworkBootstrapDeviceUpdateAdministrativeStateResponse. The + NetworkBootstrapDeviceUpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDeviceUpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkBootstrapDeviceUpdateAdministrativeStateResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_administrative_state_initial( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize( + _models.NetworkBootstrapDeviceUpdateAdministrativeStateResponse, response.json() + ) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[ + _models.NetworkBootstrapDeviceUpdateAdministrativeStateResponse + ].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkBootstrapDeviceUpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _resync_passwords_initial( + self, resource_group_name: str, network_bootstrap_device_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_bootstrap_devices_resync_passwords_request( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_resync_passwords( + self, resource_group_name: str, network_bootstrap_device_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkBootstrapDeviceResyncPasswordsResponse]: + """Resync the latest passwords to the Network Bootstrap Device. + + Updates the Network Bootstrap Device to use the latest passwords. Does not generate new + passwords. Allows network bootstrap devices missed during a previous password rotation to be + brought back into sync. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :return: An instance of AsyncLROPoller that returns + NetworkBootstrapDeviceResyncPasswordsResponse. The + NetworkBootstrapDeviceResyncPasswordsResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDeviceResyncPasswordsResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkBootstrapDeviceResyncPasswordsResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._resync_passwords_initial( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkBootstrapDeviceResyncPasswordsResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkBootstrapDeviceResyncPasswordsResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkBootstrapDeviceResyncPasswordsResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class NetworkBootstrapInterfacesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricClient`'s + :attr:`network_bootstrap_interfaces` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "network_bootstrap_interface_name", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def get( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + **kwargs: Any + ) -> _models.NetworkBootstrapInterface: + """Get the Network Bootstrap Interface resource details. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param network_bootstrap_interface_name: Name of the Network Bootstrap Interface. Required. + :type network_bootstrap_interface_name: str + :return: NetworkBootstrapInterface. The NetworkBootstrapInterface is compatible with + MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterface + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkBootstrapInterface] = kwargs.pop("cls", None) + + _request = build_network_bootstrap_interfaces_get_request( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + network_bootstrap_interface_name=network_bootstrap_interface_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NetworkBootstrapInterface, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "network_bootstrap_interface_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _create_initial( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + body: Union[_models.NetworkBootstrapInterface, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_bootstrap_interfaces_create_request( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + network_bootstrap_interface_name=network_bootstrap_interface_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + body: _models.NetworkBootstrapInterface, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkBootstrapInterface]: + """Create a Network Bootstrap Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param network_bootstrap_interface_name: Name of the Network Bootstrap Interface. Required. + :type network_bootstrap_interface_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterface + :keyword content_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 NetworkBootstrapInterface. The + NetworkBootstrapInterface is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkBootstrapInterface]: + """Create a Network Bootstrap Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param network_bootstrap_interface_name: Name of the Network Bootstrap Interface. Required. + :type network_bootstrap_interface_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NetworkBootstrapInterface. The + NetworkBootstrapInterface is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkBootstrapInterface]: + """Create a Network Bootstrap Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param network_bootstrap_interface_name: Name of the Network Bootstrap Interface. Required. + :type network_bootstrap_interface_name: str + :param body: Request payload. Required. + :type body: IO[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 NetworkBootstrapInterface. The + NetworkBootstrapInterface is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "network_bootstrap_interface_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_create( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + body: Union[_models.NetworkBootstrapInterface, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkBootstrapInterface]: + """Create a Network Bootstrap Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param network_bootstrap_interface_name: Name of the Network Bootstrap Interface. Required. + :type network_bootstrap_interface_name: str + :param body: Request payload. Is one of the following types: NetworkBootstrapInterface, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterface or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns NetworkBootstrapInterface. The + NetworkBootstrapInterface is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkBootstrapInterface] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_bootstrap_device_name=network_bootstrap_device_name, + network_bootstrap_interface_name=network_bootstrap_interface_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkBootstrapInterface, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkBootstrapInterface].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkBootstrapInterface]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "network_bootstrap_interface_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _update_initial( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + body: Union[_models.NetworkBootstrapInterfacePatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_bootstrap_interfaces_update_request( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + network_bootstrap_interface_name=network_bootstrap_interface_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + body: _models.NetworkBootstrapInterfacePatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkBootstrapInterface]: + """Update certain properties of the Network Bootstrap Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param network_bootstrap_interface_name: Name of the Network Bootstrap Interface. Required. + :type network_bootstrap_interface_name: str + :param body: NetworkBootstrapInterface properties to update. Only tags are supported. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterfacePatch + :keyword content_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 NetworkBootstrapInterface. The + NetworkBootstrapInterface is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkBootstrapInterface]: + """Update certain properties of the Network Bootstrap Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param network_bootstrap_interface_name: Name of the Network Bootstrap Interface. Required. + :type network_bootstrap_interface_name: str + :param body: NetworkBootstrapInterface properties to update. Only tags are supported. Required. + :type body: JSON + :keyword content_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 NetworkBootstrapInterface. The + NetworkBootstrapInterface is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkBootstrapInterface]: + """Update certain properties of the Network Bootstrap Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param network_bootstrap_interface_name: Name of the Network Bootstrap Interface. Required. + :type network_bootstrap_interface_name: str + :param body: NetworkBootstrapInterface properties to update. Only tags are supported. Required. + :type body: IO[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 NetworkBootstrapInterface. The + NetworkBootstrapInterface is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "network_bootstrap_interface_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_update( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + body: Union[_models.NetworkBootstrapInterfacePatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkBootstrapInterface]: + """Update certain properties of the Network Bootstrap Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param network_bootstrap_interface_name: Name of the Network Bootstrap Interface. Required. + :type network_bootstrap_interface_name: str + :param body: NetworkBootstrapInterface properties to update. Only tags are supported. Is one of + the following types: NetworkBootstrapInterfacePatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterfacePatch or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns NetworkBootstrapInterface. The + NetworkBootstrapInterface is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkBootstrapInterface] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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, + network_bootstrap_device_name=network_bootstrap_device_name, + network_bootstrap_interface_name=network_bootstrap_interface_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkBootstrapInterface, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkBootstrapInterface].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkBootstrapInterface]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "network_bootstrap_interface_name", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _delete_initial( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_bootstrap_interfaces_delete_request( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + network_bootstrap_interface_name=network_bootstrap_interface_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "network_bootstrap_interface_name", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_delete( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete the Network Bootstrap Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param network_bootstrap_interface_name: Name of the Network Bootstrap Interface. Required. + :type network_bootstrap_interface_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + network_bootstrap_interface_name=network_bootstrap_interface_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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 + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def list_by_network_bootstrap_device( + self, resource_group_name: str, network_bootstrap_device_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.NetworkBootstrapInterface"]: + """List all the Network Bootstrap Interface resources in a given resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :return: An iterator like instance of NetworkBootstrapInterface + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkBootstrapInterface]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_bootstrap_interfaces_list_by_network_bootstrap_device_request( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkBootstrapInterface], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "network_bootstrap_interface_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def _update_administrative_state_initial( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_bootstrap_interfaces_update_administrative_state_request( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + network_bootstrap_interface_name=network_bootstrap_interface_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: + """Update the admin state of the Network Interface. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param network_bootstrap_interface_name: Name of the Network Bootstrap Interface. Required. + :type network_bootstrap_interface_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 CommonPostActionResponseForStateUpdate. The + CommonPostActionResponseForStateUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: + """Update the admin state of the Network Interface. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param network_bootstrap_interface_name: Name of the Network Bootstrap Interface. Required. + :type network_bootstrap_interface_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 CommonPostActionResponseForStateUpdate. The + CommonPostActionResponseForStateUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: + """Update the admin state of the Network Interface. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param network_bootstrap_interface_name: Name of the Network Bootstrap Interface. Required. + :type network_bootstrap_interface_name: str + :param body: Request payload. Required. + :type body: IO[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 CommonPostActionResponseForStateUpdate. The + CommonPostActionResponseForStateUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "network_bootstrap_interface_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + async def begin_update_administrative_state( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: + """Update the admin state of the Network Interface. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param network_bootstrap_interface_name: Name of the Network Bootstrap Interface. Required. + :type network_bootstrap_interface_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns CommonPostActionResponseForStateUpdate. The + CommonPostActionResponseForStateUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("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_administrative_state_initial( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + network_bootstrap_interface_name=network_bootstrap_interface_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.CommonPostActionResponseForStateUpdate, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_patch.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_patch.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """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 + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_route_policies_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_route_policies_operations.py deleted file mode 100644 index 1279db28c3d3..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/aio/operations/_route_policies_operations.py +++ /dev/null @@ -1,1384 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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._route_policies_operations import ( - build_commit_configuration_request, - build_create_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_update_administrative_state_request, - build_update_request, - build_validate_configuration_request, -) - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class RoutePoliciesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.aio.ManagedNetworkFabricMgmtClient`'s - :attr:`route_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") - - async def _create_initial( - self, resource_group_name: str, route_policy_name: str, body: Union[_models.RoutePolicy, IO], **kwargs: Any - ) -> _models.RoutePolicy: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RoutePolicy] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "RoutePolicy") - - request = build_create_request( - resource_group_name=resource_group_name, - route_policy_name=route_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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("RoutePolicy", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("RoutePolicy", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}" - } - - @overload - async def begin_create( - self, - resource_group_name: str, - route_policy_name: str, - body: _models.RoutePolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.RoutePolicy]: - """Create Route Policy. - - Implements Route Policy PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param route_policy_name: Name of the Route Policy. Required. - :type route_policy_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.RoutePolicy - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either RoutePolicy or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.RoutePolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - route_policy_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.RoutePolicy]: - """Create Route Policy. - - Implements Route Policy PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param route_policy_name: Name of the Route Policy. Required. - :type route_policy_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either RoutePolicy or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.RoutePolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, resource_group_name: str, route_policy_name: str, body: Union[_models.RoutePolicy, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.RoutePolicy]: - """Create Route Policy. - - Implements Route Policy PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param route_policy_name: Name of the Route Policy. Required. - :type route_policy_name: str - :param body: Request payload. Is either a RoutePolicy type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.RoutePolicy or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either RoutePolicy or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.RoutePolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RoutePolicy] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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, - route_policy_name=route_policy_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("RoutePolicy", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}" - } - - @distributed_trace_async - async def get(self, resource_group_name: str, route_policy_name: str, **kwargs: Any) -> _models.RoutePolicy: - """Gets a Route Policy. - - Implements Route Policy GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param route_policy_name: Name of the Route Policy. Required. - :type route_policy_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RoutePolicy or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.RoutePolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.RoutePolicy] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - route_policy_name=route_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("RoutePolicy", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}" - } - - async def _update_initial( - self, resource_group_name: str, route_policy_name: str, body: Union[_models.RoutePolicyPatch, IO], **kwargs: Any - ) -> Optional[_models.RoutePolicy]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.RoutePolicy]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "RoutePolicyPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - route_policy_name=route_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("RoutePolicy", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}" - } - - @overload - async def begin_update( - self, - resource_group_name: str, - route_policy_name: str, - body: _models.RoutePolicyPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.RoutePolicy]: - """Updates a Route Policy. - - API to update certain properties of the Route Policy resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param route_policy_name: Name of the Route Policy. Required. - :type route_policy_name: str - :param body: Route Policy properties to update. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.RoutePolicyPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either RoutePolicy or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.RoutePolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - route_policy_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.RoutePolicy]: - """Updates a Route Policy. - - API to update certain properties of the Route Policy resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param route_policy_name: Name of the Route Policy. Required. - :type route_policy_name: str - :param body: Route Policy properties to update. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either RoutePolicy or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.RoutePolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, resource_group_name: str, route_policy_name: str, body: Union[_models.RoutePolicyPatch, IO], **kwargs: Any - ) -> AsyncLROPoller[_models.RoutePolicy]: - """Updates a Route Policy. - - API to update certain properties of the Route Policy resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param route_policy_name: Name of the Route Policy. Required. - :type route_policy_name: str - :param body: Route Policy properties to update. Is either a RoutePolicyPatch type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.RoutePolicyPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either RoutePolicy or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.RoutePolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RoutePolicy] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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_policy_name=route_policy_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("RoutePolicy", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, route_policy_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - route_policy_name=route_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}" - } - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, route_policy_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a Route Policy. - - Implements Route Policy DELETE method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param route_policy_name: Name of the Route Policy. Required. - :type route_policy_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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_policy_name=route_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, {}) - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}" - } - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.RoutePolicy"]: - """List RoutePolicies by resource group. - - Implements RoutePolicies list by resource group GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RoutePolicy or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.RoutePolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.RoutePoliciesListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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("RoutePoliciesListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.RoutePolicy"]: - """List RoutePolicies by subscription. - - Implements RoutePolicies list by subscription GET method. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RoutePolicy or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.managednetworkfabric.models.RoutePolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.RoutePoliciesListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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("RoutePoliciesListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/routePolicies" - } - - async def _update_administrative_state_initial( - self, - resource_group_name: str, - route_policy_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForDeviceUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForDeviceUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_administrative_state_request( - resource_group_name=resource_group_name, - route_policy_name=route_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_administrative_state_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_administrative_state_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/updateAdministrativeState" - } - - @overload - async def begin_update_administrative_state( - self, - resource_group_name: str, - route_policy_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForDeviceUpdate]: - """Executes enable operation to the underlying resources. - - Updated the admin state for this Route Policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param route_policy_name: Name of the Route Policy. Required. - :type route_policy_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForDeviceUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update_administrative_state( - self, - resource_group_name: str, - route_policy_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForDeviceUpdate]: - """Executes enable operation to the underlying resources. - - Updated the admin state for this Route Policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param route_policy_name: Name of the Route Policy. Required. - :type route_policy_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForDeviceUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update_administrative_state( - self, - resource_group_name: str, - route_policy_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForDeviceUpdate]: - """Executes enable operation to the underlying resources. - - Updated the admin state for this Route Policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param route_policy_name: Name of the Route Policy. Required. - :type route_policy_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForDeviceUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForDeviceUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("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_administrative_state_initial( - resource_group_name=resource_group_name, - route_policy_name=route_policy_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_administrative_state.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/updateAdministrativeState" - } - - async def _validate_configuration_initial( - self, resource_group_name: str, route_policy_name: str, **kwargs: Any - ) -> _models.ValidateConfigurationResponse: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ValidateConfigurationResponse] = kwargs.pop("cls", None) - - request = build_validate_configuration_request( - resource_group_name=resource_group_name, - route_policy_name=route_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._validate_configuration_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _validate_configuration_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/validateConfiguration" - } - - @distributed_trace_async - async def begin_validate_configuration( - self, resource_group_name: str, route_policy_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.ValidateConfigurationResponse]: - """Validates the configuration of the resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param route_policy_name: Name of the Route Policy. Required. - :type route_policy_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ValidateConfigurationResponse or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ValidateConfigurationResponse] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._validate_configuration_initial( - resource_group_name=resource_group_name, - route_policy_name=route_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): - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/validateConfiguration" - } - - async def _commit_configuration_initial( - self, resource_group_name: str, route_policy_name: str, **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - request = build_commit_configuration_request( - resource_group_name=resource_group_name, - route_policy_name=route_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._commit_configuration_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _commit_configuration_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/commitConfiguration" - } - - @distributed_trace_async - async def begin_commit_configuration( - self, resource_group_name: str, route_policy_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Execute the commit on the resources. - - Commits the configuration of the given resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param route_policy_name: Name of the Route Policy. Required. - :type route_policy_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - CommonPostActionResponseForStateUpdate or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._commit_configuration_initial( - resource_group_name=resource_group_name, - route_policy_name=route_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): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_commit_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/commitConfiguration" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/models/__init__.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/models/__init__.py index b0f438aaf4e0..79808f715606 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/models/__init__.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/models/__init__.py @@ -2,542 +2,911 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._models_py3 import AccessControlList -from ._models_py3 import AccessControlListAction -from ._models_py3 import AccessControlListMatchCondition -from ._models_py3 import AccessControlListMatchConfiguration -from ._models_py3 import AccessControlListPatch -from ._models_py3 import AccessControlListPatchProperties -from ._models_py3 import AccessControlListPatchableProperties -from ._models_py3 import AccessControlListPortCondition -from ._models_py3 import AccessControlListProperties -from ._models_py3 import AccessControlListsListResult -from ._models_py3 import ActionIpCommunityProperties -from ._models_py3 import ActionIpExtendedCommunityProperties -from ._models_py3 import AggregateRoute -from ._models_py3 import AggregateRouteConfiguration -from ._models_py3 import AnnotationResource -from ._models_py3 import BfdConfiguration -from ._models_py3 import BgpConfiguration -from ._models_py3 import CommonDynamicMatchConfiguration -from ._models_py3 import CommonMatchConditions -from ._models_py3 import CommonPostActionResponseForDeviceUpdate -from ._models_py3 import CommonPostActionResponseForStateUpdate -from ._models_py3 import ConnectedSubnet -from ._models_py3 import ConnectedSubnetRoutePolicy -from ._models_py3 import ControllerServices -from ._models_py3 import DestinationProperties -from ._models_py3 import DeviceInterfaceProperties -from ._models_py3 import EnableDisableOnResources -from ._models_py3 import ErrorAdditionalInfo -from ._models_py3 import ErrorDetail -from ._models_py3 import ErrorResponse -from ._models_py3 import ExportRoutePolicy -from ._models_py3 import ExportRoutePolicyInformation -from ._models_py3 import ExpressRouteConnectionInformation -from ._models_py3 import ExtendedLocation -from ._models_py3 import ExtensionEnumProperty -from ._models_py3 import ExternalNetwork -from ._models_py3 import ExternalNetworkPatch -from ._models_py3 import ExternalNetworkPatchProperties -from ._models_py3 import ExternalNetworkPatchPropertiesOptionAProperties -from ._models_py3 import ExternalNetworkPatchableProperties -from ._models_py3 import ExternalNetworkProperties -from ._models_py3 import ExternalNetworkPropertiesOptionAProperties -from ._models_py3 import ExternalNetworksList -from ._models_py3 import ImportRoutePolicy -from ._models_py3 import ImportRoutePolicyInformation -from ._models_py3 import InternalNetwork -from ._models_py3 import InternalNetworkPatch -from ._models_py3 import InternalNetworkPatchProperties -from ._models_py3 import InternalNetworkPatchableProperties -from ._models_py3 import InternalNetworkProperties -from ._models_py3 import InternalNetworkPropertiesBgpConfiguration -from ._models_py3 import InternalNetworkPropertiesStaticRouteConfiguration -from ._models_py3 import InternalNetworksList -from ._models_py3 import InternetGateway -from ._models_py3 import InternetGatewayPatch -from ._models_py3 import InternetGatewayPatchableProperties -from ._models_py3 import InternetGatewayProperties -from ._models_py3 import InternetGatewayRule -from ._models_py3 import InternetGatewayRulePatch -from ._models_py3 import InternetGatewayRuleProperties -from ._models_py3 import InternetGatewayRulesListResult -from ._models_py3 import InternetGatewaysListResult -from ._models_py3 import IpCommunitiesListResult -from ._models_py3 import IpCommunity -from ._models_py3 import IpCommunityAddOperationProperties -from ._models_py3 import IpCommunityDeleteOperationProperties -from ._models_py3 import IpCommunityIdList -from ._models_py3 import IpCommunityPatch -from ._models_py3 import IpCommunityPatchableProperties -from ._models_py3 import IpCommunityProperties -from ._models_py3 import IpCommunityRule -from ._models_py3 import IpCommunitySetOperationProperties -from ._models_py3 import IpExtendedCommunity -from ._models_py3 import IpExtendedCommunityAddOperationProperties -from ._models_py3 import IpExtendedCommunityDeleteOperationProperties -from ._models_py3 import IpExtendedCommunityIdList -from ._models_py3 import IpExtendedCommunityListResult -from ._models_py3 import IpExtendedCommunityPatch -from ._models_py3 import IpExtendedCommunityPatchProperties -from ._models_py3 import IpExtendedCommunityPatchableProperties -from ._models_py3 import IpExtendedCommunityProperties -from ._models_py3 import IpExtendedCommunityRule -from ._models_py3 import IpExtendedCommunitySetOperationProperties -from ._models_py3 import IpGroupProperties -from ._models_py3 import IpMatchCondition -from ._models_py3 import IpPrefix -from ._models_py3 import IpPrefixPatch -from ._models_py3 import IpPrefixPatchProperties -from ._models_py3 import IpPrefixPatchableProperties -from ._models_py3 import IpPrefixProperties -from ._models_py3 import IpPrefixRule -from ._models_py3 import IpPrefixesListResult -from ._models_py3 import IsolationDomainProperties -from ._models_py3 import L2IsolationDomain -from ._models_py3 import L2IsolationDomainPatch -from ._models_py3 import L2IsolationDomainPatchProperties -from ._models_py3 import L2IsolationDomainProperties -from ._models_py3 import L2IsolationDomainsListResult -from ._models_py3 import L3ExportRoutePolicy -from ._models_py3 import L3IsolationDomain -from ._models_py3 import L3IsolationDomainPatch -from ._models_py3 import L3IsolationDomainPatchProperties -from ._models_py3 import L3IsolationDomainPatchableProperties -from ._models_py3 import L3IsolationDomainProperties -from ._models_py3 import L3IsolationDomainsListResult -from ._models_py3 import L3OptionAProperties -from ._models_py3 import L3OptionBProperties -from ._models_py3 import Layer2Configuration -from ._models_py3 import Layer3IpPrefixProperties -from ._models_py3 import ManagedResourceGroupConfiguration -from ._models_py3 import ManagementNetworkConfigurationPatchableProperties -from ._models_py3 import ManagementNetworkConfigurationProperties -from ._models_py3 import NeighborAddress -from ._models_py3 import NeighborGroup -from ._models_py3 import NeighborGroupDestination -from ._models_py3 import NeighborGroupPatch -from ._models_py3 import NeighborGroupPatchProperties -from ._models_py3 import NeighborGroupPatchableProperties -from ._models_py3 import NeighborGroupProperties -from ._models_py3 import NeighborGroupsListResult -from ._models_py3 import NetworkDevice -from ._models_py3 import NetworkDevicePatchParameters -from ._models_py3 import NetworkDevicePatchParametersProperties -from ._models_py3 import NetworkDevicePatchableProperties -from ._models_py3 import NetworkDeviceProperties -from ._models_py3 import NetworkDeviceSku -from ._models_py3 import NetworkDeviceSkusListResult -from ._models_py3 import NetworkDevicesListResult -from ._models_py3 import NetworkFabric -from ._models_py3 import NetworkFabricController -from ._models_py3 import NetworkFabricControllerPatch -from ._models_py3 import NetworkFabricControllerPatchableProperties -from ._models_py3 import NetworkFabricControllerProperties -from ._models_py3 import NetworkFabricControllersListResult -from ._models_py3 import NetworkFabricPatch -from ._models_py3 import NetworkFabricPatchProperties -from ._models_py3 import NetworkFabricPatchableProperties -from ._models_py3 import NetworkFabricPatchablePropertiesTerminalServerConfiguration -from ._models_py3 import NetworkFabricProperties -from ._models_py3 import NetworkFabricSku -from ._models_py3 import NetworkFabricSkusListResult -from ._models_py3 import NetworkFabricsListResult -from ._models_py3 import NetworkInterface -from ._models_py3 import NetworkInterfacePatch -from ._models_py3 import NetworkInterfacePatchProperties -from ._models_py3 import NetworkInterfaceProperties -from ._models_py3 import NetworkInterfacesList -from ._models_py3 import NetworkPacketBroker -from ._models_py3 import NetworkPacketBrokerPatch -from ._models_py3 import NetworkPacketBrokersListResult -from ._models_py3 import NetworkRack -from ._models_py3 import NetworkRackProperties -from ._models_py3 import NetworkRacksListResult -from ._models_py3 import NetworkTap -from ._models_py3 import NetworkTapPatch -from ._models_py3 import NetworkTapPatchableParameters -from ._models_py3 import NetworkTapPatchableParametersDestinationsItem -from ._models_py3 import NetworkTapProperties -from ._models_py3 import NetworkTapPropertiesDestinationsItem -from ._models_py3 import NetworkTapRule -from ._models_py3 import NetworkTapRuleAction -from ._models_py3 import NetworkTapRuleMatchCondition -from ._models_py3 import NetworkTapRuleMatchConfiguration -from ._models_py3 import NetworkTapRulePatch -from ._models_py3 import NetworkTapRulePatchProperties -from ._models_py3 import NetworkTapRulePatchableProperties -from ._models_py3 import NetworkTapRuleProperties -from ._models_py3 import NetworkTapRulesListResult -from ._models_py3 import NetworkTapsListResult -from ._models_py3 import NetworkToNetworkInterconnect -from ._models_py3 import NetworkToNetworkInterconnectPatch -from ._models_py3 import NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration -from ._models_py3 import NetworkToNetworkInterconnectsList -from ._models_py3 import NpbStaticRouteConfiguration -from ._models_py3 import Operation -from ._models_py3 import OperationDisplay -from ._models_py3 import OperationListResult -from ._models_py3 import OptionAProperties -from ._models_py3 import OptionBLayer3Configuration -from ._models_py3 import OptionBProperties -from ._models_py3 import PortCondition -from ._models_py3 import PortGroupProperties -from ._models_py3 import ProxyResource -from ._models_py3 import RebootProperties -from ._models_py3 import Resource -from ._models_py3 import RoutePoliciesListResult -from ._models_py3 import RoutePolicy -from ._models_py3 import RoutePolicyPatch -from ._models_py3 import RoutePolicyPatchableProperties -from ._models_py3 import RoutePolicyProperties -from ._models_py3 import RoutePolicyStatementProperties -from ._models_py3 import RouteTargetInformation -from ._models_py3 import RuleProperties -from ._models_py3 import StatementActionProperties -from ._models_py3 import StatementConditionProperties -from ._models_py3 import StaticRouteConfiguration -from ._models_py3 import StaticRouteProperties -from ._models_py3 import SupportedConnectorProperties -from ._models_py3 import SupportedVersionProperties -from ._models_py3 import SystemData -from ._models_py3 import TagsUpdate -from ._models_py3 import TerminalServerConfiguration -from ._models_py3 import TerminalServerPatchableProperties -from ._models_py3 import TrackedResource -from ._models_py3 import UpdateAdministrativeState -from ._models_py3 import UpdateDeviceAdministrativeState -from ._models_py3 import UpdateVersion -from ._models_py3 import ValidateConfigurationProperties -from ._models_py3 import ValidateConfigurationResponse -from ._models_py3 import VlanGroupProperties -from ._models_py3 import VlanMatchCondition -from ._models_py3 import VpnConfigurationPatchableProperties -from ._models_py3 import VpnConfigurationPatchablePropertiesOptionAProperties -from ._models_py3 import VpnConfigurationProperties -from ._models_py3 import VpnConfigurationPropertiesOptionAProperties +from typing import TYPE_CHECKING -from ._managed_network_fabric_mgmt_client_enums import AclActionType -from ._managed_network_fabric_mgmt_client_enums import Action -from ._managed_network_fabric_mgmt_client_enums import ActionType -from ._managed_network_fabric_mgmt_client_enums import AddressFamilyType -from ._managed_network_fabric_mgmt_client_enums import AdministrativeState -from ._managed_network_fabric_mgmt_client_enums import AllowASOverride -from ._managed_network_fabric_mgmt_client_enums import BfdAdministrativeState -from ._managed_network_fabric_mgmt_client_enums import BooleanEnumProperty -from ._managed_network_fabric_mgmt_client_enums import CommunityActionTypes -from ._managed_network_fabric_mgmt_client_enums import Condition -from ._managed_network_fabric_mgmt_client_enums import ConfigurationState -from ._managed_network_fabric_mgmt_client_enums import ConfigurationType -from ._managed_network_fabric_mgmt_client_enums import CreatedByType -from ._managed_network_fabric_mgmt_client_enums import DestinationType -from ._managed_network_fabric_mgmt_client_enums import DeviceAdministrativeState -from ._managed_network_fabric_mgmt_client_enums import EnableDisableState -from ._managed_network_fabric_mgmt_client_enums import Encapsulation -from ._managed_network_fabric_mgmt_client_enums import EncapsulationType -from ._managed_network_fabric_mgmt_client_enums import Extension -from ._managed_network_fabric_mgmt_client_enums import FabricSkuType -from ._managed_network_fabric_mgmt_client_enums import GatewayType -from ._managed_network_fabric_mgmt_client_enums import IPAddressType -from ._managed_network_fabric_mgmt_client_enums import InterfaceType -from ._managed_network_fabric_mgmt_client_enums import IsManagementType -from ._managed_network_fabric_mgmt_client_enums import IsMonitoringEnabled -from ._managed_network_fabric_mgmt_client_enums import IsWorkloadManagementNetworkEnabled -from ._managed_network_fabric_mgmt_client_enums import Layer4Protocol -from ._managed_network_fabric_mgmt_client_enums import NetworkDeviceRole -from ._managed_network_fabric_mgmt_client_enums import NetworkDeviceRoleName -from ._managed_network_fabric_mgmt_client_enums import NetworkRackType -from ._managed_network_fabric_mgmt_client_enums import NfcSku -from ._managed_network_fabric_mgmt_client_enums import NniType -from ._managed_network_fabric_mgmt_client_enums import Origin -from ._managed_network_fabric_mgmt_client_enums import PeeringOption -from ._managed_network_fabric_mgmt_client_enums import PollingIntervalInSeconds -from ._managed_network_fabric_mgmt_client_enums import PollingType -from ._managed_network_fabric_mgmt_client_enums import PortType -from ._managed_network_fabric_mgmt_client_enums import PrefixType -from ._managed_network_fabric_mgmt_client_enums import ProvisioningState -from ._managed_network_fabric_mgmt_client_enums import RebootType -from ._managed_network_fabric_mgmt_client_enums import RedistributeConnectedSubnets -from ._managed_network_fabric_mgmt_client_enums import RedistributeStaticRoutes -from ._managed_network_fabric_mgmt_client_enums import RoutePolicyActionType -from ._managed_network_fabric_mgmt_client_enums import RoutePolicyConditionType -from ._managed_network_fabric_mgmt_client_enums import SourceDestinationType -from ._managed_network_fabric_mgmt_client_enums import TapRuleActionType -from ._managed_network_fabric_mgmt_client_enums import ValidateAction -from ._managed_network_fabric_mgmt_client_enums import WellKnownCommunities +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models import ( # type: ignore + AccessControlList, + AccessControlListAction, + AccessControlListActionPatch, + AccessControlListMatchCondition, + AccessControlListMatchConditionPatch, + AccessControlListMatchConfiguration, + AccessControlListMatchConfigurationPatch, + AccessControlListPatch, + AccessControlListPatchProperties, + AccessControlListPortCondition, + AccessControlListPortConditionPatch, + AccessControlListProperties, + ActionIpCommunityPatchProperties, + ActionIpCommunityProperties, + ActionIpExtendedCommunityPatchProperties, + ActionIpExtendedCommunityProperties, + AggregateRoute, + AggregateRouteConfiguration, + AggregateRoutePatchConfiguration, + AnnotationResource, + ArmConfigurationDiffOperationResponse, + ArmConfigurationDiffResponseProperties, + AuthorizedTransceiverPatchProperties, + AuthorizedTransceiverProperties, + BfdConfiguration, + BfdPatchConfiguration, + BgpConfiguration, + BgpPatchConfiguration, + BitRate, + BmpConfigurationPatchProperties, + BmpConfigurationProperties, + BmpExportPolicyPatchProperties, + BmpExportPolicyProperties, + BurstSize, + CertificateArchiveReference, + CertificateRotationStatus, + CommitBatchDetails, + CommitBatchStatusOperationResponse, + CommitBatchStatusRequest, + CommitBatchStatusResponseProperties, + CommitConfigurationRequest, + CommitConfigurationResponse, + CommonDynamicMatchConfiguration, + CommonDynamicMatchConfigurationPatch, + CommonErrorResponse, + CommonMatchConditions, + CommonMatchConditionsPatch, + CommonPostActionResponseForDeviceROCommands, + CommonPostActionResponseForDeviceROCommandsOperationStatusResult, + CommonPostActionResponseForDeviceUpdate, + CommonPostActionResponseForStateUpdate, + ConditionalDefaultRouteProperties, + ConnectedSubnet, + ConnectedSubnetPatch, + ConnectedSubnetRoutePolicy, + ConnectedSubnetRoutePolicyPatch, + ControlPlanAclIpMatchCondition, + ControlPlaneAclAction, + ControlPlaneAclActionPatch, + ControlPlaneAclIpMatchConditionPatch, + ControlPlaneAclMatchCondition, + ControlPlaneAclMatchConditionPatch, + ControlPlaneAclMatchConfigurationPatchProperties, + ControlPlaneAclMatchConfigurationProperties, + ControlPlaneAclPatchProperties, + ControlPlaneAclPortCondition, + ControlPlaneAclPortMatchCondition, + ControlPlaneAclPortMatchConditionPatch, + ControlPlaneAclProperties, + ControlPlaneAclTtlMatchCondition, + ControlPlaneAclTtlMatchConditionPatch, + ControllerServices, + DestinationPatchProperties, + DestinationProperties, + DeviceInterfaceProperties, + DeviceRoCommand, + DeviceRwCommand, + DiscardCommitBatchOperationResponse, + DiscardCommitBatchRequest, + DiscardCommitBatchResponseProperties, + EnableDisableOnResources, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + ExportRoutePolicy, + ExportRoutePolicyInformation, + ExportRoutePolicyInformationPatch, + ExportRoutePolicyPatch, + ExpressRouteConnectionInformation, + ExternalNetwork, + ExternalNetworkBmpPatchProperties, + ExternalNetworkBmpProperties, + ExternalNetworkPatch, + ExternalNetworkPatchProperties, + ExternalNetworkPatchPropertiesOptionAProperties, + ExternalNetworkProperties, + ExternalNetworkPropertiesOptionAProperties, + ExternalNetworkStaticRouteConfiguration, + ExternalNetworkStaticRoutePatchConfiguration, + ExternalNetworkUpdateBfdAdministrativeStateRequest, + ExternalNetworkUpdateBfdAdministrativeStateResponse, + ExternalNetworkUpdateBfdAdministrativeStateResponseProperties, + FabricLockProperties, + FeatureFlagProperties, + GetTopologyResponse, + GetTopologyResponseProperties, + GlobalAccessControlListActionPatchProperties, + GlobalAccessControlListActionProperties, + GlobalNetworkTapRuleActionPatchProperties, + GlobalNetworkTapRuleActionProperties, + HeaderAddressProperties, + IcmpConfigurationPatchProperties, + IcmpConfigurationProperties, + IdentitySelector, + IdentitySelectorPatch, + ImportRoutePolicy, + ImportRoutePolicyInformation, + ImportRoutePolicyInformationPatch, + ImportRoutePolicyPatch, + InternalNetwork, + InternalNetworkBmpPatchProperties, + InternalNetworkBmpProperties, + InternalNetworkPatch, + InternalNetworkPatchProperties, + InternalNetworkProperties, + InternalNetworkUpdateBfdAdministrativeStateRequest, + InternalNetworkUpdateBfdAdministrativeStateResponse, + InternalNetworkUpdateBfdAdministrativeStateResponseProperties, + InternalNetworkUpdateBgpAdministrativeStateRequest, + InternalNetworkUpdateBgpAdministrativeStateResponse, + InternalNetworkUpdateBgpAdministrativeStateResponseProperties, + InternetGateway, + InternetGatewayPatch, + InternetGatewayPatchProperties, + InternetGatewayProperties, + InternetGatewayRule, + InternetGatewayRulePatch, + InternetGatewayRuleProperties, + IpCommunity, + IpCommunityIdList, + IpCommunityPatch, + IpCommunityPatchableProperties, + IpCommunityProperties, + IpCommunityRule, + IpExtendedCommunity, + IpExtendedCommunityIdList, + IpExtendedCommunityPatch, + IpExtendedCommunityPatchProperties, + IpExtendedCommunityProperties, + IpExtendedCommunityRule, + IpGroupPatchProperties, + IpGroupProperties, + IpMatchCondition, + IpMatchConditionPatch, + IpPrefix, + IpPrefixPatch, + IpPrefixPatchProperties, + IpPrefixProperties, + IpPrefixRule, + IsolationDomainPatchProperties, + IsolationDomainProperties, + L2IsolationDomain, + L2IsolationDomainPatch, + L2IsolationDomainPatchProperties, + L2IsolationDomainProperties, + L3ExportRoutePolicy, + L3ExportRoutePolicyPatch, + L3IsolationDomain, + L3IsolationDomainPatch, + L3IsolationDomainPatchProperties, + L3IsolationDomainProperties, + L3OptionBPatchProperties, + L3OptionBProperties, + L3UniqueRouteDistinguisherProperties, + LastOperationProperties, + Layer2Configuration, + Layer2ConfigurationPatch, + Layer3IpPrefixPatchProperties, + Layer3IpPrefixProperties, + ManagedResourceGroupConfiguration, + ManagedServiceIdentity, + ManagedServiceIdentityPatch, + ManagementNetworkConfigurationProperties, + ManagementNetworkPatchConfiguration, + NativeIpv4PrefixLimitPatchProperties, + NativeIpv4PrefixLimitProperties, + NativeIpv6PrefixLimitPatchProperties, + NativeIpv6PrefixLimitProperties, + NeighborAddress, + NeighborAddressBfdAdministrativeStatus, + NeighborAddressBgpAdministrativeStatus, + NeighborAddressPatch, + NeighborGroup, + NeighborGroupDestination, + NeighborGroupDestinationPatch, + NeighborGroupPatch, + NeighborGroupPatchProperties, + NeighborGroupProperties, + NeighborGroupResyncResponse, + NetworkBootstrapDevice, + NetworkBootstrapDevicePatch, + NetworkBootstrapDevicePatchProperties, + NetworkBootstrapDeviceProperties, + NetworkBootstrapDeviceRebootResponse, + NetworkBootstrapDeviceRefreshConfigurationResponse, + NetworkBootstrapDeviceResyncPasswordsResponse, + NetworkBootstrapDeviceUpdateAdministrativeStateResponse, + NetworkBootstrapDeviceUpgradeResponse, + NetworkBootstrapInterface, + NetworkBootstrapInterfacePatch, + NetworkBootstrapInterfacePatchProperties, + NetworkBootstrapInterfaceProperties, + NetworkDevice, + NetworkDevicePatchParameters, + NetworkDevicePatchParametersProperties, + NetworkDeviceProperties, + NetworkDeviceRefreshConfigurationResponse, + NetworkDeviceResyncPasswordsResponse, + NetworkDeviceRunRwCommandResponse, + NetworkDeviceRwCommandResponseProperties, + NetworkDeviceSku, + NetworkDeviceSkuProperties, + NetworkDeviceUpdateAdministrativeStateResponse, + NetworkDeviceUpgradeRequest, + NetworkDeviceUpgradeResponse, + NetworkFabric, + NetworkFabricController, + NetworkFabricControllerPatch, + NetworkFabricControllerPatchProperties, + NetworkFabricControllerProperties, + NetworkFabricLockRequest, + NetworkFabricPatch, + NetworkFabricPatchProperties, + NetworkFabricProperties, + NetworkFabricResyncCertificatesResponse, + NetworkFabricResyncPasswordsResponse, + NetworkFabricRotateCertificatesResponse, + NetworkFabricRotatePasswordsResponse, + NetworkFabricSku, + NetworkFabricSkuProperties, + NetworkInterface, + NetworkInterfacePatch, + NetworkInterfacePatchProperties, + NetworkInterfaceProperties, + NetworkMonitor, + NetworkMonitorPatch, + NetworkMonitorPatchProperties, + NetworkMonitorProperties, + NetworkPacketBroker, + NetworkPacketBrokerPatch, + NetworkPacketBrokerProperties, + NetworkRack, + NetworkRackPatch, + NetworkRackProperties, + NetworkTap, + NetworkTapPatch, + NetworkTapPatchProperties, + NetworkTapProperties, + NetworkTapResyncResponse, + NetworkTapRule, + NetworkTapRuleAction, + NetworkTapRuleActionPatch, + NetworkTapRuleMatchCondition, + NetworkTapRuleMatchConditionPatch, + NetworkTapRuleMatchConfiguration, + NetworkTapRuleMatchConfigurationPatch, + NetworkTapRulePatch, + NetworkTapRulePatchProperties, + NetworkTapRuleProperties, + NetworkTapRuleResyncResponse, + NetworkToNetworkInterconnect, + NetworkToNetworkInterconnectPatch, + NetworkToNetworkInterconnectPatchProperties, + NetworkToNetworkInterconnectProperties, + NniBmpPatchProperties, + NniBmpProperties, + NniStaticRouteConfiguration, + NniStaticRoutePatchConfiguration, + NniUpdateBfdAdministrativeStateRequest, + NniUpdateBfdAdministrativeStateResponse, + NniUpdateBfdAdministrativeStateResponseProperties, + NpbStaticRouteConfiguration, + NpbStaticRouteConfigurationPatch, + Operation, + OperationDisplay, + OperationStatusResult, + OptionBLayer3Configuration, + OptionBLayer3ConfigurationPatchProperties, + OptionBLayer3PrefixLimitPatchProperties, + OptionBLayer3PrefixLimitProperties, + PoliceRateConfigurationProperties, + PortCondition, + PortConditionPatch, + PortGroupPatchProperties, + PortGroupProperties, + PrefixLimitPatchProperties, + PrefixLimitProperties, + ProxyResource, + ProxyResourceBase, + QosPatchProperties, + QosProperties, + RebootProperties, + Resource, + RoutePolicy, + RoutePolicyPatch, + RoutePolicyPatchableProperties, + RoutePolicyProperties, + RoutePolicyStatementPatchProperties, + RoutePolicyStatementProperties, + RoutePrefixLimitPatchProperties, + RoutePrefixLimitProperties, + RouteTargetInformation, + RouteTargetPatchInformation, + RuleProperties, + SecretArchiveReference, + SecretRotationStatus, + SecretRotationSummary, + StatementActionPatchProperties, + StatementActionProperties, + StatementConditionPatchProperties, + StatementConditionProperties, + StaticRouteConfiguration, + StaticRoutePatchConfiguration, + StaticRoutePatchProperties, + StaticRouteProperties, + StaticRouteRoutePolicy, + StaticRouteRoutePolicyPatch, + StationConnectionPatchProperties, + StationConnectionProperties, + StorageAccountConfiguration, + StorageAccountPatchConfiguration, + SupportedConnectorProperties, + SupportedVersionProperties, + SystemData, + TagsUpdate, + TerminalServerConfiguration, + TerminalServerPatchConfiguration, + TrackedResource, + UniqueRouteDistinguisherPatchProperties, + UniqueRouteDistinguisherProperties, + UpdateAdministrativeState, + UpdateAdministrativeStateResponse, + UpdateAdministrativeStateResponseProperties, + UpdateDeviceAdministrativeState, + UpdateVersion, + UpgradeNetworkFabricProperties, + UserAssignedIdentity, + ValidateConfigurationProperties, + ValidateConfigurationResponse, + ViewDeviceConfigurationOperationResponse, + ViewDeviceConfigurationResponseProperties, + VlanGroupPatchProperties, + VlanGroupProperties, + VlanMatchCondition, + VlanMatchConditionPatch, + VpnConfigurationPatchableProperties, + VpnConfigurationProperties, + VpnOptionAPatchProperties, + VpnOptionAProperties, + VpnOptionBPatchProperties, + VpnOptionBProperties, +) + +from ._enums import ( # type: ignore + AclActionType, + AclType, + Action, + ActionType, + AddressFamilyType, + AdministrativeState, + AllowASOverride, + BfdAdministrativeState, + BgpAdministrativeState, + BitRateUnit, + BmpConfigurationState, + BmpExportPolicy, + BmpMonitoredAddressFamily, + BooleanEnumProperty, + BurstSizeUnit, + CommitBatchState, + CommitConfigurationPolicy, + CommitStage, + CommunityActionTypes, + Condition, + ConfigurationState, + ConfigurationType, + ControlPlaneAclActionType, + ControlPlaneAclPortMatchType, + ControlPlaneAclTtlMatchType, + CreatedByType, + DestinationType, + DeviceAdministrativeState, + DeviceRole, + EnableDisableState, + Encapsulation, + EncapsulationType, + ExtendedVlan, + Extension, + ExternalNetworkRouteType, + FabricSkuType, + GatewayType, + IPAddressType, + InterfaceType, + InternalNetworkRouteType, + IsManagementType, + IsMonitoringEnabled, + IsWorkloadManagementNetworkEnabled, + Layer4Protocol, + LockConfigurationState, + ManagedServiceIdentitySelectorType, + ManagedServiceIdentityType, + MicroBfdState, + NNIDerivedUniqueRouteDistinguisherConfigurationState, + NetworkDeviceRole, + NetworkDeviceRoleName, + NetworkFabricLockAction, + NetworkFabricLockType, + NetworkFabricUpgradeAction, + NetworkRackType, + NfcSku, + NniType, + Origin, + PeeringOption, + PollingType, + PortType, + PrefixType, + ProvisioningState, + QosConfigurationState, + RebootType, + RedistributeConnectedSubnets, + RedistributeStaticRoutes, + RoutePolicyActionType, + RoutePolicyConditionType, + RouteType, + RuleCondition, + SourceDestinationType, + StationConfigurationState, + StationConnectionMode, + SynchronizationStatus, + TapRuleActionType, + UniqueRouteDistinguisherConfigurationState, + V4OverV6BgpSessionState, + V6OverV4BgpSessionState, + ValidateAction, + WellKnownCommunities, +) from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ "AccessControlList", "AccessControlListAction", + "AccessControlListActionPatch", "AccessControlListMatchCondition", + "AccessControlListMatchConditionPatch", "AccessControlListMatchConfiguration", + "AccessControlListMatchConfigurationPatch", "AccessControlListPatch", "AccessControlListPatchProperties", - "AccessControlListPatchableProperties", "AccessControlListPortCondition", + "AccessControlListPortConditionPatch", "AccessControlListProperties", - "AccessControlListsListResult", + "ActionIpCommunityPatchProperties", "ActionIpCommunityProperties", + "ActionIpExtendedCommunityPatchProperties", "ActionIpExtendedCommunityProperties", "AggregateRoute", "AggregateRouteConfiguration", + "AggregateRoutePatchConfiguration", "AnnotationResource", + "ArmConfigurationDiffOperationResponse", + "ArmConfigurationDiffResponseProperties", + "AuthorizedTransceiverPatchProperties", + "AuthorizedTransceiverProperties", "BfdConfiguration", + "BfdPatchConfiguration", "BgpConfiguration", + "BgpPatchConfiguration", + "BitRate", + "BmpConfigurationPatchProperties", + "BmpConfigurationProperties", + "BmpExportPolicyPatchProperties", + "BmpExportPolicyProperties", + "BurstSize", + "CertificateArchiveReference", + "CertificateRotationStatus", + "CommitBatchDetails", + "CommitBatchStatusOperationResponse", + "CommitBatchStatusRequest", + "CommitBatchStatusResponseProperties", + "CommitConfigurationRequest", + "CommitConfigurationResponse", "CommonDynamicMatchConfiguration", + "CommonDynamicMatchConfigurationPatch", + "CommonErrorResponse", "CommonMatchConditions", + "CommonMatchConditionsPatch", + "CommonPostActionResponseForDeviceROCommands", + "CommonPostActionResponseForDeviceROCommandsOperationStatusResult", "CommonPostActionResponseForDeviceUpdate", "CommonPostActionResponseForStateUpdate", + "ConditionalDefaultRouteProperties", "ConnectedSubnet", + "ConnectedSubnetPatch", "ConnectedSubnetRoutePolicy", + "ConnectedSubnetRoutePolicyPatch", + "ControlPlanAclIpMatchCondition", + "ControlPlaneAclAction", + "ControlPlaneAclActionPatch", + "ControlPlaneAclIpMatchConditionPatch", + "ControlPlaneAclMatchCondition", + "ControlPlaneAclMatchConditionPatch", + "ControlPlaneAclMatchConfigurationPatchProperties", + "ControlPlaneAclMatchConfigurationProperties", + "ControlPlaneAclPatchProperties", + "ControlPlaneAclPortCondition", + "ControlPlaneAclPortMatchCondition", + "ControlPlaneAclPortMatchConditionPatch", + "ControlPlaneAclProperties", + "ControlPlaneAclTtlMatchCondition", + "ControlPlaneAclTtlMatchConditionPatch", "ControllerServices", + "DestinationPatchProperties", "DestinationProperties", "DeviceInterfaceProperties", + "DeviceRoCommand", + "DeviceRwCommand", + "DiscardCommitBatchOperationResponse", + "DiscardCommitBatchRequest", + "DiscardCommitBatchResponseProperties", "EnableDisableOnResources", "ErrorAdditionalInfo", "ErrorDetail", "ErrorResponse", "ExportRoutePolicy", "ExportRoutePolicyInformation", + "ExportRoutePolicyInformationPatch", + "ExportRoutePolicyPatch", "ExpressRouteConnectionInformation", - "ExtendedLocation", - "ExtensionEnumProperty", "ExternalNetwork", + "ExternalNetworkBmpPatchProperties", + "ExternalNetworkBmpProperties", "ExternalNetworkPatch", "ExternalNetworkPatchProperties", "ExternalNetworkPatchPropertiesOptionAProperties", - "ExternalNetworkPatchableProperties", "ExternalNetworkProperties", "ExternalNetworkPropertiesOptionAProperties", - "ExternalNetworksList", + "ExternalNetworkStaticRouteConfiguration", + "ExternalNetworkStaticRoutePatchConfiguration", + "ExternalNetworkUpdateBfdAdministrativeStateRequest", + "ExternalNetworkUpdateBfdAdministrativeStateResponse", + "ExternalNetworkUpdateBfdAdministrativeStateResponseProperties", + "FabricLockProperties", + "FeatureFlagProperties", + "GetTopologyResponse", + "GetTopologyResponseProperties", + "GlobalAccessControlListActionPatchProperties", + "GlobalAccessControlListActionProperties", + "GlobalNetworkTapRuleActionPatchProperties", + "GlobalNetworkTapRuleActionProperties", + "HeaderAddressProperties", + "IcmpConfigurationPatchProperties", + "IcmpConfigurationProperties", + "IdentitySelector", + "IdentitySelectorPatch", "ImportRoutePolicy", "ImportRoutePolicyInformation", + "ImportRoutePolicyInformationPatch", + "ImportRoutePolicyPatch", "InternalNetwork", + "InternalNetworkBmpPatchProperties", + "InternalNetworkBmpProperties", "InternalNetworkPatch", "InternalNetworkPatchProperties", - "InternalNetworkPatchableProperties", "InternalNetworkProperties", - "InternalNetworkPropertiesBgpConfiguration", - "InternalNetworkPropertiesStaticRouteConfiguration", - "InternalNetworksList", + "InternalNetworkUpdateBfdAdministrativeStateRequest", + "InternalNetworkUpdateBfdAdministrativeStateResponse", + "InternalNetworkUpdateBfdAdministrativeStateResponseProperties", + "InternalNetworkUpdateBgpAdministrativeStateRequest", + "InternalNetworkUpdateBgpAdministrativeStateResponse", + "InternalNetworkUpdateBgpAdministrativeStateResponseProperties", "InternetGateway", "InternetGatewayPatch", - "InternetGatewayPatchableProperties", + "InternetGatewayPatchProperties", "InternetGatewayProperties", "InternetGatewayRule", "InternetGatewayRulePatch", "InternetGatewayRuleProperties", - "InternetGatewayRulesListResult", - "InternetGatewaysListResult", - "IpCommunitiesListResult", "IpCommunity", - "IpCommunityAddOperationProperties", - "IpCommunityDeleteOperationProperties", "IpCommunityIdList", "IpCommunityPatch", "IpCommunityPatchableProperties", "IpCommunityProperties", "IpCommunityRule", - "IpCommunitySetOperationProperties", "IpExtendedCommunity", - "IpExtendedCommunityAddOperationProperties", - "IpExtendedCommunityDeleteOperationProperties", "IpExtendedCommunityIdList", - "IpExtendedCommunityListResult", "IpExtendedCommunityPatch", "IpExtendedCommunityPatchProperties", - "IpExtendedCommunityPatchableProperties", "IpExtendedCommunityProperties", "IpExtendedCommunityRule", - "IpExtendedCommunitySetOperationProperties", + "IpGroupPatchProperties", "IpGroupProperties", "IpMatchCondition", + "IpMatchConditionPatch", "IpPrefix", "IpPrefixPatch", "IpPrefixPatchProperties", - "IpPrefixPatchableProperties", "IpPrefixProperties", "IpPrefixRule", - "IpPrefixesListResult", + "IsolationDomainPatchProperties", "IsolationDomainProperties", "L2IsolationDomain", "L2IsolationDomainPatch", "L2IsolationDomainPatchProperties", "L2IsolationDomainProperties", - "L2IsolationDomainsListResult", "L3ExportRoutePolicy", + "L3ExportRoutePolicyPatch", "L3IsolationDomain", "L3IsolationDomainPatch", "L3IsolationDomainPatchProperties", - "L3IsolationDomainPatchableProperties", "L3IsolationDomainProperties", - "L3IsolationDomainsListResult", - "L3OptionAProperties", + "L3OptionBPatchProperties", "L3OptionBProperties", + "L3UniqueRouteDistinguisherProperties", + "LastOperationProperties", "Layer2Configuration", + "Layer2ConfigurationPatch", + "Layer3IpPrefixPatchProperties", "Layer3IpPrefixProperties", "ManagedResourceGroupConfiguration", - "ManagementNetworkConfigurationPatchableProperties", + "ManagedServiceIdentity", + "ManagedServiceIdentityPatch", "ManagementNetworkConfigurationProperties", + "ManagementNetworkPatchConfiguration", + "NativeIpv4PrefixLimitPatchProperties", + "NativeIpv4PrefixLimitProperties", + "NativeIpv6PrefixLimitPatchProperties", + "NativeIpv6PrefixLimitProperties", "NeighborAddress", + "NeighborAddressBfdAdministrativeStatus", + "NeighborAddressBgpAdministrativeStatus", + "NeighborAddressPatch", "NeighborGroup", "NeighborGroupDestination", + "NeighborGroupDestinationPatch", "NeighborGroupPatch", "NeighborGroupPatchProperties", - "NeighborGroupPatchableProperties", "NeighborGroupProperties", - "NeighborGroupsListResult", + "NeighborGroupResyncResponse", + "NetworkBootstrapDevice", + "NetworkBootstrapDevicePatch", + "NetworkBootstrapDevicePatchProperties", + "NetworkBootstrapDeviceProperties", + "NetworkBootstrapDeviceRebootResponse", + "NetworkBootstrapDeviceRefreshConfigurationResponse", + "NetworkBootstrapDeviceResyncPasswordsResponse", + "NetworkBootstrapDeviceUpdateAdministrativeStateResponse", + "NetworkBootstrapDeviceUpgradeResponse", + "NetworkBootstrapInterface", + "NetworkBootstrapInterfacePatch", + "NetworkBootstrapInterfacePatchProperties", + "NetworkBootstrapInterfaceProperties", "NetworkDevice", "NetworkDevicePatchParameters", "NetworkDevicePatchParametersProperties", - "NetworkDevicePatchableProperties", "NetworkDeviceProperties", + "NetworkDeviceRefreshConfigurationResponse", + "NetworkDeviceResyncPasswordsResponse", + "NetworkDeviceRunRwCommandResponse", + "NetworkDeviceRwCommandResponseProperties", "NetworkDeviceSku", - "NetworkDeviceSkusListResult", - "NetworkDevicesListResult", + "NetworkDeviceSkuProperties", + "NetworkDeviceUpdateAdministrativeStateResponse", + "NetworkDeviceUpgradeRequest", + "NetworkDeviceUpgradeResponse", "NetworkFabric", "NetworkFabricController", "NetworkFabricControllerPatch", - "NetworkFabricControllerPatchableProperties", + "NetworkFabricControllerPatchProperties", "NetworkFabricControllerProperties", - "NetworkFabricControllersListResult", + "NetworkFabricLockRequest", "NetworkFabricPatch", "NetworkFabricPatchProperties", - "NetworkFabricPatchableProperties", - "NetworkFabricPatchablePropertiesTerminalServerConfiguration", "NetworkFabricProperties", + "NetworkFabricResyncCertificatesResponse", + "NetworkFabricResyncPasswordsResponse", + "NetworkFabricRotateCertificatesResponse", + "NetworkFabricRotatePasswordsResponse", "NetworkFabricSku", - "NetworkFabricSkusListResult", - "NetworkFabricsListResult", + "NetworkFabricSkuProperties", "NetworkInterface", "NetworkInterfacePatch", "NetworkInterfacePatchProperties", "NetworkInterfaceProperties", - "NetworkInterfacesList", + "NetworkMonitor", + "NetworkMonitorPatch", + "NetworkMonitorPatchProperties", + "NetworkMonitorProperties", "NetworkPacketBroker", "NetworkPacketBrokerPatch", - "NetworkPacketBrokersListResult", + "NetworkPacketBrokerProperties", "NetworkRack", + "NetworkRackPatch", "NetworkRackProperties", - "NetworkRacksListResult", "NetworkTap", "NetworkTapPatch", - "NetworkTapPatchableParameters", - "NetworkTapPatchableParametersDestinationsItem", + "NetworkTapPatchProperties", "NetworkTapProperties", - "NetworkTapPropertiesDestinationsItem", + "NetworkTapResyncResponse", "NetworkTapRule", "NetworkTapRuleAction", + "NetworkTapRuleActionPatch", "NetworkTapRuleMatchCondition", + "NetworkTapRuleMatchConditionPatch", "NetworkTapRuleMatchConfiguration", + "NetworkTapRuleMatchConfigurationPatch", "NetworkTapRulePatch", "NetworkTapRulePatchProperties", - "NetworkTapRulePatchableProperties", "NetworkTapRuleProperties", - "NetworkTapRulesListResult", - "NetworkTapsListResult", + "NetworkTapRuleResyncResponse", "NetworkToNetworkInterconnect", "NetworkToNetworkInterconnectPatch", - "NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration", - "NetworkToNetworkInterconnectsList", + "NetworkToNetworkInterconnectPatchProperties", + "NetworkToNetworkInterconnectProperties", + "NniBmpPatchProperties", + "NniBmpProperties", + "NniStaticRouteConfiguration", + "NniStaticRoutePatchConfiguration", + "NniUpdateBfdAdministrativeStateRequest", + "NniUpdateBfdAdministrativeStateResponse", + "NniUpdateBfdAdministrativeStateResponseProperties", "NpbStaticRouteConfiguration", + "NpbStaticRouteConfigurationPatch", "Operation", "OperationDisplay", - "OperationListResult", - "OptionAProperties", + "OperationStatusResult", "OptionBLayer3Configuration", - "OptionBProperties", + "OptionBLayer3ConfigurationPatchProperties", + "OptionBLayer3PrefixLimitPatchProperties", + "OptionBLayer3PrefixLimitProperties", + "PoliceRateConfigurationProperties", "PortCondition", + "PortConditionPatch", + "PortGroupPatchProperties", "PortGroupProperties", + "PrefixLimitPatchProperties", + "PrefixLimitProperties", "ProxyResource", + "ProxyResourceBase", + "QosPatchProperties", + "QosProperties", "RebootProperties", "Resource", - "RoutePoliciesListResult", "RoutePolicy", "RoutePolicyPatch", "RoutePolicyPatchableProperties", "RoutePolicyProperties", + "RoutePolicyStatementPatchProperties", "RoutePolicyStatementProperties", + "RoutePrefixLimitPatchProperties", + "RoutePrefixLimitProperties", "RouteTargetInformation", + "RouteTargetPatchInformation", "RuleProperties", + "SecretArchiveReference", + "SecretRotationStatus", + "SecretRotationSummary", + "StatementActionPatchProperties", "StatementActionProperties", + "StatementConditionPatchProperties", "StatementConditionProperties", "StaticRouteConfiguration", + "StaticRoutePatchConfiguration", + "StaticRoutePatchProperties", "StaticRouteProperties", + "StaticRouteRoutePolicy", + "StaticRouteRoutePolicyPatch", + "StationConnectionPatchProperties", + "StationConnectionProperties", + "StorageAccountConfiguration", + "StorageAccountPatchConfiguration", "SupportedConnectorProperties", "SupportedVersionProperties", "SystemData", "TagsUpdate", "TerminalServerConfiguration", - "TerminalServerPatchableProperties", + "TerminalServerPatchConfiguration", "TrackedResource", + "UniqueRouteDistinguisherPatchProperties", + "UniqueRouteDistinguisherProperties", "UpdateAdministrativeState", + "UpdateAdministrativeStateResponse", + "UpdateAdministrativeStateResponseProperties", "UpdateDeviceAdministrativeState", "UpdateVersion", + "UpgradeNetworkFabricProperties", + "UserAssignedIdentity", "ValidateConfigurationProperties", "ValidateConfigurationResponse", + "ViewDeviceConfigurationOperationResponse", + "ViewDeviceConfigurationResponseProperties", + "VlanGroupPatchProperties", "VlanGroupProperties", "VlanMatchCondition", + "VlanMatchConditionPatch", "VpnConfigurationPatchableProperties", - "VpnConfigurationPatchablePropertiesOptionAProperties", "VpnConfigurationProperties", - "VpnConfigurationPropertiesOptionAProperties", + "VpnOptionAPatchProperties", + "VpnOptionAProperties", + "VpnOptionBPatchProperties", + "VpnOptionBProperties", "AclActionType", + "AclType", "Action", "ActionType", "AddressFamilyType", "AdministrativeState", "AllowASOverride", "BfdAdministrativeState", + "BgpAdministrativeState", + "BitRateUnit", + "BmpConfigurationState", + "BmpExportPolicy", + "BmpMonitoredAddressFamily", "BooleanEnumProperty", + "BurstSizeUnit", + "CommitBatchState", + "CommitConfigurationPolicy", + "CommitStage", "CommunityActionTypes", "Condition", "ConfigurationState", "ConfigurationType", + "ControlPlaneAclActionType", + "ControlPlaneAclPortMatchType", + "ControlPlaneAclTtlMatchType", "CreatedByType", "DestinationType", "DeviceAdministrativeState", + "DeviceRole", "EnableDisableState", "Encapsulation", "EncapsulationType", + "ExtendedVlan", "Extension", + "ExternalNetworkRouteType", "FabricSkuType", "GatewayType", "IPAddressType", "InterfaceType", + "InternalNetworkRouteType", "IsManagementType", "IsMonitoringEnabled", "IsWorkloadManagementNetworkEnabled", "Layer4Protocol", + "LockConfigurationState", + "ManagedServiceIdentitySelectorType", + "ManagedServiceIdentityType", + "MicroBfdState", + "NNIDerivedUniqueRouteDistinguisherConfigurationState", "NetworkDeviceRole", "NetworkDeviceRoleName", + "NetworkFabricLockAction", + "NetworkFabricLockType", + "NetworkFabricUpgradeAction", "NetworkRackType", "NfcSku", "NniType", "Origin", "PeeringOption", - "PollingIntervalInSeconds", "PollingType", "PortType", "PrefixType", "ProvisioningState", + "QosConfigurationState", "RebootType", "RedistributeConnectedSubnets", "RedistributeStaticRoutes", "RoutePolicyActionType", "RoutePolicyConditionType", + "RouteType", + "RuleCondition", "SourceDestinationType", + "StationConfigurationState", + "StationConnectionMode", + "SynchronizationStatus", "TapRuleActionType", + "UniqueRouteDistinguisherConfigurationState", + "V4OverV6BgpSessionState", + "V6OverV4BgpSessionState", "ValidateAction", "WellKnownCommunities", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/models/_enums.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/models/_enums.py new file mode 100644 index 000000000000..1502784700d1 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/models/_enums.py @@ -0,0 +1,935 @@ +# 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) Python 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 AclActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of actions that can be performed.""" + + DROP = "Drop" + """AclActionType Drop.""" + COUNT = "Count" + """AclActionType Count.""" + LOG = "Log" + """AclActionType Log.""" + REMARK = "Remark" + """AclActionType Remark.""" + POLICE_RATE = "PoliceRate" + """AclActionType PoliceRate.""" + + +class AclType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Access Control List (ACL) Type.""" + + CP = "ControlPlaneTrafficPolicy" + """AclType Control Plane Traffic Policy.""" + TENANT = "Tenant" + """AclType Tenant.""" + MANAGEMENT = "Management" + """AclType Management.""" + CONTROL_PLANE_ACL = "ControlPlaneAcl" + """Control Plane Access Control List (ACL).""" + + +class Action(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specify action.""" + + ALLOW = "Allow" + """Action Allow.""" + DENY = "Deny" + """Action Deny.""" + + +class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal + only APIs. + """ + + INTERNAL = "Internal" + """Actions are for internal-only APIs.""" + + +class AddressFamilyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """AddressFamilyType. This parameter decides whether the given ipv4 or ipv6 route policy.""" + + I_PV4 = "IPv4" + """AddressType-IPv4.""" + I_PV6 = "IPv6" + """AddressType-IPv6.""" + + +class AdministrativeState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """State defined to represent administrative actions or post actions on a particular resource.""" + + ENABLED = "Enabled" + """Enabled Administrative State.""" + DISABLED = "Disabled" + """Disabled Administrative State.""" + MAT = "MAT" + """MAT(Manual Action Taken) Administrative State.""" + RMA = "RMA" + """RMA(Return Material Authorization) Administrative State.""" + UNDER_MAINTENANCE = "UnderMaintenance" + """UnderMaintenance Administrative State.""" + ENABLED_DEGRADED = "EnabledDegraded" + """EnabledDegraded Administrative State.""" + + +class AllowASOverride(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Enable Or Disable state.""" + + ENABLE = "Enable" + """AllowASOverride-Enable.""" + DISABLE = "Disable" + """AllowASOverride-Disable.""" + + +class BfdAdministrativeState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Administrative state of the BfdConfiguration. Example: Enabled | Disabled.""" + + ENABLED = "Enabled" + """Represents the enabled state of BFD administrative state.""" + DISABLED = "Disabled" + """Represents the disabled state of BFD administrative state.""" + MAT = "MAT" + """Represents the MAT(Manual Action Taken) state of BFD administrative state.""" + RMA = "RMA" + """Represents the RMA(Return Material Authorization) state of BFD administrative state.""" + + +class BgpAdministrativeState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Border Gateway Protocol (BGP) Administrative State values.""" + + ENABLED = "Enabled" + """BgpAdministrativeState-Enabled.""" + DISABLED = "Disabled" + """BgpAdministrativeState-Disabled.""" + + +class BitRateUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Bit rate unit.""" + + BPS = "bps" + """Bit rate unit in bits per second.""" + KBPS = "Kbps" + """Bit rate unit in kilobits per second.""" + MBPS = "Mbps" + """Bit rate unit in megabits per second.""" + GBPS = "Gbps" + """Bit rate unit in gigabits per second.""" + PPS = "Pps" + """Bit rate unit in packets per second.""" + + +class BmpConfigurationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """BGP Monitoring Protocol (BMP) configuration state.""" + + ENABLED = "Enabled" + """BGP Monitoring Protocol (BMP) ConfigurationState - Enabled.""" + DISABLED = "Disabled" + """BGP Monitoring Protocol (BMP) ConfigurationState - Disabled.""" + + +class BmpExportPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Export Policy for the BGP Monitoring Protocol (BMP) Configuration.""" + + PRE_POLICY = "Pre-Policy" + """BMP ExportPolicy Pre-Policy.""" + POST_POLICY = "Post-Policy" + """BMP ExportPolicy Post-Policy.""" + ALL = "All" + """BMP ExportPolicy All.""" + LOCAL_RIB = "LocalRib" + """BMP ExportPolicy LocalRib.""" + + +class BmpMonitoredAddressFamily(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Monitored Address Family.""" + + IPV4_UNICAST = "ipv4Unicast" + """IPv4 Unicast.""" + IPV6_UNICAST = "ipv6Unicast" + """IPv6 Unicast.""" + VPN_IPV4 = "vpnIpv4" + """VPN IPv4.""" + VPN_IPV6 = "vpnIpv6" + """VPN IPv6.""" + ALL = "All" + """All Address Families.""" + + +class BooleanEnumProperty(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Boolean union. Example- True/False.""" + + TRUE = "True" + """EnumProperty-True.""" + FALSE = "False" + """EnumProperty-False.""" + + +class BurstSizeUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Burst size unit in packets.""" + + BYTES = "Bytes" + """Burst size unit in bytes.""" + K_BYTES = "KBytes" + """Burst size unit in kilobytes.""" + M_BYTES = "MBytes" + """Burst size unit in megabytes.""" + G_BYTES = "GBytes" + """Burst size unit in gigabytes.""" + PACKETS = "Packets" + """Burst size unit in packets.""" + + +class CommitBatchState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Commit Batch State.""" + + PROCESSING = "Processing" + """CommitBatchState-PartialSuccess.""" + SUCCEEDED = "Succeeded" + """CommitBatchState-Succeeded.""" + FAILED = "Failed" + """CommitBatchState-Failed.""" + + +class CommitConfigurationPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates Commit configuration staging policy. Supported policy is StageCEConfiguration, which + indicates to prepare the configuration for the CE device type. + """ + + STAGE_CE_CONFIGURATION = "StageCEConfiguration" + """CommitConfigurationPolicy-StageCEConfiguration.""" + + +class CommitStage(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Commit stage Action to be performed.""" + + START = "Start" + """CommitStage-Start indicates to prepare the device configuration for the devices which is + decided by policy type.""" + CONTINUE = "Continue" + """CommitStage-Continue indicates to push the configuration to the devices provided. Either CE1 or + CE2 is allowed.""" + ROLLBACK = "Rollback" + """CommitStage-Rollback indicates to revert to the previous configuration for the devices to which + configuration is pushed as part of staging.""" + + +class CommunityActionTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Community action types. Example: Permit | Deny.""" + + PERMIT = "Permit" + """Permit Community Action Types.""" + DENY = "Deny" + """Deny Community Action Types.""" + + +class Condition(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specify prefix-list bounds.""" + + EQUAL_TO = "EqualTo" + """Condition-EqualTo.""" + GREATER_THAN_OR_EQUAL_TO = "GreaterThanOrEqualTo" + """Condition-GreaterThanOrEqualTo.""" + LESSER_THAN_OR_EQUAL_TO = "LesserThanOrEqualTo" + """Condition-LesserThanOrEqualTo.""" + RANGE = "Range" + """Condition-Range.""" + + +class ConfigurationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Configuration state for the resource.""" + + SUCCEEDED = "Succeeded" + """Success Configuration State.""" + FAILED = "Failed" + """Failed Configuration State.""" + REJECTED = "Rejected" + """Rejected Configuration State.""" + ACCEPTED = "Accepted" + """Accepted Configuration State.""" + PROVISIONED = "Provisioned" + """Provisioned Configuration State.""" + ERROR_PROVISIONING = "ErrorProvisioning" + """ErrorProvisioning Configuration State.""" + DEPROVISIONING = "Deprovisioning" + """Deprovisioning Configuration State.""" + DEPROVISIONED = "Deprovisioned" + """Deprovisioned Configuration State.""" + ERROR_DEPROVISIONING = "ErrorDeprovisioning" + """ErrorDeprovisioning Configuration State.""" + DEFERRED_CONTROL = "DeferredControl" + """DeferredControl Configuration State.""" + PROVISIONING = "Provisioning" + """Provisioning Configuration State.""" + PENDING_COMMIT = "PendingCommit" + """PendingCommit Configuration State.""" + PENDING_ADMINISTRATIVE_UPDATE = "PendingAdministrativeUpdate" + """PendingAdministrativeUpdate State.""" + + +class ConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Input method to configure Access Control List.""" + + FILE = "File" + """File Configuration Type.""" + INLINE = "Inline" + """Inline Configuration Type.""" + + +class ControlPlaneAclActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Control Plane Access Control List (ACL) Action Types.""" + + PERMIT = "Permit" + """AclActionType Permit.""" + DENY = "Deny" + """AclActionType Deny.""" + REMARK = "Remark" + """AclActionType Remark.""" + + +class ControlPlaneAclPortMatchType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Control Plane Access Control List (ACL) port match types.""" + + EQUALS = "eq" + """Port-eq.""" + NOT_EQUALS = "neq" + """Port-neq.""" + GREATER_THAN = "gt" + """Port-gt.""" + LESSER_THAN = "lt" + """Port-lt.""" + RANGE = "range" + """Port-gt-eq.""" + + +class ControlPlaneAclTtlMatchType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Control Plane Access Control List (ACL) Time To Live (TTL) match conditions properties.""" + + EQUALS = "eq" + """TTL-eq.""" + NOT_EQUALS = "neq" + """TTL-neq.""" + GREATER_THAN = "gt" + """TTL-gt.""" + LESSER_THAN = "lt" + """TTL-lt.""" + + +class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The kind of entity that created the resource.""" + + USER = "User" + """The entity was created by a user.""" + APPLICATION = "Application" + """The entity was created by an application.""" + MANAGED_IDENTITY = "ManagedIdentity" + """The entity was created by a managed identity.""" + KEY = "Key" + """The entity was created by a key.""" + + +class DestinationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of destination. Input can be IsolationDomain or Direct.""" + + ISOLATION_DOMAIN = "IsolationDomain" + """DestinationType-IsolationDomain.""" + DIRECT = "Direct" + """DestinationType-Direct.""" + + +class DeviceAdministrativeState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Administrative state.""" + + RMA = "RMA" + """Device AdministrativeState-RMA.""" + UNGRACEFUL_RMA = "UngracefulRMA" + """Device AdministrativeState-RMA(Return Material Authorization) Ungraceful.""" + RESYNC = "Resync" + """Device AdministrativeState-Resync.""" + GRACEFUL_QUARANTINE = "GracefulQuarantine" + """Device AdministrativeState-GracefulQuarantine.""" + UNGRACEFUL_QUARANTINE = "UngracefulQuarantine" + """Device AdministrativeState-UngracefulQuarantine.""" + QUARANTINE = "Quarantine" + """Device AdministrativeState-Quarantine.""" + UNDER_MAINTENANCE = "UnderMaintenance" + """Device AdministrativeState-UnderMaintenance.""" + ENABLE = "Enable" + """Device AdministrativeState-Enable.""" + DISABLE = "Disable" + """Device AdministrativeState-Disable.""" + + +class DeviceRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Device Role.""" + + CE = "CE" + """DeviceRole - Customer Edge (CE).""" + TO_R = "ToR" + """DeviceRole - Top of Rack (ToR).""" + NPB = "NPB" + """DeviceRole - Network Packet Broker (NPB).""" + MANAGEMENT_SWITCH = "ManagementSwitch" + """Device Role Management Switch.""" + + +class EnableDisableState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Administrative state.""" + + ENABLE = "Enable" + """AdministrativeState Enable.""" + DISABLE = "Disable" + """AdministrativeState Disable.""" + UNDER_MAINTENANCE = "UnderMaintenance" + """AdministrativeState UnderMaintenance.""" + + +class Encapsulation(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of encapsulation.""" + + NONE = "None" + """Encapsulation-None.""" + GRE = "GRE" + """Encapsulation-GRE.""" + + +class EncapsulationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Encapsulation Type that needs to be matched.""" + + NONE = "None" + """None EncapsulationType.""" + GT_PV1 = "GTPv1" + """GTPv1 EncapsulationType.""" + + +class ExtendedVlan(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Extended VLAN status.""" + + ENABLED = "Enabled" + """Extended VLAN is enabled.""" + DISABLED = "Disabled" + """Extended VLAN is disabled.""" + + +class Extension(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Extension. Example: NoExtension | NPB.""" + + NO_EXTENSION = "NoExtension" + """Extension-NoExtension.""" + NPB = "NPB" + """Extension-NPB.""" + + +class ExternalNetworkRouteType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """External Network RouteType.""" + + STATIC = "Static" + """ExternalNetwork Static.""" + OPTION_A = "OptionA" + """ExternalNetwork OptionA.""" + + +class FabricSkuType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of Network Fabric SKU.""" + + SINGLE_RACK = "SingleRack" + """FabricSkuType-SingleRack.""" + MULTI_RACK = "MultiRack" + """FabricSkuType-MultiRack.""" + + +class GatewayType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Gateway Type of the resource.""" + + INFRASTRUCTURE = "Infrastructure" + """GatewayType Infrastructure.""" + WORKLOAD = "Workload" + """GatewayType Workload.""" + + +class InterfaceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Interface Type. Example: Management/Data.""" + + MANAGEMENT = "Management" + """InterfaceType-Management.""" + DATA = "Data" + """InterfaceType-Data.""" + + +class InternalNetworkRouteType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Internal Network RouteType.""" + + STATIC = "Static" + """InternalNetwork Static.""" + BGP = "Bgp" + """InternalNetwork Bgp.""" + + +class IPAddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """IP Address type.""" + + I_PV4 = "IPv4" + """IPv4 IP address.""" + I_PV6 = "IPv6" + """IPv6 IP address.""" + + +class IsManagementType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Configuration to use NNI for Infrastructure Management. Example: True/False.""" + + TRUE = "True" + """IsManagementType-True.""" + FALSE = "False" + """IsManagementType-False.""" + + +class IsMonitoringEnabled(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """To check whether monitoring of internal network is enabled or not.""" + + TRUE = "True" + """IsMonitoringEnabled-True.""" + FALSE = "False" + """IsMonitoringEnabled-False.""" + + +class IsWorkloadManagementNetworkEnabled(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """A workload management network is required for all the tenant (workload) traffic. This traffic + is only dedicated for Tenant workloads which are required to access internet or any other + MSFT/Public endpoints. + """ + + TRUE = "True" + """IsWorkloadManagementNetworkEnabled-True.""" + FALSE = "False" + """IsWorkloadManagementNetworkEnabled-False.""" + + +class Layer4Protocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Layer4 protocol type that needs to be matched.""" + + TCP = "TCP" + """TCP(Transmission Control Protocol) Protocol.""" + UDP = "UDP" + """UDP(User Datagram Protocol) Protocol.""" + SCTP = "SCTP" + """SCTP(Streaming Control Transmission Protocol) Protocol.""" + + +class LockConfigurationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Lock Configuration State.""" + + ENABLED = "Enabled" + """LockConfigurationState Enabled.""" + DISABLED = "Disabled" + """LockConfigurationState Disabled.""" + + +class ManagedServiceIdentitySelectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of managed identity.""" + + SYSTEM_ASSIGNED_IDENTITY = "SystemAssignedIdentity" + """System Assigned Identity.""" + USER_ASSIGNED_IDENTITY = "UserAssignedIdentity" + """User Assigned Identity.""" + + +class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of managed service identity (where both SystemAssigned and UserAssigned types are + allowed). + """ + + NONE = "None" + """No managed identity.""" + SYSTEM_ASSIGNED = "SystemAssigned" + """System assigned managed identity.""" + USER_ASSIGNED = "UserAssigned" + """User assigned managed identity.""" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + """System and user assigned managed identity.""" + + +class MicroBfdState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Micro Bidirectional Forwarding Detection (BFD) enabled/disabled state.""" + + ENABLED = "Enabled" + """MicroBfdState-Enabled.""" + DISABLED = "Disabled" + """MicroBfdState-Disabled.""" + + +class NetworkDeviceRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """NetworkDeviceRole is the device role: Example: CE | ToR.""" + + CE = "CE" + """NetworkDeviceRole-CE(Customer Edge).""" + TO_R = "ToR" + """NetworkDeviceRole-ToR(top of rack).""" + NPB = "NPB" + """NetworkDeviceRole-NPB(Network Packet Broker).""" + TS = "TS" + """NetworkDeviceRole-TS(Terminal Server).""" + MANAGEMENT = "Management" + """NetworkDeviceRole-Management.""" + + +class NetworkDeviceRoleName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Available roles for the network device.""" + + CE = "CE" + """NetworkDeviceRoleName-CE(Customer Edge).""" + TO_R = "ToR" + """NetworkDeviceRoleName-ToR(top of rack).""" + NPB = "NPB" + """NetworkDeviceRoleName-NPB(Network Packet Broker).""" + TS = "TS" + """NetworkDeviceRoleName-TS(Terminal Server).""" + MANAGEMENT = "Management" + """NetworkDeviceRoleName-Management.""" + + +class NetworkFabricLockAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Network fabric lock action.""" + + LOCK = "Lock" + """Perform lock operation.""" + UNLOCK = "Unlock" + """Perform unlock operation.""" + + +class NetworkFabricLockType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Network fabric lock type.""" + + ADMINISTRATIVE = "Administrative" + """A administrative lock/unlock operation will be performed.""" + CONFIGURATION = "Configuration" + """A lock/unlock operation will be performed on the configuration.""" + + +class NetworkFabricUpgradeAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Action to be performed while upgrading the fabric.""" + + START = "Start" + """UpgradeAction-Start.""" + COMPLETE = "Complete" + """UpgradeAction -Complete.""" + + +class NetworkRackType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Network Rack SKU name.""" + + AGGREGATE = "Aggregate" + """NetworkRackType-Aggregate.""" + COMPUTE = "Compute" + """NetworkRackType-Compute.""" + COMBINED = "Combined" + """NetworkRackType-Combined.""" + + +class NfcSku(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Network Fabric Controller SKU.""" + + BASIC = "Basic" + """NfcSku-Basic.""" + STANDARD = "Standard" + """NfcSku-Standard.""" + HIGH_PERFORMANCE = "HighPerformance" + """NfcSku-HighPerformance.""" + + +class NNIDerivedUniqueRouteDistinguisherConfigurationState( # pylint: disable=name-too-long + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """NNI Derived Unique Route Distinguisher Configuration State.""" + + ENABLED = "Enabled" + """NNI derived unique route distinguisher configuration state Enabled.""" + DISABLED = "Disabled" + """NNI derived unique route distinguisher configuration state Disabled.""" + + +class NniType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of NNI used. Example: CE | NPB.""" + + CE = "CE" + """NniType-CE(Customer Edge).""" + NPB = "NPB" + """NniType-NPB(Network Packet Broker).""" + + +class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit + logs UX. Default value is "user,system". + """ + + USER = "user" + """Indicates the operation is initiated by a user.""" + SYSTEM = "system" + """Indicates the operation is initiated by a system.""" + USER_SYSTEM = "user,system" + """Indicates the operation is initiated by a user or system.""" + + +class PeeringOption(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Peering option list.""" + + OPTION_A = "OptionA" + """PeeringOption-OptionA.""" + OPTION_B = "OptionB" + """PeeringOption-OptionB.""" + + +class PollingType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Polling type.""" + + PULL = "Pull" + """PollingType-Pull.""" + PUSH = "Push" + """PollingType-Push.""" + + +class PortType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Port type that needs to be matched.""" + + SOURCE_PORT = "SourcePort" + """PortType SourcePort.""" + DESTINATION_PORT = "DestinationPort" + """PortType DestinationPort.""" + BIDIRECTIONAL = "Bidirectional" + """PortType Bidirectional.""" + + +class PrefixType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """IP Prefix Type that needs to be matched.""" + + PREFIX = "Prefix" + """PrefixType Prefix.""" + LONGEST_PREFIX = "LongestPrefix" + """PrefixType LongestPrefix.""" + + +class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The current provisioning state.""" + + ACCEPTED = "Accepted" + """Accepted Provisioning State.""" + SUCCEEDED = "Succeeded" + """Succeeded Provisioning State.""" + UPDATING = "Updating" + """Updating Provisioning State.""" + DELETING = "Deleting" + """Deleting Provisioning State.""" + FAILED = "Failed" + """Failed Provisioning State.""" + CANCELED = "Canceled" + """Canceled Provisioning State.""" + + +class QosConfigurationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """NetworkFabric QoS ConfigurationState.""" + + DISABLED = "Disabled" + """QosConfigurationState-Disabled.""" + ENABLED = "Enabled" + """QosConfigurationState-Enabled.""" + + +class RebootType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of reboot to be performed. Example: GracefulRebootWithZTP.""" + + GRACEFUL_REBOOT_WITH_ZTP = "GracefulRebootWithZTP" + """RebootType GracefulRebootWithZTP.""" + GRACEFUL_REBOOT_WITHOUT_ZTP = "GracefulRebootWithoutZTP" + """RebootType GracefulRebootWithoutZTP.""" + UNGRACEFUL_REBOOT_WITH_ZTP = "UngracefulRebootWithZTP" + """RebootType UngracefulRebootWithZTP.""" + UNGRACEFUL_REBOOT_WITHOUT_ZTP = "UngracefulRebootWithoutZTP" + """RebootType UngracefulRebootWithoutZTP.""" + + +class RedistributeConnectedSubnets(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Advertise Connected Subnets. Ex: "True" | "False".""" + + TRUE = "True" + """RedistributeConnectedSubnets-True.""" + FALSE = "False" + """RedistributeConnectedSubnets-False.""" + + +class RedistributeStaticRoutes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Advertise Static Routes. Ex: "True" | "False".""" + + TRUE = "True" + """RedistributeStaticRoutes-True.""" + FALSE = "False" + """RedistributeStaticRoutes-False.""" + + +class RoutePolicyActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Action type. Example: Permit | Deny | Continue.""" + + PERMIT = "Permit" + """RoutePolicyActionType-Permit.""" + DENY = "Deny" + """RoutePolicyActionType-Deny.""" + CONTINUE = "Continue" + """RoutePolicyActionType-Continue.""" + + +class RoutePolicyConditionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the condition used.""" + + OR = "Or" + """RoutePolicyConditionType-Or.""" + AND = "And" + """RoutePolicyConditionType-And.""" + + +class RouteType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Route type to be used.""" + + STATIC = "Static" + """RouteType-Static.""" + OPTION_A = "OptionA" + """RouteType-OptionA.""" + + +class RuleCondition(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specify Rule condition.""" + + AND = "And" + """And Rule-Condition.""" + OR = "Or" + """Or Rule-Condition.""" + + +class SourceDestinationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """IP Address type that needs to be matched.""" + + SOURCE_IP = "SourceIP" + """SourceDestinationType SourceIP.""" + DESTINATION_IP = "DestinationIP" + """SourceDestinationType DestinationIP.""" + BIDIRECTIONAL = "Bidirectional" + """SourceDestinationType Bidirectional.""" + + +class StationConfigurationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Station Configuration State.""" + + ENABLED = "Enabled" + """StationConfigurationState Enabled.""" + DISABLED = "Disabled" + """StationConfigurationState Disabled.""" + + +class StationConnectionMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Station Connection Mode.""" + + ACTIVE = "Active" + """StationConnectionMode Active.""" + PASSIVE = "Passive" + """StationConnectionMode Passive.""" + + +class SynchronizationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Synchronization status of a secret or certificate for a device (Network Device or Terminal + Server). Whether the device has been configured with the latest version of the secret or + certificate. + """ + + IN_SYNC = "InSync" + """The device has been configured with the latest version of the secret.""" + SYNCHRONIZING = "Synchronizing" + """The device is being reconfigured with the latest version of the secret. + + While in this state, the secret archive reference may not match the secret configured on the + device.""" + OUT_OF_SYNC = "OutOfSync" + """The device has not been configured with the latest version of the secret.""" + + +class TapRuleActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of actions that can be performed.""" + + DROP = "Drop" + """TapRuleActionType-Drop.""" + COUNT = "Count" + """TapRuleActionType-Count.""" + LOG = "Log" + """TapRuleActionType-Log.""" + REPLICATE = "Replicate" + """TapRuleActionType-Replicate.""" + GOTO = "Goto" + """TapRuleActionType-Goto.""" + REDIRECT = "Redirect" + """TapRuleActionType-Redirect.""" + MIRROR = "Mirror" + """TapRuleActionType-Mirror.""" + + +class UniqueRouteDistinguisherConfigurationState( # pylint: disable=name-too-long + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Unique Route Distinguisher Configuration State.""" + + ENABLED = "Enabled" + """UniqueRouteDistinguisherConfigurationState Enabled.""" + DISABLED = "Disabled" + """UniqueRouteDistinguisherConfigurationState Disabled.""" + + +class V4OverV6BgpSessionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """V4 over V6 BGP session state.""" + + ENABLED = "Enabled" + """V4OverV6BgpSessionState-Enabled.""" + DISABLED = "Disabled" + """V4OverV6BgpSessionState-Disabled.""" + + +class V6OverV4BgpSessionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """V6 over V4 BGP session state.""" + + ENABLED = "Enabled" + """V6OverV4BgpSessionState-Enabled.""" + DISABLED = "Disabled" + """V6OverV4BgpSessionState-Disabled.""" + + +class ValidateAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Validate action that to be performed.""" + + CABLING = "Cabling" + """ValidateAction-Cabling.""" + CONFIGURATION = "Configuration" + """ValidateAction-Configuration.""" + CONNECTIVITY = "Connectivity" + """ValidateAction-Connectivity.""" + + +class WellKnownCommunities(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """``Internet`` - Advertise routes to internet community. ``LocalAS`` - Advertise routes to only + localAS peers. ``NoAdvertise`` - Don't advertise routes to any peer. ``NoExport`` - Don't + export to next AS. ``GShut`` - Graceful Shutdown (GSHUT) withdraw routes before terminating BGP + connection. + """ + + INTERNET = "Internet" + """WellKnownCommunities-Internet.""" + LOCAL_AS = "LocalAS" + """WellKnownCommunities-LocalAS.""" + NO_ADVERTISE = "NoAdvertise" + """WellKnownCommunities-NoAdvertise.""" + NO_EXPORT = "NoExport" + """WellKnownCommunities-NoExport.""" + G_SHUT = "GShut" + """WellKnownCommunities-GShut.""" diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/models/_managed_network_fabric_mgmt_client_enums.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/models/_managed_network_fabric_mgmt_client_enums.py deleted file mode 100644 index 4be5782fc50a..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/models/_managed_network_fabric_mgmt_client_enums.py +++ /dev/null @@ -1,404 +0,0 @@ -# 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 AclActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of actions that can be performed.""" - - DROP = "Drop" - COUNT = "Count" - LOG = "Log" - - -class Action(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Specify action.""" - - ALLOW = "Allow" - DENY = "Deny" - - -class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.""" - - INTERNAL = "Internal" - - -class AddressFamilyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AddressFamilyType. This parameter decides whether the given ipv4 or ipv6 route policy.""" - - I_PV4 = "IPv4" - I_PV6 = "IPv6" - - -class AdministrativeState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """State defined to represent administrative actions or post actions on a particular resource.""" - - ENABLED = "Enabled" - DISABLED = "Disabled" - MAT = "MAT" - RMA = "RMA" - - -class AllowASOverride(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enable Or Disable state.""" - - ENABLE = "Enable" - DISABLE = "Disable" - - -class BfdAdministrativeState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Administrative state of the BfdConfiguration. Example: Enabled | Disabled.""" - - ENABLED = "Enabled" - DISABLED = "Disabled" - MAT = "MAT" - RMA = "RMA" - - -class BooleanEnumProperty(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Boolean Enum. Example- True/False.""" - - TRUE = "True" - FALSE = "False" - - -class CommunityActionTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """community action types. Example: Permit | Deny.""" - - PERMIT = "Permit" - DENY = "Deny" - - -class Condition(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Specify prefix-list bounds.""" - - EQUAL_TO = "EqualTo" - GREATER_THAN_OR_EQUAL_TO = "GreaterThanOrEqualTo" - LESSER_THAN_OR_EQUAL_TO = "LesserThanOrEqualTo" - RANGE = "Range" - - -class ConfigurationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Configuration state for the resource.""" - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - REJECTED = "Rejected" - ACCEPTED = "Accepted" - PROVISIONED = "Provisioned" - ERROR_PROVISIONING = "ErrorProvisioning" - DEPROVISIONING = "Deprovisioning" - DEPROVISIONED = "Deprovisioned" - ERROR_DEPROVISIONING = "ErrorDeprovisioning" - DEFERRED_CONTROL = "DeferredControl" - - -class ConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Input method to configure Access Control List.""" - - FILE = "File" - INLINE = "Inline" - - -class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of identity that created the resource.""" - - USER = "User" - APPLICATION = "Application" - MANAGED_IDENTITY = "ManagedIdentity" - KEY = "Key" - - -class DestinationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of destination. Input can be IsolationDomain or Direct.""" - - ISOLATION_DOMAIN = "IsolationDomain" - DIRECT = "Direct" - - -class DeviceAdministrativeState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Administrative state.""" - - RMA = "RMA" - RESYNC = "Resync" - GRACEFUL_QUARANTINE = "GracefulQuarantine" - QUARANTINE = "Quarantine" - - -class EnableDisableState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Administrative state.""" - - ENABLE = "Enable" - DISABLE = "Disable" - - -class Encapsulation(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of encapsulation.""" - - NONE = "None" - GRE = "GRE" - - -class EncapsulationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Encapsulation Type.""" - - NONE = "None" - GT_PV1 = "GTPv1" - - -class Extension(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Extension. Example: NoExtension | NPB.""" - - NO_EXTENSION = "NoExtension" - NPB = "NPB" - - -class FabricSkuType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of Network Fabric SKU.""" - - SINGLE_RACK = "SingleRack" - MULTI_RACK = "MultiRack" - - -class GatewayType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Gateway Type of the resource.""" - - INFRASTRUCTURE = "Infrastructure" - WORKLOAD = "Workload" - - -class InterfaceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Interface Type. Example: Management/Data.""" - - MANAGEMENT = "Management" - DATA = "Data" - - -class IPAddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """IP Address type.""" - - I_PV4 = "IPv4" - I_PV6 = "IPv6" - - -class IsManagementType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Configuration to use NNI for Infrastructure Management. Example: True/False.""" - - TRUE = "True" - FALSE = "False" - - -class IsMonitoringEnabled(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """To check whether monitoring of internal network is enabled or not.""" - - TRUE = "True" - FALSE = "False" - - -class IsWorkloadManagementNetworkEnabled(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """A workload management network is required for all the tenant (workload) traffic. This traffic - is only dedicated for Tenant workloads which are required to access internet or any other - MSFT/Public endpoints. - """ - - TRUE = "True" - FALSE = "False" - - -class Layer4Protocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Layer4 protocol type that needs to be matched.""" - - TCP = "TCP" - UDP = "UDP" - - -class NetworkDeviceRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """NetworkDeviceRole is the device role: Example: CE | ToR.""" - - CE = "CE" - TO_R = "ToR" - NPB = "NPB" - TS = "TS" - MANAGEMENT = "Management" - - -class NetworkDeviceRoleName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Available roles for the network device.""" - - CE = "CE" - TO_R = "ToR" - NPB = "NPB" - TS = "TS" - MANAGEMENT = "Management" - - -class NetworkRackType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Network Rack SKU name.""" - - AGGREGATE = "Aggregate" - COMPUTE = "Compute" - COMBINED = "Combined" - - -class NfcSku(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Network Fabric Controller SKU.""" - - BASIC = "Basic" - STANDARD = "Standard" - HIGH_PERFORMANCE = "HighPerformance" - - -class NniType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of NNI used. Example: CE | NPB.""" - - CE = "CE" - NPB = "NPB" - - -class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit - logs UX. Default value is "user,system". - """ - - USER = "user" - SYSTEM = "system" - USER_SYSTEM = "user,system" - - -class PeeringOption(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Peering option list.""" - - OPTION_A = "OptionA" - OPTION_B = "OptionB" - - -class PollingIntervalInSeconds(int, Enum, metaclass=CaseInsensitiveEnumMeta): - """Polling interval in seconds.""" - - THIRTY = 30 - SIXTY = 60 - NINETY = 90 - ONE_HUNDRED_TWENTY = 120 - - -class PollingType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Polling type.""" - - PULL = "Pull" - PUSH = "Push" - - -class PortType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Port type that needs to be matched.""" - - SOURCE_PORT = "SourcePort" - DESTINATION_PORT = "DestinationPort" - - -class PrefixType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """IP Prefix Type.""" - - PREFIX = "Prefix" - LONGEST_PREFIX = "LongestPrefix" - - -class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current provisioning state.""" - - ACCEPTED = "Accepted" - SUCCEEDED = "Succeeded" - UPDATING = "Updating" - DELETING = "Deleting" - FAILED = "Failed" - CANCELED = "Canceled" - - -class RebootType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of reboot to be performed. Example: GracefulRebootWithZTP.""" - - GRACEFUL_REBOOT_WITH_ZTP = "GracefulRebootWithZTP" - GRACEFUL_REBOOT_WITHOUT_ZTP = "GracefulRebootWithoutZTP" - UNGRACEFUL_REBOOT_WITH_ZTP = "UngracefulRebootWithZTP" - UNGRACEFUL_REBOOT_WITHOUT_ZTP = "UngracefulRebootWithoutZTP" - - -class RedistributeConnectedSubnets(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Advertise Connected Subnets. Ex: "True" | "False".""" - - TRUE = "True" - FALSE = "False" - - -class RedistributeStaticRoutes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Advertise Static Routes. Ex: "True" | "False".""" - - TRUE = "True" - FALSE = "False" - - -class RoutePolicyActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Action type. Example: Permit | Deny | Continue.""" - - PERMIT = "Permit" - DENY = "Deny" - CONTINUE = "Continue" - CONTINUE_ENUM = "Continue" - - -class RoutePolicyConditionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the condition used.""" - - OR = "Or" - AND = "And" - OR_ENUM = "Or" - AND_ENUM = "And" - - -class SourceDestinationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """IP Address type.""" - - SOURCE_IP = "SourceIP" - DESTINATION_IP = "DestinationIP" - - -class TapRuleActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of actions that can be performed.""" - - DROP = "Drop" - COUNT = "Count" - LOG = "Log" - REPLICATE = "Replicate" - GOTO = "Goto" - REDIRECT = "Redirect" - MIRROR = "Mirror" - - -class ValidateAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Validate action that to be performed.""" - - CABLING = "Cabling" - CONFIGURATION = "Configuration" - CONNECTIVITY = "Connectivity" - - -class WellKnownCommunities(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """``Internet`` - Advertise routes to internet community. - ``LocalAS`` - Advertise routes to only localAS peers. - ``NoAdvertise`` - Don't advertise routes to any peer. - ``NoExport`` - Don't export to next AS. - ``GShut`` - Graceful Shutdown (GSHUT) withdraw routes before terminating BGP connection. - """ - - INTERNET = "Internet" - LOCAL_AS = "LocalAS" - NO_ADVERTISE = "NoAdvertise" - NO_EXPORT = "NoExport" - G_SHUT = "GShut" diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/models/_models.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/models/_models.py new file mode 100644 index 000000000000..2ca0603f5cdd --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/models/_models.py @@ -0,0 +1,19846 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=useless-super-delegation + +import datetime +from typing import Any, Mapping, Optional, TYPE_CHECKING, Union, overload + +from .._utils.model_base import Model as _Model, rest_field + +if TYPE_CHECKING: + from .. import models as _models + + +class Resource(_Model): + """Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the resource.""" + type: Optional[str] = rest_field(visibility=["read"]) + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"]) + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class TrackedResource(Resource): + """Tracked Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + location: str = rest_field(visibility=["read", "create"]) + """The geo-location where the resource lives. Required.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AccessControlList(TrackedResource): + """The Access Control List resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The Access ControlList properties. Required. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.AccessControlListProperties + """ + + properties: "_models.AccessControlListProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The Access ControlList properties. Required.""" + + __flattened_items = [ + "annotation", + "configuration_type", + "acls_url", + "default_action", + "match_configurations", + "dynamic_match_configurations", + "last_synced_time", + "acl_type", + "device_role", + "global_access_control_list_actions", + "last_operation", + "network_fabric_ids", + "control_plane_acl_configuration", + "configuration_state", + "provisioning_state", + "administrative_state", + ] + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.AccessControlListProperties", + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class AccessControlListAction(_Model): + """Action that need to performed. + + :ivar type: Type of actions that can be performed. Known values are: "Drop", "Count", "Log", + "Remark", and "PoliceRate". + :vartype type: str or ~azure.mgmt.managednetworkfabric.models.AclActionType + :ivar counter_name: Name of the counter block to get match count information. + :vartype counter_name: str + :ivar remark_comment: Remark comment. + :vartype remark_comment: str + :ivar police_rate_configuration: Police rate configuration. + :vartype police_rate_configuration: + ~azure.mgmt.managednetworkfabric.models.PoliceRateConfigurationProperties + """ + + type: Optional[Union[str, "_models.AclActionType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Type of actions that can be performed. Known values are: \"Drop\", \"Count\", \"Log\", + \"Remark\", and \"PoliceRate\".""" + counter_name: Optional[str] = rest_field( + name="counterName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the counter block to get match count information.""" + remark_comment: Optional[str] = rest_field( + name="remarkComment", visibility=["read", "create", "update", "delete", "query"] + ) + """Remark comment.""" + police_rate_configuration: Optional["_models.PoliceRateConfigurationProperties"] = rest_field( + name="policeRateConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Police rate configuration.""" + + @overload + def __init__( + self, + *, + type: Optional[Union[str, "_models.AclActionType"]] = None, + counter_name: Optional[str] = None, + remark_comment: Optional[str] = None, + police_rate_configuration: Optional["_models.PoliceRateConfigurationProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AccessControlListActionPatch(_Model): + """Action that need to be performed. + + :ivar type: Type of actions that can be performed. Known values are: "Drop", "Count", "Log", + "Remark", and "PoliceRate". + :vartype type: str or ~azure.mgmt.managednetworkfabric.models.AclActionType + :ivar counter_name: Name of the counter block to get match count information. + :vartype counter_name: str + :ivar remark_comment: Remark comment. + :vartype remark_comment: str + :ivar police_rate_configuration: Police rate configuration. + :vartype police_rate_configuration: + ~azure.mgmt.managednetworkfabric.models.PoliceRateConfigurationProperties + """ + + type: Optional[Union[str, "_models.AclActionType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Type of actions that can be performed. Known values are: \"Drop\", \"Count\", \"Log\", + \"Remark\", and \"PoliceRate\".""" + counter_name: Optional[str] = rest_field( + name="counterName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the counter block to get match count information.""" + remark_comment: Optional[str] = rest_field( + name="remarkComment", visibility=["read", "create", "update", "delete", "query"] + ) + """Remark comment.""" + police_rate_configuration: Optional["_models.PoliceRateConfigurationProperties"] = rest_field( + name="policeRateConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Police rate configuration.""" + + @overload + def __init__( + self, + *, + type: Optional[Union[str, "_models.AclActionType"]] = None, + counter_name: Optional[str] = None, + remark_comment: Optional[str] = None, + police_rate_configuration: Optional["_models.PoliceRateConfigurationProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CommonMatchConditions(_Model): + """Defines the common match conditions of the ACL and Network Tap Rule. + + :ivar protocol_types: List of the protocols that need to be matched. + :vartype protocol_types: list[str] + :ivar vlan_match_condition: Vlan match condition that needs to be matched. + :vartype vlan_match_condition: ~azure.mgmt.managednetworkfabric.models.VlanMatchCondition + :ivar ip_condition: IP condition that needs to be matched. + :vartype ip_condition: ~azure.mgmt.managednetworkfabric.models.IpMatchCondition + """ + + protocol_types: Optional[list[str]] = rest_field( + name="protocolTypes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of the protocols that need to be matched.""" + vlan_match_condition: Optional["_models.VlanMatchCondition"] = rest_field( + name="vlanMatchCondition", visibility=["read", "create", "update", "delete", "query"] + ) + """Vlan match condition that needs to be matched.""" + ip_condition: Optional["_models.IpMatchCondition"] = rest_field( + name="ipCondition", visibility=["read", "create", "update", "delete", "query"] + ) + """IP condition that needs to be matched.""" + + @overload + def __init__( + self, + *, + protocol_types: Optional[list[str]] = None, + vlan_match_condition: Optional["_models.VlanMatchCondition"] = None, + ip_condition: Optional["_models.IpMatchCondition"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AccessControlListMatchCondition(CommonMatchConditions): + """Defines the match condition that is supported to filter the traffic. + + :ivar protocol_types: List of the protocols that need to be matched. + :vartype protocol_types: list[str] + :ivar vlan_match_condition: Vlan match condition that needs to be matched. + :vartype vlan_match_condition: ~azure.mgmt.managednetworkfabric.models.VlanMatchCondition + :ivar ip_condition: IP condition that needs to be matched. + :vartype ip_condition: ~azure.mgmt.managednetworkfabric.models.IpMatchCondition + :ivar ether_types: List of ether type values that need to be matched. + :vartype ether_types: list[str] + :ivar fragments: List of IP fragment packets that need to be matched. + :vartype fragments: list[str] + :ivar ip_lengths: List of IP Lengths that need to be matched. + :vartype ip_lengths: list[str] + :ivar ttl_values: List of TTL [Time To Live] values that need to be matched. + :vartype ttl_values: list[str] + :ivar dscp_markings: List of DSCP Markings that need to be matched. + :vartype dscp_markings: list[str] + :ivar protocol_neighbors: Protocol neighbors that need to be matched. + :vartype protocol_neighbors: list[str] + :ivar port_condition: Defines the port condition that needs to be matched. + :vartype port_condition: ~azure.mgmt.managednetworkfabric.models.AccessControlListPortCondition + :ivar icmp_configuration: Internet Control Message Protocol (ICMP) configuration. + :vartype icmp_configuration: + ~azure.mgmt.managednetworkfabric.models.IcmpConfigurationProperties + """ + + ether_types: Optional[list[str]] = rest_field( + name="etherTypes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of ether type values that need to be matched.""" + fragments: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of IP fragment packets that need to be matched.""" + ip_lengths: Optional[list[str]] = rest_field( + name="ipLengths", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IP Lengths that need to be matched.""" + ttl_values: Optional[list[str]] = rest_field( + name="ttlValues", visibility=["read", "create", "update", "delete", "query"] + ) + """List of TTL [Time To Live] values that need to be matched.""" + dscp_markings: Optional[list[str]] = rest_field( + name="dscpMarkings", visibility=["read", "create", "update", "delete", "query"] + ) + """List of DSCP Markings that need to be matched.""" + protocol_neighbors: Optional[list[str]] = rest_field( + name="protocolNeighbors", visibility=["read", "create", "update", "delete", "query"] + ) + """Protocol neighbors that need to be matched.""" + port_condition: Optional["_models.AccessControlListPortCondition"] = rest_field( + name="portCondition", visibility=["read", "create", "update", "delete", "query"] + ) + """Defines the port condition that needs to be matched.""" + icmp_configuration: Optional["_models.IcmpConfigurationProperties"] = rest_field( + name="icmpConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Internet Control Message Protocol (ICMP) configuration.""" + + @overload + def __init__( + self, + *, + protocol_types: Optional[list[str]] = None, + vlan_match_condition: Optional["_models.VlanMatchCondition"] = None, + ip_condition: Optional["_models.IpMatchCondition"] = None, + ether_types: Optional[list[str]] = None, + fragments: Optional[list[str]] = None, + ip_lengths: Optional[list[str]] = None, + ttl_values: Optional[list[str]] = None, + dscp_markings: Optional[list[str]] = None, + protocol_neighbors: Optional[list[str]] = None, + port_condition: Optional["_models.AccessControlListPortCondition"] = None, + icmp_configuration: Optional["_models.IcmpConfigurationProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CommonMatchConditionsPatch(_Model): + """Defines the common match conditions of the ACL and Network Tap Rule. + + :ivar protocol_types: List of the protocols that need to be matched. + :vartype protocol_types: list[str] + :ivar vlan_match_condition: Vlan match condition that needs to be matched. + :vartype vlan_match_condition: ~azure.mgmt.managednetworkfabric.models.VlanMatchConditionPatch + :ivar ip_condition: IP condition that needs to be matched. + :vartype ip_condition: ~azure.mgmt.managednetworkfabric.models.IpMatchConditionPatch + """ + + protocol_types: Optional[list[str]] = rest_field( + name="protocolTypes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of the protocols that need to be matched.""" + vlan_match_condition: Optional["_models.VlanMatchConditionPatch"] = rest_field( + name="vlanMatchCondition", visibility=["read", "create", "update", "delete", "query"] + ) + """Vlan match condition that needs to be matched.""" + ip_condition: Optional["_models.IpMatchConditionPatch"] = rest_field( + name="ipCondition", visibility=["read", "create", "update", "delete", "query"] + ) + """IP condition that needs to be matched.""" + + @overload + def __init__( + self, + *, + protocol_types: Optional[list[str]] = None, + vlan_match_condition: Optional["_models.VlanMatchConditionPatch"] = None, + ip_condition: Optional["_models.IpMatchConditionPatch"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AccessControlListMatchConditionPatch(CommonMatchConditionsPatch): + """Defines the match condition that is supported to filter the traffic. + + :ivar protocol_types: List of the protocols that need to be matched. + :vartype protocol_types: list[str] + :ivar vlan_match_condition: Vlan match condition that needs to be matched. + :vartype vlan_match_condition: ~azure.mgmt.managednetworkfabric.models.VlanMatchConditionPatch + :ivar ip_condition: IP condition that needs to be matched. + :vartype ip_condition: ~azure.mgmt.managednetworkfabric.models.IpMatchConditionPatch + :ivar ether_types: List of ether type values that need to be matched. + :vartype ether_types: list[str] + :ivar fragments: List of IP fragment packets that need to be matched. + :vartype fragments: list[str] + :ivar ip_lengths: List of IP Lengths that need to be matched. + :vartype ip_lengths: list[str] + :ivar ttl_values: List of TTL [Time To Live] values that need to be matched. + :vartype ttl_values: list[str] + :ivar dscp_markings: List of DSCP Markings that need to be matched. + :vartype dscp_markings: list[str] + :ivar port_condition: Defines the port condition that needs to be matched. + :vartype port_condition: + ~azure.mgmt.managednetworkfabric.models.AccessControlListPortConditionPatch + :ivar protocol_neighbors: Protocol neighbors that need to be matched. + :vartype protocol_neighbors: list[str] + :ivar icmp_configuration: Internet Control Message Protocol (ICMP) configuration. + :vartype icmp_configuration: + ~azure.mgmt.managednetworkfabric.models.IcmpConfigurationPatchProperties + """ + + ether_types: Optional[list[str]] = rest_field( + name="etherTypes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of ether type values that need to be matched.""" + fragments: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of IP fragment packets that need to be matched.""" + ip_lengths: Optional[list[str]] = rest_field( + name="ipLengths", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IP Lengths that need to be matched.""" + ttl_values: Optional[list[str]] = rest_field( + name="ttlValues", visibility=["read", "create", "update", "delete", "query"] + ) + """List of TTL [Time To Live] values that need to be matched.""" + dscp_markings: Optional[list[str]] = rest_field( + name="dscpMarkings", visibility=["read", "create", "update", "delete", "query"] + ) + """List of DSCP Markings that need to be matched.""" + port_condition: Optional["_models.AccessControlListPortConditionPatch"] = rest_field( + name="portCondition", visibility=["read", "create", "update", "delete", "query"] + ) + """Defines the port condition that needs to be matched.""" + protocol_neighbors: Optional[list[str]] = rest_field( + name="protocolNeighbors", visibility=["read", "create", "update", "delete", "query"] + ) + """Protocol neighbors that need to be matched.""" + icmp_configuration: Optional["_models.IcmpConfigurationPatchProperties"] = rest_field( + name="icmpConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Internet Control Message Protocol (ICMP) configuration.""" + + @overload + def __init__( + self, + *, + protocol_types: Optional[list[str]] = None, + vlan_match_condition: Optional["_models.VlanMatchConditionPatch"] = None, + ip_condition: Optional["_models.IpMatchConditionPatch"] = None, + ether_types: Optional[list[str]] = None, + fragments: Optional[list[str]] = None, + ip_lengths: Optional[list[str]] = None, + ttl_values: Optional[list[str]] = None, + dscp_markings: Optional[list[str]] = None, + port_condition: Optional["_models.AccessControlListPortConditionPatch"] = None, + protocol_neighbors: Optional[list[str]] = None, + icmp_configuration: Optional["_models.IcmpConfigurationPatchProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AccessControlListMatchConfiguration(_Model): + """Defines the match configuration that are supported to filter the traffic. + + :ivar match_configuration_name: The name of the match configuration. + :vartype match_configuration_name: str + :ivar sequence_number: Sequence Number of the match configuration. + :vartype sequence_number: int + :ivar ip_address_type: Type of IP Address. IPv4 or IPv6. Known values are: "IPv4" and "IPv6". + :vartype ip_address_type: str or ~azure.mgmt.managednetworkfabric.models.IPAddressType + :ivar match_conditions: List of the match conditions. + :vartype match_conditions: + list[~azure.mgmt.managednetworkfabric.models.AccessControlListMatchCondition] + :ivar actions: List of actions that need to be performed for the matched conditions. + :vartype actions: list[~azure.mgmt.managednetworkfabric.models.AccessControlListAction] + """ + + match_configuration_name: Optional[str] = rest_field( + name="matchConfigurationName", visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the match configuration.""" + sequence_number: Optional[int] = rest_field( + name="sequenceNumber", visibility=["read", "create", "update", "delete", "query"] + ) + """Sequence Number of the match configuration.""" + ip_address_type: Optional[Union[str, "_models.IPAddressType"]] = rest_field( + name="ipAddressType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of IP Address. IPv4 or IPv6. Known values are: \"IPv4\" and \"IPv6\".""" + match_conditions: Optional[list["_models.AccessControlListMatchCondition"]] = rest_field( + name="matchConditions", visibility=["read", "create", "update", "delete", "query"] + ) + """List of the match conditions.""" + actions: Optional[list["_models.AccessControlListAction"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of actions that need to be performed for the matched conditions.""" + + @overload + def __init__( + self, + *, + match_configuration_name: Optional[str] = None, + sequence_number: Optional[int] = None, + ip_address_type: Optional[Union[str, "_models.IPAddressType"]] = None, + match_conditions: Optional[list["_models.AccessControlListMatchCondition"]] = None, + actions: Optional[list["_models.AccessControlListAction"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AccessControlListMatchConfigurationPatch(_Model): + """Defines the match configuration that are supported to filter the traffic. + + :ivar match_configuration_name: The name of the match configuration. + :vartype match_configuration_name: str + :ivar sequence_number: Sequence Number of the match configuration. + :vartype sequence_number: int + :ivar ip_address_type: Type of IP Address. IPv4 or IPv6. Known values are: "IPv4" and "IPv6". + :vartype ip_address_type: str or ~azure.mgmt.managednetworkfabric.models.IPAddressType + :ivar match_conditions: List of the match conditions. + :vartype match_conditions: + list[~azure.mgmt.managednetworkfabric.models.AccessControlListMatchConditionPatch] + :ivar actions: List of actions that need to be performed for the matched conditions. + :vartype actions: list[~azure.mgmt.managednetworkfabric.models.AccessControlListActionPatch] + """ + + match_configuration_name: Optional[str] = rest_field( + name="matchConfigurationName", visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the match configuration.""" + sequence_number: Optional[int] = rest_field( + name="sequenceNumber", visibility=["read", "create", "update", "delete", "query"] + ) + """Sequence Number of the match configuration.""" + ip_address_type: Optional[Union[str, "_models.IPAddressType"]] = rest_field( + name="ipAddressType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of IP Address. IPv4 or IPv6. Known values are: \"IPv4\" and \"IPv6\".""" + match_conditions: Optional[list["_models.AccessControlListMatchConditionPatch"]] = rest_field( + name="matchConditions", visibility=["read", "create", "update", "delete", "query"] + ) + """List of the match conditions.""" + actions: Optional[list["_models.AccessControlListActionPatch"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of actions that need to be performed for the matched conditions.""" + + @overload + def __init__( + self, + *, + match_configuration_name: Optional[str] = None, + sequence_number: Optional[int] = None, + ip_address_type: Optional[Union[str, "_models.IPAddressType"]] = None, + match_conditions: Optional[list["_models.AccessControlListMatchConditionPatch"]] = None, + actions: Optional[list["_models.AccessControlListActionPatch"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TagsUpdate(_Model): + """Base tracked resource type for PATCH updates. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AccessControlListPatch(TagsUpdate): + """The Access Control Lists patch resource definition. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: Access Control Lists patch properties. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.AccessControlListPatchProperties + """ + + properties: Optional["_models.AccessControlListPatchProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Access Control Lists patch properties.""" + + __flattened_items = [ + "configuration_type", + "acls_url", + "default_action", + "match_configurations", + "dynamic_match_configurations", + "control_plane_acl_configuration", + "acl_type", + "device_role", + "global_access_control_list_actions", + "annotation", + ] + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.AccessControlListPatchProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class AccessControlListPatchProperties(_Model): + """Access Control Lists patch properties. + + :ivar configuration_type: Input method to configure Access Control List. Known values are: + "File" and "Inline". + :vartype configuration_type: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationType + :ivar acls_url: Access Control List file URL. + :vartype acls_url: str + :ivar default_action: Default action that needs to be applied when no condition is matched. + Example: Permit | Deny. Known values are: "Permit" and "Deny". + :vartype default_action: str or ~azure.mgmt.managednetworkfabric.models.CommunityActionTypes + :ivar match_configurations: List of match configurations. + :vartype match_configurations: + list[~azure.mgmt.managednetworkfabric.models.AccessControlListMatchConfigurationPatch] + :ivar dynamic_match_configurations: List of dynamic match configurations. + :vartype dynamic_match_configurations: + list[~azure.mgmt.managednetworkfabric.models.CommonDynamicMatchConfigurationPatch] + :ivar control_plane_acl_configuration: Access Control List (ACL) configurations. + :vartype control_plane_acl_configuration: + list[~azure.mgmt.managednetworkfabric.models.ControlPlaneAclPatchProperties] + :ivar acl_type: Access Control List (ACL) Type. Known values are: "ControlPlaneTrafficPolicy", + "Tenant", "Management", and "ControlPlaneAcl". + :vartype acl_type: str or ~azure.mgmt.managednetworkfabric.models.AclType + :ivar device_role: Device Role. Known values are: "CE", "ToR", "NPB", and "ManagementSwitch". + :vartype device_role: str or ~azure.mgmt.managednetworkfabric.models.DeviceRole + :ivar global_access_control_list_actions: Global Access Control List (ACL) actions. + :vartype global_access_control_list_actions: + ~azure.mgmt.managednetworkfabric.models.GlobalAccessControlListActionPatchProperties + :ivar annotation: Switch configuration description. + :vartype annotation: str + """ + + configuration_type: Optional[Union[str, "_models.ConfigurationType"]] = rest_field( + name="configurationType", visibility=["read", "create", "update", "delete", "query"] + ) + """Input method to configure Access Control List. Known values are: \"File\" and \"Inline\".""" + acls_url: Optional[str] = rest_field(name="aclsUrl", visibility=["read", "create", "update", "delete", "query"]) + """Access Control List file URL.""" + default_action: Optional[Union[str, "_models.CommunityActionTypes"]] = rest_field( + name="defaultAction", visibility=["read", "create", "update", "delete", "query"] + ) + """Default action that needs to be applied when no condition is matched. Example: Permit | Deny. + Known values are: \"Permit\" and \"Deny\".""" + match_configurations: Optional[list["_models.AccessControlListMatchConfigurationPatch"]] = rest_field( + name="matchConfigurations", visibility=["read", "create", "update", "delete", "query"] + ) + """List of match configurations.""" + dynamic_match_configurations: Optional[list["_models.CommonDynamicMatchConfigurationPatch"]] = rest_field( + name="dynamicMatchConfigurations", visibility=["read", "create", "update", "delete", "query"] + ) + """List of dynamic match configurations.""" + control_plane_acl_configuration: Optional[list["_models.ControlPlaneAclPatchProperties"]] = rest_field( + name="controlPlaneAclConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Access Control List (ACL) configurations.""" + acl_type: Optional[Union[str, "_models.AclType"]] = rest_field( + name="aclType", visibility=["read", "create", "update", "delete", "query"] + ) + """Access Control List (ACL) Type. Known values are: \"ControlPlaneTrafficPolicy\", \"Tenant\", + \"Management\", and \"ControlPlaneAcl\".""" + device_role: Optional[Union[str, "_models.DeviceRole"]] = rest_field( + name="deviceRole", visibility=["read", "create", "update", "delete", "query"] + ) + """Device Role. Known values are: \"CE\", \"ToR\", \"NPB\", and \"ManagementSwitch\".""" + global_access_control_list_actions: Optional["_models.GlobalAccessControlListActionPatchProperties"] = rest_field( + name="globalAccessControlListActions", visibility=["read", "create", "update", "delete", "query"] + ) + """Global Access Control List (ACL) actions.""" + annotation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Switch configuration description.""" + + @overload + def __init__( + self, + *, + configuration_type: Optional[Union[str, "_models.ConfigurationType"]] = None, + acls_url: Optional[str] = None, + default_action: Optional[Union[str, "_models.CommunityActionTypes"]] = None, + match_configurations: Optional[list["_models.AccessControlListMatchConfigurationPatch"]] = None, + dynamic_match_configurations: Optional[list["_models.CommonDynamicMatchConfigurationPatch"]] = None, + control_plane_acl_configuration: Optional[list["_models.ControlPlaneAclPatchProperties"]] = None, + acl_type: Optional[Union[str, "_models.AclType"]] = None, + device_role: Optional[Union[str, "_models.DeviceRole"]] = None, + global_access_control_list_actions: Optional["_models.GlobalAccessControlListActionPatchProperties"] = None, + annotation: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PortCondition(_Model): + """Port condition that needs to be matched. + + :ivar port_type: Port type that needs to be matched. Known values are: "SourcePort", + "DestinationPort", and "Bidirectional". + :vartype port_type: str or ~azure.mgmt.managednetworkfabric.models.PortType + :ivar layer4_protocol: Layer4 protocol type that needs to be matched. Required. Known values + are: "TCP", "UDP", and "SCTP". + :vartype layer4_protocol: str or ~azure.mgmt.managednetworkfabric.models.Layer4Protocol + :ivar ports: List of the Ports that need to be matched. + :vartype ports: list[str] + :ivar port_group_names: List of the port Group Names that need to be matched. + :vartype port_group_names: list[str] + """ + + port_type: Optional[Union[str, "_models.PortType"]] = rest_field( + name="portType", visibility=["read", "create", "update", "delete", "query"] + ) + """Port type that needs to be matched. Known values are: \"SourcePort\", \"DestinationPort\", and + \"Bidirectional\".""" + layer4_protocol: Union[str, "_models.Layer4Protocol"] = rest_field( + name="layer4Protocol", visibility=["read", "create", "update", "delete", "query"] + ) + """Layer4 protocol type that needs to be matched. Required. Known values are: \"TCP\", \"UDP\", + and \"SCTP\".""" + ports: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of the Ports that need to be matched.""" + port_group_names: Optional[list[str]] = rest_field( + name="portGroupNames", visibility=["read", "create", "update", "delete", "query"] + ) + """List of the port Group Names that need to be matched.""" + + @overload + def __init__( + self, + *, + layer4_protocol: Union[str, "_models.Layer4Protocol"], + port_type: Optional[Union[str, "_models.PortType"]] = None, + ports: Optional[list[str]] = None, + port_group_names: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AccessControlListPortCondition(PortCondition): + """Defines the port condition that needs to be matched. + + :ivar port_type: Port type that needs to be matched. Known values are: "SourcePort", + "DestinationPort", and "Bidirectional". + :vartype port_type: str or ~azure.mgmt.managednetworkfabric.models.PortType + :ivar layer4_protocol: Layer4 protocol type that needs to be matched. Required. Known values + are: "TCP", "UDP", and "SCTP". + :vartype layer4_protocol: str or ~azure.mgmt.managednetworkfabric.models.Layer4Protocol + :ivar ports: List of the Ports that need to be matched. + :vartype ports: list[str] + :ivar port_group_names: List of the port Group Names that need to be matched. + :vartype port_group_names: list[str] + :ivar flags: List of protocol flags that need to be matched. Example: established | initial | + . List of eligible TCP Flags are ack, fin, not-ack, not-fin, not-psh, + not-rst, not-syn, not-urg, psh, rst, syn, urg. + :vartype flags: list[str] + """ + + flags: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of protocol flags that need to be matched. Example: established | initial | + . List of eligible TCP Flags are ack, fin, not-ack, not-fin, not-psh, + not-rst, not-syn, not-urg, psh, rst, syn, urg.""" + + @overload + def __init__( + self, + *, + layer4_protocol: Union[str, "_models.Layer4Protocol"], + port_type: Optional[Union[str, "_models.PortType"]] = None, + ports: Optional[list[str]] = None, + port_group_names: Optional[list[str]] = None, + flags: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PortConditionPatch(_Model): + """Port condition that needs to be matched. + + :ivar port_type: Port type that needs to be matched. Known values are: "SourcePort", + "DestinationPort", and "Bidirectional". + :vartype port_type: str or ~azure.mgmt.managednetworkfabric.models.PortType + :ivar layer4_protocol: Layer4 protocol type that needs to be matched. Known values are: "TCP", + "UDP", and "SCTP". + :vartype layer4_protocol: str or ~azure.mgmt.managednetworkfabric.models.Layer4Protocol + :ivar ports: List of the Ports that need to be matched. + :vartype ports: list[str] + :ivar port_group_names: List of the port Group Names that need to be matched. + :vartype port_group_names: list[str] + """ + + port_type: Optional[Union[str, "_models.PortType"]] = rest_field( + name="portType", visibility=["read", "create", "update", "delete", "query"] + ) + """Port type that needs to be matched. Known values are: \"SourcePort\", \"DestinationPort\", and + \"Bidirectional\".""" + layer4_protocol: Optional[Union[str, "_models.Layer4Protocol"]] = rest_field( + name="layer4Protocol", visibility=["read", "create", "update", "delete", "query"] + ) + """Layer4 protocol type that needs to be matched. Known values are: \"TCP\", \"UDP\", and + \"SCTP\".""" + ports: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of the Ports that need to be matched.""" + port_group_names: Optional[list[str]] = rest_field( + name="portGroupNames", visibility=["read", "create", "update", "delete", "query"] + ) + """List of the port Group Names that need to be matched.""" + + @overload + def __init__( + self, + *, + port_type: Optional[Union[str, "_models.PortType"]] = None, + layer4_protocol: Optional[Union[str, "_models.Layer4Protocol"]] = None, + ports: Optional[list[str]] = None, + port_group_names: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AccessControlListPortConditionPatch(PortConditionPatch): + """Defines the port condition that needs to be matched. + + :ivar port_type: Port type that needs to be matched. Known values are: "SourcePort", + "DestinationPort", and "Bidirectional". + :vartype port_type: str or ~azure.mgmt.managednetworkfabric.models.PortType + :ivar layer4_protocol: Layer4 protocol type that needs to be matched. Known values are: "TCP", + "UDP", and "SCTP". + :vartype layer4_protocol: str or ~azure.mgmt.managednetworkfabric.models.Layer4Protocol + :ivar ports: List of the Ports that need to be matched. + :vartype ports: list[str] + :ivar port_group_names: List of the port Group Names that need to be matched. + :vartype port_group_names: list[str] + :ivar flags: List of protocol flags that need to be matched. Example: established | initial | + . List of eligible TCP Flags are ack, fin, not-ack, not-fin, not-psh, + not-rst, not-syn, not-urg, psh, rst, syn, urg. + :vartype flags: list[str] + """ + + flags: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of protocol flags that need to be matched. Example: established | initial | + . List of eligible TCP Flags are ack, fin, not-ack, not-fin, not-psh, + not-rst, not-syn, not-urg, psh, rst, syn, urg.""" + + @overload + def __init__( + self, + *, + port_type: Optional[Union[str, "_models.PortType"]] = None, + layer4_protocol: Optional[Union[str, "_models.Layer4Protocol"]] = None, + ports: Optional[list[str]] = None, + port_group_names: Optional[list[str]] = None, + flags: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AccessControlListProperties(_Model): + """Access Control List Properties defines the resource properties. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar configuration_type: Input method to configure Access Control List. Required. Known values + are: "File" and "Inline". + :vartype configuration_type: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationType + :ivar acls_url: Access Control List file URL. + :vartype acls_url: str + :ivar default_action: Default action that needs to be applied when no condition is matched. + Example: Permit | Deny. Known values are: "Permit" and "Deny". + :vartype default_action: str or ~azure.mgmt.managednetworkfabric.models.CommunityActionTypes + :ivar match_configurations: List of match configurations. + :vartype match_configurations: + list[~azure.mgmt.managednetworkfabric.models.AccessControlListMatchConfiguration] + :ivar dynamic_match_configurations: List of dynamic match configurations. + :vartype dynamic_match_configurations: + list[~azure.mgmt.managednetworkfabric.models.CommonDynamicMatchConfiguration] + :ivar last_synced_time: The last synced timestamp. + :vartype last_synced_time: ~datetime.datetime + :ivar acl_type: Access Control List (ACL) Type. Known values are: "ControlPlaneTrafficPolicy", + "Tenant", "Management", and "ControlPlaneAcl". + :vartype acl_type: str or ~azure.mgmt.managednetworkfabric.models.AclType + :ivar device_role: Device Role. Known values are: "CE", "ToR", "NPB", and "ManagementSwitch". + :vartype device_role: str or ~azure.mgmt.managednetworkfabric.models.DeviceRole + :ivar global_access_control_list_actions: Global Access Control List (ACL) actions. + :vartype global_access_control_list_actions: + ~azure.mgmt.managednetworkfabric.models.GlobalAccessControlListActionProperties + :ivar last_operation: Details of the last operation performed on the resource. + :vartype last_operation: ~azure.mgmt.managednetworkfabric.models.LastOperationProperties + :ivar network_fabric_ids: Associated Network Fabric Resource IDs. + :vartype network_fabric_ids: list[str] + :ivar control_plane_acl_configuration: Access Control List (ACL) configurations. + :vartype control_plane_acl_configuration: + list[~azure.mgmt.managednetworkfabric.models.ControlPlaneAclProperties] + :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", + "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", + "Deprovisioned", "ErrorDeprovisioning", "DeferredControl", "Provisioning", "PendingCommit", and + "PendingAdministrativeUpdate". + :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState + :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", + "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState + :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", + "Disabled", "MAT", "RMA", "UnderMaintenance", and "EnabledDegraded". + :vartype administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.AdministrativeState + """ + + annotation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Switch configuration description.""" + configuration_type: Union[str, "_models.ConfigurationType"] = rest_field( + name="configurationType", visibility=["read", "create", "update", "delete", "query"] + ) + """Input method to configure Access Control List. Required. Known values are: \"File\" and + \"Inline\".""" + acls_url: Optional[str] = rest_field(name="aclsUrl", visibility=["read", "create", "update", "delete", "query"]) + """Access Control List file URL.""" + default_action: Optional[Union[str, "_models.CommunityActionTypes"]] = rest_field( + name="defaultAction", visibility=["read", "create", "update", "delete", "query"] + ) + """Default action that needs to be applied when no condition is matched. Example: Permit | Deny. + Known values are: \"Permit\" and \"Deny\".""" + match_configurations: Optional[list["_models.AccessControlListMatchConfiguration"]] = rest_field( + name="matchConfigurations", visibility=["read", "create", "update", "delete", "query"] + ) + """List of match configurations.""" + dynamic_match_configurations: Optional[list["_models.CommonDynamicMatchConfiguration"]] = rest_field( + name="dynamicMatchConfigurations", visibility=["read", "create", "update", "delete", "query"] + ) + """List of dynamic match configurations.""" + last_synced_time: Optional[datetime.datetime] = rest_field( + name="lastSyncedTime", visibility=["read"], format="rfc3339" + ) + """The last synced timestamp.""" + acl_type: Optional[Union[str, "_models.AclType"]] = rest_field( + name="aclType", visibility=["read", "create", "update", "delete", "query"] + ) + """Access Control List (ACL) Type. Known values are: \"ControlPlaneTrafficPolicy\", \"Tenant\", + \"Management\", and \"ControlPlaneAcl\".""" + device_role: Optional[Union[str, "_models.DeviceRole"]] = rest_field( + name="deviceRole", visibility=["read", "create", "update", "delete", "query"] + ) + """Device Role. Known values are: \"CE\", \"ToR\", \"NPB\", and \"ManagementSwitch\".""" + global_access_control_list_actions: Optional["_models.GlobalAccessControlListActionProperties"] = rest_field( + name="globalAccessControlListActions", visibility=["read", "create", "update", "delete", "query"] + ) + """Global Access Control List (ACL) actions.""" + last_operation: Optional["_models.LastOperationProperties"] = rest_field(name="lastOperation", visibility=["read"]) + """Details of the last operation performed on the resource.""" + network_fabric_ids: Optional[list[str]] = rest_field(name="networkFabricIds", visibility=["read"]) + """Associated Network Fabric Resource IDs.""" + control_plane_acl_configuration: Optional[list["_models.ControlPlaneAclProperties"]] = rest_field( + name="controlPlaneAclConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Access Control List (ACL) configurations.""" + configuration_state: Optional[Union[str, "_models.ConfigurationState"]] = rest_field( + name="configurationState", visibility=["read"] + ) + """Configuration state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Rejected\", + \"Accepted\", \"Provisioned\", \"ErrorProvisioning\", \"Deprovisioning\", \"Deprovisioned\", + \"ErrorDeprovisioning\", \"DeferredControl\", \"Provisioning\", \"PendingCommit\", and + \"PendingAdministrativeUpdate\".""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the resource. Known values are: \"Accepted\", \"Succeeded\", + \"Updating\", \"Deleting\", \"Failed\", and \"Canceled\".""" + administrative_state: Optional[Union[str, "_models.AdministrativeState"]] = rest_field( + name="administrativeState", visibility=["read"] + ) + """Administrative state of the resource. Known values are: \"Enabled\", \"Disabled\", \"MAT\", + \"RMA\", \"UnderMaintenance\", and \"EnabledDegraded\".""" + + @overload + def __init__( + self, + *, + configuration_type: Union[str, "_models.ConfigurationType"], + annotation: Optional[str] = None, + acls_url: Optional[str] = None, + default_action: Optional[Union[str, "_models.CommunityActionTypes"]] = None, + match_configurations: Optional[list["_models.AccessControlListMatchConfiguration"]] = None, + dynamic_match_configurations: Optional[list["_models.CommonDynamicMatchConfiguration"]] = None, + acl_type: Optional[Union[str, "_models.AclType"]] = None, + device_role: Optional[Union[str, "_models.DeviceRole"]] = None, + global_access_control_list_actions: Optional["_models.GlobalAccessControlListActionProperties"] = None, + control_plane_acl_configuration: Optional[list["_models.ControlPlaneAclProperties"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ActionIpCommunityPatchProperties(_Model): + """IP Community Properties. + + :ivar add: List of IP Community IDs. + :vartype add: ~azure.mgmt.managednetworkfabric.models.IpCommunityIdList + :ivar delete: List of IP Community IDs. + :vartype delete: ~azure.mgmt.managednetworkfabric.models.IpCommunityIdList + :ivar set: List of IP Community IDs. + :vartype set: ~azure.mgmt.managednetworkfabric.models.IpCommunityIdList + """ + + add: Optional["_models.IpCommunityIdList"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of IP Community IDs.""" + delete: Optional["_models.IpCommunityIdList"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of IP Community IDs.""" + set: Optional["_models.IpCommunityIdList"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of IP Community IDs.""" + + @overload + def __init__( + self, + *, + add: Optional["_models.IpCommunityIdList"] = None, + delete: Optional["_models.IpCommunityIdList"] = None, + set: Optional["_models.IpCommunityIdList"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ActionIpCommunityProperties(_Model): + """IP Community Properties. + + :ivar add: List of IP Community IDs. + :vartype add: ~azure.mgmt.managednetworkfabric.models.IpCommunityIdList + :ivar delete: List of IP Community IDs. + :vartype delete: ~azure.mgmt.managednetworkfabric.models.IpCommunityIdList + :ivar set: List of IP Community IDs. + :vartype set: ~azure.mgmt.managednetworkfabric.models.IpCommunityIdList + """ + + add: Optional["_models.IpCommunityIdList"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of IP Community IDs.""" + delete: Optional["_models.IpCommunityIdList"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of IP Community IDs.""" + set: Optional["_models.IpCommunityIdList"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of IP Community IDs.""" + + @overload + def __init__( + self, + *, + add: Optional["_models.IpCommunityIdList"] = None, + delete: Optional["_models.IpCommunityIdList"] = None, + set: Optional["_models.IpCommunityIdList"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ActionIpExtendedCommunityPatchProperties(_Model): + """IP Extended Community Properties. + + :ivar add: List of IP Extended Community IDs. + :vartype add: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityIdList + :ivar delete: List of IP Extended Community IDs. + :vartype delete: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityIdList + :ivar set: List of IP Extended Community IDs. + :vartype set: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityIdList + """ + + add: Optional["_models.IpExtendedCommunityIdList"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of IP Extended Community IDs.""" + delete: Optional["_models.IpExtendedCommunityIdList"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of IP Extended Community IDs.""" + set: Optional["_models.IpExtendedCommunityIdList"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of IP Extended Community IDs.""" + + @overload + def __init__( + self, + *, + add: Optional["_models.IpExtendedCommunityIdList"] = None, + delete: Optional["_models.IpExtendedCommunityIdList"] = None, + set: Optional["_models.IpExtendedCommunityIdList"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ActionIpExtendedCommunityProperties(_Model): + """IP Extended Community Properties. + + :ivar add: List of IP Extended Community IDs. + :vartype add: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityIdList + :ivar delete: List of IP Extended Community IDs. + :vartype delete: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityIdList + :ivar set: List of IP Extended Community IDs. + :vartype set: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityIdList + """ + + add: Optional["_models.IpExtendedCommunityIdList"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of IP Extended Community IDs.""" + delete: Optional["_models.IpExtendedCommunityIdList"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of IP Extended Community IDs.""" + set: Optional["_models.IpExtendedCommunityIdList"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of IP Extended Community IDs.""" + + @overload + def __init__( + self, + *, + add: Optional["_models.IpExtendedCommunityIdList"] = None, + delete: Optional["_models.IpExtendedCommunityIdList"] = None, + set: Optional["_models.IpExtendedCommunityIdList"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AggregateRoute(_Model): + """aggregateIpv4Route model. + + :ivar prefix: IPv4 Prefix of the aggregate Ipv4Route. Required. + :vartype prefix: str + """ + + prefix: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """IPv4 Prefix of the aggregate Ipv4Route. Required.""" + + @overload + def __init__( + self, + *, + prefix: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AggregateRouteConfiguration(_Model): + """List of IPv4 and IPv6 aggregate routes. + + :ivar ipv4_routes: List of IPv4 Route prefixes. + :vartype ipv4_routes: list[~azure.mgmt.managednetworkfabric.models.AggregateRoute] + :ivar ipv6_routes: List of Ipv6Routes prefixes. + :vartype ipv6_routes: list[~azure.mgmt.managednetworkfabric.models.AggregateRoute] + """ + + ipv4_routes: Optional[list["_models.AggregateRoute"]] = rest_field( + name="ipv4Routes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IPv4 Route prefixes.""" + ipv6_routes: Optional[list["_models.AggregateRoute"]] = rest_field( + name="ipv6Routes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of Ipv6Routes prefixes.""" + + @overload + def __init__( + self, + *, + ipv4_routes: Optional[list["_models.AggregateRoute"]] = None, + ipv6_routes: Optional[list["_models.AggregateRoute"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AggregateRoutePatchConfiguration(_Model): + """List of IPv4 and IPv6 aggregate routes. + + :ivar ipv4_routes: List of IPv4 Route prefixes. + :vartype ipv4_routes: list[~azure.mgmt.managednetworkfabric.models.AggregateRoute] + :ivar ipv6_routes: List of Ipv6Routes prefixes. + :vartype ipv6_routes: list[~azure.mgmt.managednetworkfabric.models.AggregateRoute] + """ + + ipv4_routes: Optional[list["_models.AggregateRoute"]] = rest_field( + name="ipv4Routes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IPv4 Route prefixes.""" + ipv6_routes: Optional[list["_models.AggregateRoute"]] = rest_field( + name="ipv6Routes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of Ipv6Routes prefixes.""" + + @overload + def __init__( + self, + *, + ipv4_routes: Optional[list["_models.AggregateRoute"]] = None, + ipv6_routes: Optional[list["_models.AggregateRoute"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AnnotationResource(_Model): + """Switch configuration entries require a description to discern between configuration group. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + """ + + annotation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Switch configuration description.""" + + @overload + def __init__( + self, + *, + annotation: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ArmConfigurationDiffOperationResponse(_Model): + """Arm Configuration Diff Response V2. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + :ivar properties: Arm Configuration Diff Response Properties. + :vartype properties: + ~azure.mgmt.managednetworkfabric.models.ArmConfigurationDiffResponseProperties + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the async operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + percent_complete: Optional[float] = rest_field( + name="percentComplete", visibility=["read", "create", "update", "delete", "query"] + ) + """Percent of the operation that is complete.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the operation.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the operation.""" + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operations list.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If present, details of the operation error.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + properties: Optional["_models.ArmConfigurationDiffResponseProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Arm Configuration Diff Response Properties.""" + + @overload + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + properties: Optional["_models.ArmConfigurationDiffResponseProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ArmConfigurationDiffResponseProperties(_Model): + """Arm Configuration Diff Response Properties. + + :ivar configuration_diff_url: Storage URL to the diff file. + :vartype configuration_diff_url: str + """ + + configuration_diff_url: Optional[str] = rest_field( + name="configurationDiffUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """Storage URL to the diff file.""" + + @overload + def __init__( + self, + *, + configuration_diff_url: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AuthorizedTransceiverPatchProperties(_Model): + """Authorized Transceiver Patch Properties. + + :ivar vendor: Vendor of the transceiver. + :vartype vendor: str + :ivar key: Key that must be configured on the fabric. + :vartype key: str + """ + + vendor: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Vendor of the transceiver.""" + key: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Key that must be configured on the fabric.""" + + @overload + def __init__( + self, + *, + vendor: Optional[str] = None, + key: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AuthorizedTransceiverProperties(_Model): + """Authorized Transceiver Properties. + + :ivar vendor: Vendor of the transceiver. + :vartype vendor: str + :ivar key: Key that must be configured on the fabric. + :vartype key: str + """ + + vendor: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Vendor of the transceiver.""" + key: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Key that must be configured on the fabric.""" + + @overload + def __init__( + self, + *, + vendor: Optional[str] = None, + key: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class BfdConfiguration(_Model): + """BFD configuration properties. + + :ivar administrative_state: Administrative state of the BfdConfiguration. Example: Enabled | + Disabled. Known values are: "Enabled", "Disabled", "MAT", and "RMA". + :vartype administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.BfdAdministrativeState + :ivar interval_in_milli_seconds: Interval in milliseconds. Example: 300. + :vartype interval_in_milli_seconds: int + :ivar multiplier: Multiplier for the Bfd Configuration. Example: 5. + :vartype multiplier: int + """ + + administrative_state: Optional[Union[str, "_models.BfdAdministrativeState"]] = rest_field( + name="administrativeState", visibility=["read"] + ) + """Administrative state of the BfdConfiguration. Example: Enabled | Disabled. Known values are: + \"Enabled\", \"Disabled\", \"MAT\", and \"RMA\".""" + interval_in_milli_seconds: Optional[int] = rest_field( + name="intervalInMilliSeconds", visibility=["read", "create", "update", "delete", "query"] + ) + """Interval in milliseconds. Example: 300.""" + multiplier: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Multiplier for the Bfd Configuration. Example: 5.""" + + @overload + def __init__( + self, + *, + interval_in_milli_seconds: Optional[int] = None, + multiplier: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class BfdPatchConfiguration(_Model): + """BFD configuration properties. + + :ivar administrative_state: Administrative state of the BfdConfiguration. Example: Enabled | + Disabled. Known values are: "Enabled", "Disabled", "MAT", and "RMA". + :vartype administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.BfdAdministrativeState + :ivar interval_in_milli_seconds: Interval in milliseconds. Example: 300. + :vartype interval_in_milli_seconds: int + :ivar multiplier: Multiplier for the Bfd Configuration. Example: 5. + :vartype multiplier: int + """ + + administrative_state: Optional[Union[str, "_models.BfdAdministrativeState"]] = rest_field( + name="administrativeState", visibility=["read"] + ) + """Administrative state of the BfdConfiguration. Example: Enabled | Disabled. Known values are: + \"Enabled\", \"Disabled\", \"MAT\", and \"RMA\".""" + interval_in_milli_seconds: Optional[int] = rest_field( + name="intervalInMilliSeconds", visibility=["read", "create", "update", "delete", "query"] + ) + """Interval in milliseconds. Example: 300.""" + multiplier: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Multiplier for the Bfd Configuration. Example: 5.""" + + @overload + def __init__( + self, + *, + interval_in_milli_seconds: Optional[int] = None, + multiplier: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class BgpConfiguration(AnnotationResource): + """BGP configuration properties. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar bfd_configuration: BFD configuration properties. + :vartype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdConfiguration + :ivar default_route_originate: Originate a defaultRoute. Ex: "True" | "False". Known values + are: "True" and "False". + :vartype default_route_originate: str or + ~azure.mgmt.managednetworkfabric.models.BooleanEnumProperty + :ivar allow_as: Allows for routes to be received and processed even if the router detects its + own ASN in the AS-Path. 0 is disable, Possible values are 1-10, default is 2. + :vartype allow_as: int + :ivar allow_as_override: Enable Or Disable state. Known values are: "Enable" and "Disable". + :vartype allow_as_override: str or ~azure.mgmt.managednetworkfabric.models.AllowASOverride + :ivar fabric_asn: ASN of Network Fabric. Example: 65048. + :vartype fabric_asn: int + :ivar peer_asn: Peer ASN. Example: 65047. Required. + :vartype peer_asn: int + :ivar ipv4_listen_range_prefixes: List of BGP IPv4 Listen Range prefixes. + :vartype ipv4_listen_range_prefixes: list[str] + :ivar ipv6_listen_range_prefixes: List of BGP IPv6 Listen Ranges prefixes. + :vartype ipv6_listen_range_prefixes: list[str] + :ivar ipv4_neighbor_address: List with stringified IPv4 Neighbor Addresses. + :vartype ipv4_neighbor_address: list[~azure.mgmt.managednetworkfabric.models.NeighborAddress] + :ivar ipv6_neighbor_address: List with stringified IPv6 Neighbor Address. + :vartype ipv6_neighbor_address: list[~azure.mgmt.managednetworkfabric.models.NeighborAddress] + :ivar bmp_configuration: InternalNetwork BMP Configuration. + :vartype bmp_configuration: + ~azure.mgmt.managednetworkfabric.models.InternalNetworkBmpProperties + :ivar v4_over_v6_bgp_session: V4 over V6 bgp session. Known values are: "Enabled" and + "Disabled". + :vartype v4_over_v6_bgp_session: str or + ~azure.mgmt.managednetworkfabric.models.V4OverV6BgpSessionState + :ivar v6_over_v4_bgp_session: v6 over v4 bgp session. Known values are: "Enabled" and + "Disabled". + :vartype v6_over_v4_bgp_session: str or + ~azure.mgmt.managednetworkfabric.models.V6OverV4BgpSessionState + """ + + bfd_configuration: Optional["_models.BfdConfiguration"] = rest_field( + name="bfdConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """BFD configuration properties.""" + default_route_originate: Optional[Union[str, "_models.BooleanEnumProperty"]] = rest_field( + name="defaultRouteOriginate", visibility=["read", "create", "update", "delete", "query"] + ) + """Originate a defaultRoute. Ex: \"True\" | \"False\". Known values are: \"True\" and \"False\".""" + allow_as: Optional[int] = rest_field(name="allowAS", visibility=["read", "create", "update", "delete", "query"]) + """Allows for routes to be received and processed even if the router detects its own ASN in the + AS-Path. 0 is disable, Possible values are 1-10, default is 2.""" + allow_as_override: Optional[Union[str, "_models.AllowASOverride"]] = rest_field( + name="allowASOverride", visibility=["read", "create", "update", "delete", "query"] + ) + """Enable Or Disable state. Known values are: \"Enable\" and \"Disable\".""" + fabric_asn: Optional[int] = rest_field(name="fabricASN", visibility=["read"]) + """ASN of Network Fabric. Example: 65048.""" + peer_asn: int = rest_field(name="peerASN", visibility=["read", "create", "update", "delete", "query"]) + """Peer ASN. Example: 65047. Required.""" + ipv4_listen_range_prefixes: Optional[list[str]] = rest_field( + name="ipv4ListenRangePrefixes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of BGP IPv4 Listen Range prefixes.""" + ipv6_listen_range_prefixes: Optional[list[str]] = rest_field( + name="ipv6ListenRangePrefixes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of BGP IPv6 Listen Ranges prefixes.""" + ipv4_neighbor_address: Optional[list["_models.NeighborAddress"]] = rest_field( + name="ipv4NeighborAddress", visibility=["read", "create", "update", "delete", "query"] + ) + """List with stringified IPv4 Neighbor Addresses.""" + ipv6_neighbor_address: Optional[list["_models.NeighborAddress"]] = rest_field( + name="ipv6NeighborAddress", visibility=["read", "create", "update", "delete", "query"] + ) + """List with stringified IPv6 Neighbor Address.""" + bmp_configuration: Optional["_models.InternalNetworkBmpProperties"] = rest_field( + name="bmpConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """InternalNetwork BMP Configuration.""" + v4_over_v6_bgp_session: Optional[Union[str, "_models.V4OverV6BgpSessionState"]] = rest_field( + name="v4OverV6BgpSession", visibility=["read", "create", "update", "delete", "query"] + ) + """V4 over V6 bgp session. Known values are: \"Enabled\" and \"Disabled\".""" + v6_over_v4_bgp_session: Optional[Union[str, "_models.V6OverV4BgpSessionState"]] = rest_field( + name="v6OverV4BgpSession", visibility=["read", "create", "update", "delete", "query"] + ) + """v6 over v4 bgp session. Known values are: \"Enabled\" and \"Disabled\".""" + + @overload + def __init__( + self, + *, + peer_asn: int, + annotation: Optional[str] = None, + bfd_configuration: Optional["_models.BfdConfiguration"] = None, + default_route_originate: Optional[Union[str, "_models.BooleanEnumProperty"]] = None, + allow_as: Optional[int] = None, + allow_as_override: Optional[Union[str, "_models.AllowASOverride"]] = None, + ipv4_listen_range_prefixes: Optional[list[str]] = None, + ipv6_listen_range_prefixes: Optional[list[str]] = None, + ipv4_neighbor_address: Optional[list["_models.NeighborAddress"]] = None, + ipv6_neighbor_address: Optional[list["_models.NeighborAddress"]] = None, + bmp_configuration: Optional["_models.InternalNetworkBmpProperties"] = None, + v4_over_v6_bgp_session: Optional[Union[str, "_models.V4OverV6BgpSessionState"]] = None, + v6_over_v4_bgp_session: Optional[Union[str, "_models.V6OverV4BgpSessionState"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class BgpPatchConfiguration(AnnotationResource): + """BGP configuration properties. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar bfd_configuration: BFD configuration properties. + :vartype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdPatchConfiguration + :ivar default_route_originate: Originate a defaultRoute. Ex: "True" | "False". Known values + are: "True" and "False". + :vartype default_route_originate: str or + ~azure.mgmt.managednetworkfabric.models.BooleanEnumProperty + :ivar allow_as: Allows for routes to be received and processed even if the router detects its + own ASN in the AS-Path. 0 is disable, Possible values are 1-10, default is 2. + :vartype allow_as: int + :ivar allow_as_override: Enable Or Disable state. Known values are: "Enable" and "Disable". + :vartype allow_as_override: str or ~azure.mgmt.managednetworkfabric.models.AllowASOverride + :ivar fabric_asn: ASN of Network Fabric. Example: 65048. + :vartype fabric_asn: int + :ivar peer_asn: Peer ASN. Example: 65047. + :vartype peer_asn: int + :ivar ipv4_listen_range_prefixes: List of BGP IPv4 Listen Range prefixes. + :vartype ipv4_listen_range_prefixes: list[str] + :ivar ipv6_listen_range_prefixes: List of BGP IPv6 Listen Ranges prefixes. + :vartype ipv6_listen_range_prefixes: list[str] + :ivar ipv4_neighbor_address: List with stringified IPv4 Neighbor Addresses. + :vartype ipv4_neighbor_address: + list[~azure.mgmt.managednetworkfabric.models.NeighborAddressPatch] + :ivar ipv6_neighbor_address: List with stringified IPv6 Neighbor Address. + :vartype ipv6_neighbor_address: + list[~azure.mgmt.managednetworkfabric.models.NeighborAddressPatch] + :ivar bmp_configuration: InternalNetwork BMP Configuration. + :vartype bmp_configuration: + ~azure.mgmt.managednetworkfabric.models.InternalNetworkBmpPatchProperties + :ivar v4_over_v6_bgp_session: V4 over V6 bgp session. Known values are: "Enabled" and + "Disabled". + :vartype v4_over_v6_bgp_session: str or + ~azure.mgmt.managednetworkfabric.models.V4OverV6BgpSessionState + :ivar v6_over_v4_bgp_session: v6 over v4 bgp session. Known values are: "Enabled" and + "Disabled". + :vartype v6_over_v4_bgp_session: str or + ~azure.mgmt.managednetworkfabric.models.V6OverV4BgpSessionState + """ + + bfd_configuration: Optional["_models.BfdPatchConfiguration"] = rest_field( + name="bfdConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """BFD configuration properties.""" + default_route_originate: Optional[Union[str, "_models.BooleanEnumProperty"]] = rest_field( + name="defaultRouteOriginate", visibility=["read", "create", "update", "delete", "query"] + ) + """Originate a defaultRoute. Ex: \"True\" | \"False\". Known values are: \"True\" and \"False\".""" + allow_as: Optional[int] = rest_field(name="allowAS", visibility=["read", "create", "update", "delete", "query"]) + """Allows for routes to be received and processed even if the router detects its own ASN in the + AS-Path. 0 is disable, Possible values are 1-10, default is 2.""" + allow_as_override: Optional[Union[str, "_models.AllowASOverride"]] = rest_field( + name="allowASOverride", visibility=["read", "create", "update", "delete", "query"] + ) + """Enable Or Disable state. Known values are: \"Enable\" and \"Disable\".""" + fabric_asn: Optional[int] = rest_field(name="fabricASN", visibility=["read"]) + """ASN of Network Fabric. Example: 65048.""" + peer_asn: Optional[int] = rest_field(name="peerASN", visibility=["read", "create", "update", "delete", "query"]) + """Peer ASN. Example: 65047.""" + ipv4_listen_range_prefixes: Optional[list[str]] = rest_field( + name="ipv4ListenRangePrefixes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of BGP IPv4 Listen Range prefixes.""" + ipv6_listen_range_prefixes: Optional[list[str]] = rest_field( + name="ipv6ListenRangePrefixes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of BGP IPv6 Listen Ranges prefixes.""" + ipv4_neighbor_address: Optional[list["_models.NeighborAddressPatch"]] = rest_field( + name="ipv4NeighborAddress", visibility=["read", "create", "update", "delete", "query"] + ) + """List with stringified IPv4 Neighbor Addresses.""" + ipv6_neighbor_address: Optional[list["_models.NeighborAddressPatch"]] = rest_field( + name="ipv6NeighborAddress", visibility=["read", "create", "update", "delete", "query"] + ) + """List with stringified IPv6 Neighbor Address.""" + bmp_configuration: Optional["_models.InternalNetworkBmpPatchProperties"] = rest_field( + name="bmpConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """InternalNetwork BMP Configuration.""" + v4_over_v6_bgp_session: Optional[Union[str, "_models.V4OverV6BgpSessionState"]] = rest_field( + name="v4OverV6BgpSession", visibility=["read", "create", "update", "delete", "query"] + ) + """V4 over V6 bgp session. Known values are: \"Enabled\" and \"Disabled\".""" + v6_over_v4_bgp_session: Optional[Union[str, "_models.V6OverV4BgpSessionState"]] = rest_field( + name="v6OverV4BgpSession", visibility=["read", "create", "update", "delete", "query"] + ) + """v6 over v4 bgp session. Known values are: \"Enabled\" and \"Disabled\".""" + + @overload + def __init__( + self, + *, + annotation: Optional[str] = None, + bfd_configuration: Optional["_models.BfdPatchConfiguration"] = None, + default_route_originate: Optional[Union[str, "_models.BooleanEnumProperty"]] = None, + allow_as: Optional[int] = None, + allow_as_override: Optional[Union[str, "_models.AllowASOverride"]] = None, + peer_asn: Optional[int] = None, + ipv4_listen_range_prefixes: Optional[list[str]] = None, + ipv6_listen_range_prefixes: Optional[list[str]] = None, + ipv4_neighbor_address: Optional[list["_models.NeighborAddressPatch"]] = None, + ipv6_neighbor_address: Optional[list["_models.NeighborAddressPatch"]] = None, + bmp_configuration: Optional["_models.InternalNetworkBmpPatchProperties"] = None, + v4_over_v6_bgp_session: Optional[Union[str, "_models.V4OverV6BgpSessionState"]] = None, + v6_over_v4_bgp_session: Optional[Union[str, "_models.V6OverV4BgpSessionState"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class BitRate(_Model): + """Bit rate in bits per second. + + :ivar rate: Bitrate. + :vartype rate: int + :ivar unit: Bitrate unit. Known values are: "bps", "Kbps", "Mbps", "Gbps", and "Pps". + :vartype unit: str or ~azure.mgmt.managednetworkfabric.models.BitRateUnit + """ + + rate: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Bitrate.""" + unit: Optional[Union[str, "_models.BitRateUnit"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Bitrate unit. Known values are: \"bps\", \"Kbps\", \"Mbps\", \"Gbps\", and \"Pps\".""" + + @overload + def __init__( + self, + *, + rate: Optional[int] = None, + unit: Optional[Union[str, "_models.BitRateUnit"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class BmpConfigurationPatchProperties(_Model): + """BMP Configuration patch properties. + + :ivar station_configuration_state: Enabling a station. Either True/False. Known values are: + "Enabled" and "Disabled". + :vartype station_configuration_state: str or + ~azure.mgmt.managednetworkfabric.models.StationConfigurationState + :ivar scope_resource_id: Scope resource ARM Identifier. + :vartype scope_resource_id: str + :ivar station_name: Name of the station. + :vartype station_name: str + :ivar station_ip: IP Address of the station. + :vartype station_ip: str + :ivar station_port: Port of the station. Default value is 5000. + :vartype station_port: int + :ivar station_connection_mode: Station Connection Mode. Known values are: "Active" and + "Passive". + :vartype station_connection_mode: str or + ~azure.mgmt.managednetworkfabric.models.StationConnectionMode + :ivar station_connection_properties: Station Connection Properties. + :vartype station_connection_properties: + ~azure.mgmt.managednetworkfabric.models.StationConnectionPatchProperties + :ivar station_network: Network of the station. + :vartype station_network: str + :ivar monitored_networks: The List of Network ID's that need to be monitored. + :vartype monitored_networks: list[str] + :ivar export_policy: Export Policy for the BMP Configuration. Known values are: "Pre-Policy", + "Post-Policy", "All", and "LocalRib". + :vartype export_policy: str or ~azure.mgmt.managednetworkfabric.models.BmpExportPolicy + :ivar export_policy_configuration: Export Policy configuration properties for the BMP. + :vartype export_policy_configuration: + ~azure.mgmt.managednetworkfabric.models.BmpExportPolicyPatchProperties + :ivar monitored_address_families: Monitored Address Families for the BMP Configuration. + :vartype monitored_address_families: list[str or + ~azure.mgmt.managednetworkfabric.models.BmpMonitoredAddressFamily] + """ + + station_configuration_state: Optional[Union[str, "_models.StationConfigurationState"]] = rest_field( + name="stationConfigurationState", visibility=["read", "create", "update", "delete", "query"] + ) + """Enabling a station. Either True/False. Known values are: \"Enabled\" and \"Disabled\".""" + scope_resource_id: Optional[str] = rest_field( + name="scopeResourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """Scope resource ARM Identifier.""" + station_name: Optional[str] = rest_field( + name="stationName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the station.""" + station_ip: Optional[str] = rest_field(name="stationIp", visibility=["read", "create", "update", "delete", "query"]) + """IP Address of the station.""" + station_port: Optional[int] = rest_field( + name="stationPort", visibility=["read", "create", "update", "delete", "query"] + ) + """Port of the station. Default value is 5000.""" + station_connection_mode: Optional[Union[str, "_models.StationConnectionMode"]] = rest_field( + name="stationConnectionMode", visibility=["read", "create", "update", "delete", "query"] + ) + """Station Connection Mode. Known values are: \"Active\" and \"Passive\".""" + station_connection_properties: Optional["_models.StationConnectionPatchProperties"] = rest_field( + name="stationConnectionProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """Station Connection Properties.""" + station_network: Optional[str] = rest_field( + name="stationNetwork", visibility=["read", "create", "update", "delete", "query"] + ) + """Network of the station.""" + monitored_networks: Optional[list[str]] = rest_field( + name="monitoredNetworks", visibility=["read", "create", "update", "delete", "query"] + ) + """The List of Network ID's that need to be monitored.""" + export_policy: Optional[Union[str, "_models.BmpExportPolicy"]] = rest_field( + name="exportPolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Export Policy for the BMP Configuration. Known values are: \"Pre-Policy\", \"Post-Policy\", + \"All\", and \"LocalRib\".""" + export_policy_configuration: Optional["_models.BmpExportPolicyPatchProperties"] = rest_field( + name="exportPolicyConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Export Policy configuration properties for the BMP.""" + monitored_address_families: Optional[list[Union[str, "_models.BmpMonitoredAddressFamily"]]] = rest_field( + name="monitoredAddressFamilies", visibility=["read", "create", "update", "delete", "query"] + ) + """Monitored Address Families for the BMP Configuration.""" + + @overload + def __init__( + self, + *, + station_configuration_state: Optional[Union[str, "_models.StationConfigurationState"]] = None, + scope_resource_id: Optional[str] = None, + station_name: Optional[str] = None, + station_ip: Optional[str] = None, + station_port: Optional[int] = None, + station_connection_mode: Optional[Union[str, "_models.StationConnectionMode"]] = None, + station_connection_properties: Optional["_models.StationConnectionPatchProperties"] = None, + station_network: Optional[str] = None, + monitored_networks: Optional[list[str]] = None, + export_policy: Optional[Union[str, "_models.BmpExportPolicy"]] = None, + export_policy_configuration: Optional["_models.BmpExportPolicyPatchProperties"] = None, + monitored_address_families: Optional[list[Union[str, "_models.BmpMonitoredAddressFamily"]]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class BmpConfigurationProperties(_Model): + """BGP Monitoring Protocol (BMP) Configuration properties. + + :ivar station_configuration_state: Enabling a station. Either True/False. Known values are: + "Enabled" and "Disabled". + :vartype station_configuration_state: str or + ~azure.mgmt.managednetworkfabric.models.StationConfigurationState + :ivar scope_resource_id: Scope resource ARM Identifier. + :vartype scope_resource_id: str + :ivar station_name: Name of the station. + :vartype station_name: str + :ivar station_ip: IP Address of the station. + :vartype station_ip: str + :ivar station_port: Port of the station. Default value is 5000. + :vartype station_port: int + :ivar station_connection_mode: Station Connection Mode. Known values are: "Active" and + "Passive". + :vartype station_connection_mode: str or + ~azure.mgmt.managednetworkfabric.models.StationConnectionMode + :ivar station_connection_properties: Station Connection Properties. + :vartype station_connection_properties: + ~azure.mgmt.managednetworkfabric.models.StationConnectionProperties + :ivar station_network: Network of the station. + :vartype station_network: str + :ivar monitored_networks: The List of Network ID's that need to be monitored. + :vartype monitored_networks: list[str] + :ivar export_policy: Export Policy for the BMP Configuration. Known values are: "Pre-Policy", + "Post-Policy", "All", and "LocalRib". + :vartype export_policy: str or ~azure.mgmt.managednetworkfabric.models.BmpExportPolicy + :ivar export_policy_configuration: Export Policy configuration properties for the BMP. + :vartype export_policy_configuration: + ~azure.mgmt.managednetworkfabric.models.BmpExportPolicyProperties + :ivar monitored_address_families: Monitored Address Families for the BMP Configuration. + :vartype monitored_address_families: list[str or + ~azure.mgmt.managednetworkfabric.models.BmpMonitoredAddressFamily] + """ + + station_configuration_state: Optional[Union[str, "_models.StationConfigurationState"]] = rest_field( + name="stationConfigurationState", visibility=["read", "create", "update", "delete", "query"] + ) + """Enabling a station. Either True/False. Known values are: \"Enabled\" and \"Disabled\".""" + scope_resource_id: Optional[str] = rest_field( + name="scopeResourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """Scope resource ARM Identifier.""" + station_name: Optional[str] = rest_field( + name="stationName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the station.""" + station_ip: Optional[str] = rest_field(name="stationIp", visibility=["read", "create", "update", "delete", "query"]) + """IP Address of the station.""" + station_port: Optional[int] = rest_field( + name="stationPort", visibility=["read", "create", "update", "delete", "query"] + ) + """Port of the station. Default value is 5000.""" + station_connection_mode: Optional[Union[str, "_models.StationConnectionMode"]] = rest_field( + name="stationConnectionMode", visibility=["read", "create", "update", "delete", "query"] + ) + """Station Connection Mode. Known values are: \"Active\" and \"Passive\".""" + station_connection_properties: Optional["_models.StationConnectionProperties"] = rest_field( + name="stationConnectionProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """Station Connection Properties.""" + station_network: Optional[str] = rest_field( + name="stationNetwork", visibility=["read", "create", "update", "delete", "query"] + ) + """Network of the station.""" + monitored_networks: Optional[list[str]] = rest_field( + name="monitoredNetworks", visibility=["read", "create", "update", "delete", "query"] + ) + """The List of Network ID's that need to be monitored.""" + export_policy: Optional[Union[str, "_models.BmpExportPolicy"]] = rest_field( + name="exportPolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Export Policy for the BMP Configuration. Known values are: \"Pre-Policy\", \"Post-Policy\", + \"All\", and \"LocalRib\".""" + export_policy_configuration: Optional["_models.BmpExportPolicyProperties"] = rest_field( + name="exportPolicyConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Export Policy configuration properties for the BMP.""" + monitored_address_families: Optional[list[Union[str, "_models.BmpMonitoredAddressFamily"]]] = rest_field( + name="monitoredAddressFamilies", visibility=["read", "create", "update", "delete", "query"] + ) + """Monitored Address Families for the BMP Configuration.""" + + @overload + def __init__( + self, + *, + station_configuration_state: Optional[Union[str, "_models.StationConfigurationState"]] = None, + scope_resource_id: Optional[str] = None, + station_name: Optional[str] = None, + station_ip: Optional[str] = None, + station_port: Optional[int] = None, + station_connection_mode: Optional[Union[str, "_models.StationConnectionMode"]] = None, + station_connection_properties: Optional["_models.StationConnectionProperties"] = None, + station_network: Optional[str] = None, + monitored_networks: Optional[list[str]] = None, + export_policy: Optional[Union[str, "_models.BmpExportPolicy"]] = None, + export_policy_configuration: Optional["_models.BmpExportPolicyProperties"] = None, + monitored_address_families: Optional[list[Union[str, "_models.BmpMonitoredAddressFamily"]]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class BmpExportPolicyPatchProperties(_Model): + """BMP Export Policy Configuration properties. + + :ivar export_policies: Export Policy for the BGP Monitoring Protocol (BMP) Configuration. + :vartype export_policies: list[str or ~azure.mgmt.managednetworkfabric.models.BmpExportPolicy] + """ + + export_policies: Optional[list[Union[str, "_models.BmpExportPolicy"]]] = rest_field( + name="exportPolicies", visibility=["read", "create", "update", "delete", "query"] + ) + """Export Policy for the BGP Monitoring Protocol (BMP) Configuration.""" + + @overload + def __init__( + self, + *, + export_policies: Optional[list[Union[str, "_models.BmpExportPolicy"]]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class BmpExportPolicyProperties(_Model): + """BMP Export Policy Configuration properties. + + :ivar export_policies: Export Policy for the BGP Monitoring Protocol (BMP) Configuration. + :vartype export_policies: list[str or ~azure.mgmt.managednetworkfabric.models.BmpExportPolicy] + """ + + export_policies: Optional[list[Union[str, "_models.BmpExportPolicy"]]] = rest_field( + name="exportPolicies", visibility=["read", "create", "update", "delete", "query"] + ) + """Export Policy for the BGP Monitoring Protocol (BMP) Configuration.""" + + @overload + def __init__( + self, + *, + export_policies: Optional[list[Union[str, "_models.BmpExportPolicy"]]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class BurstSize(_Model): + """Burst size in packets. + + :ivar size: Burst size. + :vartype size: int + :ivar unit: Burst size unit. Known values are: "Bytes", "KBytes", "MBytes", "GBytes", and + "Packets". + :vartype unit: str or ~azure.mgmt.managednetworkfabric.models.BurstSizeUnit + """ + + size: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Burst size.""" + unit: Optional[Union[str, "_models.BurstSizeUnit"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Burst size unit. Known values are: \"Bytes\", \"KBytes\", \"MBytes\", \"GBytes\", and + \"Packets\".""" + + @overload + def __init__( + self, + *, + size: Optional[int] = None, + unit: Optional[Union[str, "_models.BurstSizeUnit"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CertificateArchiveReference(_Model): + """A reference to a version of a certificate in a key vault. + + :ivar key_vault_uri: A Uniform Resource Identifier (URI) for the certificate in the key vault. + :vartype key_vault_uri: str + :ivar key_vault_id: The resource ID of the key vault containing the certificate. + :vartype key_vault_id: str + :ivar certificate_name: The name of the certificate in the key vault. + :vartype certificate_name: str + :ivar certificate_version: The version of the certificate in the key vault. + :vartype certificate_version: str + """ + + key_vault_uri: Optional[str] = rest_field(name="keyVaultUri", visibility=["read"]) + """A Uniform Resource Identifier (URI) for the certificate in the key vault.""" + key_vault_id: Optional[str] = rest_field(name="keyVaultId", visibility=["read"]) + """The resource ID of the key vault containing the certificate.""" + certificate_name: Optional[str] = rest_field(name="certificateName", visibility=["read"]) + """The name of the certificate in the key vault.""" + certificate_version: Optional[str] = rest_field(name="certificateVersion", visibility=["read"]) + """The version of the certificate in the key vault.""" + + +class CertificateRotationStatus(_Model): + """Status of a certificate rotation for a device (Network Device or Terminal Server). + + :ivar expire_time: Time at which the certificate will expire, for certificates with a limited + validity period. + :vartype expire_time: ~datetime.datetime + :ivar last_rotation_time: The date and time when the certificate was last changed. + :vartype last_rotation_time: ~datetime.datetime + :ivar synchronization_status: Whether the device has been configured with the latest version of + the certificate. Known values are: "InSync", "Synchronizing", and "OutOfSync". + :vartype synchronization_status: str or + ~azure.mgmt.managednetworkfabric.models.SynchronizationStatus + :ivar certificate_archive_reference: Reference to the currently configured version of the + certificate in a key vault. + :vartype certificate_archive_reference: + ~azure.mgmt.managednetworkfabric.models.CertificateArchiveReference + :ivar certificate_type: Identifies the certificate according to its purpose. + :vartype certificate_type: str + """ + + expire_time: Optional[datetime.datetime] = rest_field(name="expireTime", visibility=["read"], format="rfc3339") + """Time at which the certificate will expire, for certificates with a limited validity period.""" + last_rotation_time: Optional[datetime.datetime] = rest_field( + name="lastRotationTime", visibility=["read"], format="rfc3339" + ) + """The date and time when the certificate was last changed.""" + synchronization_status: Optional[Union[str, "_models.SynchronizationStatus"]] = rest_field( + name="synchronizationStatus", visibility=["read"] + ) + """Whether the device has been configured with the latest version of the certificate. Known values + are: \"InSync\", \"Synchronizing\", and \"OutOfSync\".""" + certificate_archive_reference: Optional["_models.CertificateArchiveReference"] = rest_field( + name="certificateArchiveReference", visibility=["read"] + ) + """Reference to the currently configured version of the certificate in a key vault.""" + certificate_type: Optional[str] = rest_field(name="certificateType", visibility=["read"]) + """Identifies the certificate according to its purpose.""" + + +class CommitBatchDetails(_Model): + """Commit Batch Details. + + :ivar failed_devices: List of devices for which the commit operation failed. + :vartype failed_devices: list[str] + """ + + failed_devices: Optional[list[str]] = rest_field( + name="failedDevices", visibility=["read", "create", "update", "delete", "query"] + ) + """List of devices for which the commit operation failed.""" + + @overload + def __init__( + self, + *, + failed_devices: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CommitBatchStatusOperationResponse(_Model): + """Commit Batch Status Response. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + :ivar properties: Commit Batch Status Response Properties. + :vartype properties: + ~azure.mgmt.managednetworkfabric.models.CommitBatchStatusResponseProperties + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the async operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + percent_complete: Optional[float] = rest_field( + name="percentComplete", visibility=["read", "create", "update", "delete", "query"] + ) + """Percent of the operation that is complete.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the operation.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the operation.""" + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operations list.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If present, details of the operation error.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + properties: Optional["_models.CommitBatchStatusResponseProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Commit Batch Status Response Properties.""" + + @overload + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + properties: Optional["_models.CommitBatchStatusResponseProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CommitBatchStatusRequest(_Model): + """Commit Batch Status Request. + + :ivar commit_batch_id: Commit Batch Identifier. If not provided, the latest commit batch status + will be returned. + :vartype commit_batch_id: str + """ + + commit_batch_id: Optional[str] = rest_field( + name="commitBatchId", visibility=["read", "create", "update", "delete", "query"] + ) + """Commit Batch Identifier. If not provided, the latest commit batch status will be returned.""" + + @overload + def __init__( + self, + *, + commit_batch_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CommitBatchStatusResponseProperties(_Model): + """Commit Batch Status Response Properties. + + :ivar commit_batch_id: Commit Batch Identifier. + :vartype commit_batch_id: str + :ivar commit_batch_state: Commit Batch State. Known values are: "Processing", "Succeeded", and + "Failed". + :vartype commit_batch_state: str or ~azure.mgmt.managednetworkfabric.models.CommitBatchState + :ivar commit_batch_details: Commit Batch Details. + :vartype commit_batch_details: ~azure.mgmt.managednetworkfabric.models.CommitBatchDetails + """ + + commit_batch_id: Optional[str] = rest_field( + name="commitBatchId", visibility=["read", "create", "update", "delete", "query"] + ) + """Commit Batch Identifier.""" + commit_batch_state: Optional[Union[str, "_models.CommitBatchState"]] = rest_field( + name="commitBatchState", visibility=["read", "create", "update", "delete", "query"] + ) + """Commit Batch State. Known values are: \"Processing\", \"Succeeded\", and \"Failed\".""" + commit_batch_details: Optional["_models.CommitBatchDetails"] = rest_field( + name="commitBatchDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Commit Batch Details.""" + + @overload + def __init__( + self, + *, + commit_batch_id: Optional[str] = None, + commit_batch_state: Optional[Union[str, "_models.CommitBatchState"]] = None, + commit_batch_details: Optional["_models.CommitBatchDetails"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CommitConfigurationRequest(_Model): + """Commit Configuration Request. + + :ivar commit_stage: Commit stage Action to be performed. Known values are: "Start", "Continue", + and "Rollback". + :vartype commit_stage: str or ~azure.mgmt.managednetworkfabric.models.CommitStage + :ivar commit_policy: Commit configuration Policy. Supported policy is StageCEConfiguration, + which indicates to prepare the configuration for the CE device type. "StageCEConfiguration" + :vartype commit_policy: str or + ~azure.mgmt.managednetworkfabric.models.CommitConfigurationPolicy + :ivar devices: List of ARM resource IDs of devices to be included in the commit operation. + Either CE1 or CE2 is allowed. + :vartype devices: list[str] + """ + + commit_stage: Optional[Union[str, "_models.CommitStage"]] = rest_field( + name="commitStage", visibility=["read", "create", "update", "delete", "query"] + ) + """Commit stage Action to be performed. Known values are: \"Start\", \"Continue\", and + \"Rollback\".""" + commit_policy: Optional[Union[str, "_models.CommitConfigurationPolicy"]] = rest_field( + name="commitPolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Commit configuration Policy. Supported policy is StageCEConfiguration, which indicates to + prepare the configuration for the CE device type. \"StageCEConfiguration\"""" + devices: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of ARM resource IDs of devices to be included in the commit operation. Either CE1 or CE2 + is allowed.""" + + @overload + def __init__( + self, + *, + commit_stage: Optional[Union[str, "_models.CommitStage"]] = None, + commit_policy: Optional[Union[str, "_models.CommitConfigurationPolicy"]] = None, + devices: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CommitConfigurationResponse(_Model): + """Commit Configuration Response. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the async operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + percent_complete: Optional[float] = rest_field( + name="percentComplete", visibility=["read", "create", "update", "delete", "query"] + ) + """Percent of the operation that is complete.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the operation.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the operation.""" + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operations list.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If present, details of the operation error.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + + @overload + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CommonDynamicMatchConfiguration(_Model): + """Dynamic match configuration object. + + :ivar ip_groups: List of IP Groups. + :vartype ip_groups: list[~azure.mgmt.managednetworkfabric.models.IpGroupProperties] + :ivar vlan_groups: List of vlan groups. + :vartype vlan_groups: list[~azure.mgmt.managednetworkfabric.models.VlanGroupProperties] + :ivar port_groups: List of the port groups. + :vartype port_groups: list[~azure.mgmt.managednetworkfabric.models.PortGroupProperties] + """ + + ip_groups: Optional[list["_models.IpGroupProperties"]] = rest_field( + name="ipGroups", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IP Groups.""" + vlan_groups: Optional[list["_models.VlanGroupProperties"]] = rest_field( + name="vlanGroups", visibility=["read", "create", "update", "delete", "query"] + ) + """List of vlan groups.""" + port_groups: Optional[list["_models.PortGroupProperties"]] = rest_field( + name="portGroups", visibility=["read", "create", "update", "delete", "query"] + ) + """List of the port groups.""" + + @overload + def __init__( + self, + *, + ip_groups: Optional[list["_models.IpGroupProperties"]] = None, + vlan_groups: Optional[list["_models.VlanGroupProperties"]] = None, + port_groups: Optional[list["_models.PortGroupProperties"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CommonDynamicMatchConfigurationPatch(_Model): + """Dynamic match configuration object. + + :ivar ip_groups: List of IP Groups. + :vartype ip_groups: list[~azure.mgmt.managednetworkfabric.models.IpGroupPatchProperties] + :ivar vlan_groups: List of vlan groups. + :vartype vlan_groups: list[~azure.mgmt.managednetworkfabric.models.VlanGroupPatchProperties] + :ivar port_groups: List of the port groups. + :vartype port_groups: list[~azure.mgmt.managednetworkfabric.models.PortGroupPatchProperties] + """ + + ip_groups: Optional[list["_models.IpGroupPatchProperties"]] = rest_field( + name="ipGroups", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IP Groups.""" + vlan_groups: Optional[list["_models.VlanGroupPatchProperties"]] = rest_field( + name="vlanGroups", visibility=["read", "create", "update", "delete", "query"] + ) + """List of vlan groups.""" + port_groups: Optional[list["_models.PortGroupPatchProperties"]] = rest_field( + name="portGroups", visibility=["read", "create", "update", "delete", "query"] + ) + """List of the port groups.""" + + @overload + def __init__( + self, + *, + ip_groups: Optional[list["_models.IpGroupPatchProperties"]] = None, + vlan_groups: Optional[list["_models.VlanGroupPatchProperties"]] = None, + port_groups: Optional[list["_models.PortGroupPatchProperties"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CommonErrorResponse(_Model): + """The error message. + + :ivar error: The error object. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + """ + + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The error object.""" + + @overload + def __init__( + self, + *, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CommonPostActionResponseForDeviceROCommands(_Model): # pylint: disable=name-too-long + """Common response for device Ro Commands. + + :ivar configuration_state: Gets the configuration state. Known values are: "Succeeded", + "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", + "Deprovisioned", "ErrorDeprovisioning", "DeferredControl", "Provisioning", "PendingCommit", and + "PendingAdministrativeUpdate". + :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState + :ivar output_url: Predefined link containing Device RO Command output. + :vartype output_url: str + :ivar device_configuration_preview: Device RO command Response limited to 4000 characters. + :vartype device_configuration_preview: str + """ + + configuration_state: Optional[Union[str, "_models.ConfigurationState"]] = rest_field( + name="configurationState", visibility=["read"] + ) + """Gets the configuration state. Known values are: \"Succeeded\", \"Failed\", \"Rejected\", + \"Accepted\", \"Provisioned\", \"ErrorProvisioning\", \"Deprovisioning\", \"Deprovisioned\", + \"ErrorDeprovisioning\", \"DeferredControl\", \"Provisioning\", \"PendingCommit\", and + \"PendingAdministrativeUpdate\".""" + output_url: Optional[str] = rest_field(name="outputUrl", visibility=["read", "create", "update", "delete", "query"]) + """Predefined link containing Device RO Command output.""" + device_configuration_preview: Optional[str] = rest_field( + name="deviceConfigurationPreview", visibility=["read", "create", "update", "delete", "query"] + ) + """Device RO command Response limited to 4000 characters.""" + + @overload + def __init__( + self, + *, + output_url: Optional[str] = None, + device_configuration_preview: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CommonPostActionResponseForDeviceROCommandsOperationStatusResult( + CommonErrorResponse +): # pylint: disable=name-too-long + """The current status of an async operation. + + :ivar error: The error object. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar properties: The additional properties of the operation status result. + :vartype properties: + ~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceROCommands + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar status: Operation status. Required. + :vartype status: str + """ + + end_time: Optional[datetime.datetime] = rest_field(name="endTime", visibility=["read"], format="rfc3339") + """The end time of the operation.""" + id: Optional[str] = rest_field(visibility=["read"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read"]) + """Name of the async operation.""" + properties: Optional["_models.CommonPostActionResponseForDeviceROCommands"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The additional properties of the operation status result.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + start_time: Optional[datetime.datetime] = rest_field(name="startTime", visibility=["read"], format="rfc3339") + """The start time of the operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + + @overload + def __init__( + self, + *, + status: str, + error: Optional["_models.ErrorDetail"] = None, + properties: Optional["_models.CommonPostActionResponseForDeviceROCommands"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CommonPostActionResponseForDeviceUpdate(CommonErrorResponse): + """Common response for device updates. + + :ivar error: The error object. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar configuration_state: Gets the configuration state. Known values are: "Succeeded", + "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", + "Deprovisioned", "ErrorDeprovisioning", "DeferredControl", "Provisioning", "PendingCommit", and + "PendingAdministrativeUpdate". + :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState + :ivar successful_devices: List of ARM Resource IDs for which the given action applied + successfully. + :vartype successful_devices: list[str] + :ivar failed_devices: List of ARM Resource IDs for which the given action failed to apply. + :vartype failed_devices: list[str] + """ + + configuration_state: Optional[Union[str, "_models.ConfigurationState"]] = rest_field( + name="configurationState", visibility=["read"] + ) + """Gets the configuration state. Known values are: \"Succeeded\", \"Failed\", \"Rejected\", + \"Accepted\", \"Provisioned\", \"ErrorProvisioning\", \"Deprovisioning\", \"Deprovisioned\", + \"ErrorDeprovisioning\", \"DeferredControl\", \"Provisioning\", \"PendingCommit\", and + \"PendingAdministrativeUpdate\".""" + successful_devices: Optional[list[str]] = rest_field( + name="successfulDevices", visibility=["read", "create", "update", "delete", "query"] + ) + """List of ARM Resource IDs for which the given action applied successfully.""" + failed_devices: Optional[list[str]] = rest_field( + name="failedDevices", visibility=["read", "create", "update", "delete", "query"] + ) + """List of ARM Resource IDs for which the given action failed to apply.""" + + @overload + def __init__( + self, + *, + error: Optional["_models.ErrorDetail"] = None, + successful_devices: Optional[list[str]] = None, + failed_devices: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CommonPostActionResponseForStateUpdate(CommonErrorResponse): + """Common response for the state updates. + + :ivar error: The error object. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar configuration_state: Gets the configuration state. Known values are: "Succeeded", + "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", + "Deprovisioned", "ErrorDeprovisioning", "DeferredControl", "Provisioning", "PendingCommit", and + "PendingAdministrativeUpdate". + :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState + """ + + configuration_state: Optional[Union[str, "_models.ConfigurationState"]] = rest_field( + name="configurationState", visibility=["read"] + ) + """Gets the configuration state. Known values are: \"Succeeded\", \"Failed\", \"Rejected\", + \"Accepted\", \"Provisioned\", \"ErrorProvisioning\", \"Deprovisioning\", \"Deprovisioned\", + \"ErrorDeprovisioning\", \"DeferredControl\", \"Provisioning\", \"PendingCommit\", and + \"PendingAdministrativeUpdate\".""" + + @overload + def __init__( + self, + *, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ConditionalDefaultRouteProperties(_Model): + """Conditional Default Route Configuration properties. + + :ivar ipv4_routes: List of IPv4 Routes. + :vartype ipv4_routes: list[~azure.mgmt.managednetworkfabric.models.StaticRouteProperties] + :ivar ipv6_routes: List of IPv6 Routes. + :vartype ipv6_routes: list[~azure.mgmt.managednetworkfabric.models.StaticRouteProperties] + """ + + ipv4_routes: Optional[list["_models.StaticRouteProperties"]] = rest_field( + name="ipv4Routes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IPv4 Routes.""" + ipv6_routes: Optional[list["_models.StaticRouteProperties"]] = rest_field( + name="ipv6Routes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IPv6 Routes.""" + + @overload + def __init__( + self, + *, + ipv4_routes: Optional[list["_models.StaticRouteProperties"]] = None, + ipv6_routes: Optional[list["_models.StaticRouteProperties"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ConnectedSubnet(AnnotationResource): + """Connected Subnet properties. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar prefix: Prefix of the Connected Subnet. Required. + :vartype prefix: str + """ + + prefix: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Prefix of the Connected Subnet. Required.""" + + @overload + def __init__( + self, + *, + prefix: str, + annotation: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ConnectedSubnetPatch(AnnotationResource): + """Connected Subnet properties. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar prefix: Prefix of the Connected Subnet. Required. + :vartype prefix: str + """ + + prefix: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Prefix of the Connected Subnet. Required.""" + + @overload + def __init__( + self, + *, + prefix: str, + annotation: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ConnectedSubnetRoutePolicy(_Model): + """Connected Subnet Route Policy properties. + + :ivar export_route_policy: Array of ARM Resource ID of the RoutePolicies. + :vartype export_route_policy: ~azure.mgmt.managednetworkfabric.models.L3ExportRoutePolicy + """ + + export_route_policy: Optional["_models.L3ExportRoutePolicy"] = rest_field( + name="exportRoutePolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Array of ARM Resource ID of the RoutePolicies.""" + + @overload + def __init__( + self, + *, + export_route_policy: Optional["_models.L3ExportRoutePolicy"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ConnectedSubnetRoutePolicyPatch(_Model): + """Connected Subnet Route Policy properties. + + :ivar export_route_policy: Array of ARM Resource ID of the RoutePolicies. + :vartype export_route_policy: ~azure.mgmt.managednetworkfabric.models.L3ExportRoutePolicyPatch + """ + + export_route_policy: Optional["_models.L3ExportRoutePolicyPatch"] = rest_field( + name="exportRoutePolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Array of ARM Resource ID of the RoutePolicies.""" + + @overload + def __init__( + self, + *, + export_route_policy: Optional["_models.L3ExportRoutePolicyPatch"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ControllerServices(_Model): + """Network Fabric Controller services. + + :ivar ipv4_address_spaces: The IPv4 Address space is optional, if the value is not defined at + the time of NFC creation, then the default value 10.0.0.0/19 is considered. The IPV4 address + subnet is an optional attribute. + :vartype ipv4_address_spaces: list[str] + :ivar ipv6_address_spaces: The IPv6 is not supported right now. + :vartype ipv6_address_spaces: list[str] + """ + + ipv4_address_spaces: Optional[list[str]] = rest_field( + name="ipv4AddressSpaces", visibility=["read", "create", "update", "delete", "query"] + ) + """The IPv4 Address space is optional, if the value is not defined at the time of NFC creation, + then the default value 10.0.0.0/19 is considered. The IPV4 address subnet is an optional + attribute.""" + ipv6_address_spaces: Optional[list[str]] = rest_field( + name="ipv6AddressSpaces", visibility=["read", "create", "update", "delete", "query"] + ) + """The IPv6 is not supported right now.""" + + @overload + def __init__( + self, + *, + ipv4_address_spaces: Optional[list[str]] = None, + ipv6_address_spaces: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ControlPlanAclIpMatchCondition(_Model): + """Control Plane Access Control List (ACL) IP condition properties. + + :ivar source_ip_prefix: List of the source IP addresses that need to be matched. + :vartype source_ip_prefix: str + :ivar destination_ip_prefix: List of the destination IP addresses that need to be matched. + :vartype destination_ip_prefix: str + """ + + source_ip_prefix: Optional[str] = rest_field( + name="sourceIpPrefix", visibility=["read", "create", "update", "delete", "query"] + ) + """List of the source IP addresses that need to be matched.""" + destination_ip_prefix: Optional[str] = rest_field( + name="destinationIpPrefix", visibility=["read", "create", "update", "delete", "query"] + ) + """List of the destination IP addresses that need to be matched.""" + + @overload + def __init__( + self, + *, + source_ip_prefix: Optional[str] = None, + destination_ip_prefix: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ControlPlaneAclAction(_Model): + """Control Plane Access Control List (ACL) Actions. + + :ivar type: Type of actions that can be performed. Known values are: "Permit", "Deny", and + "Remark". + :vartype type: str or ~azure.mgmt.managednetworkfabric.models.ControlPlaneAclActionType + :ivar remark_comment: Remark comment. + :vartype remark_comment: str + """ + + type: Optional[Union[str, "_models.ControlPlaneAclActionType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Type of actions that can be performed. Known values are: \"Permit\", \"Deny\", and \"Remark\".""" + remark_comment: Optional[str] = rest_field( + name="remarkComment", visibility=["read", "create", "update", "delete", "query"] + ) + """Remark comment.""" + + @overload + def __init__( + self, + *, + type: Optional[Union[str, "_models.ControlPlaneAclActionType"]] = None, + remark_comment: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ControlPlaneAclActionPatch(_Model): + """Control Plane Access Control List (ACL) Actions. + + :ivar type: Type of actions that can be performed. Known values are: "Permit", "Deny", and + "Remark". + :vartype type: str or ~azure.mgmt.managednetworkfabric.models.ControlPlaneAclActionType + :ivar remark_comment: Remark comment. + :vartype remark_comment: str + """ + + type: Optional[Union[str, "_models.ControlPlaneAclActionType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Type of actions that can be performed. Known values are: \"Permit\", \"Deny\", and \"Remark\".""" + remark_comment: Optional[str] = rest_field( + name="remarkComment", visibility=["read", "create", "update", "delete", "query"] + ) + """Remark comment.""" + + @overload + def __init__( + self, + *, + type: Optional[Union[str, "_models.ControlPlaneAclActionType"]] = None, + remark_comment: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ControlPlaneAclIpMatchConditionPatch(_Model): + """Control Plane Access Control List (ACL) IP condition patch properties. + + :ivar source_ip_prefix: List of the source IP addresses that need to be matched. + :vartype source_ip_prefix: str + :ivar destination_ip_prefix: List of the destination IP addresses that need to be matched. + :vartype destination_ip_prefix: str + """ + + source_ip_prefix: Optional[str] = rest_field( + name="sourceIpPrefix", visibility=["read", "create", "update", "delete", "query"] + ) + """List of the source IP addresses that need to be matched.""" + destination_ip_prefix: Optional[str] = rest_field( + name="destinationIpPrefix", visibility=["read", "create", "update", "delete", "query"] + ) + """List of the destination IP addresses that need to be matched.""" + + @overload + def __init__( + self, + *, + source_ip_prefix: Optional[str] = None, + destination_ip_prefix: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ControlPlaneAclMatchCondition(_Model): + """Control Plane Access Control List (ACL) match conditions properties. + + :ivar protocol_types: Protocols that need to be matched. + :vartype protocol_types: str + :ivar ip_condition: IP condition that needs to be matched. + :vartype ip_condition: ~azure.mgmt.managednetworkfabric.models.ControlPlanAclIpMatchCondition + :ivar ttl_match_condition: TTL [Time To Live] values that need to be matched. + :vartype ttl_match_condition: + ~azure.mgmt.managednetworkfabric.models.ControlPlaneAclTtlMatchCondition + :ivar port_condition: Port condition that needs to be matched. + :vartype port_condition: + ~azure.mgmt.managednetworkfabric.models.ControlPlaneAclPortMatchCondition + :ivar flags: Flags that need to be matched. Example: established | initial | + . List of eligible TCP Flags are ack, cwr, ece, fin, psh, rst, syn, urg, + established. + :vartype flags: list[str] + :ivar icmp_configuration: Internet Control Message Protocol (ICMP) configuration. + :vartype icmp_configuration: + ~azure.mgmt.managednetworkfabric.models.IcmpConfigurationProperties + """ + + protocol_types: Optional[str] = rest_field( + name="protocolTypes", visibility=["read", "create", "update", "delete", "query"] + ) + """Protocols that need to be matched.""" + ip_condition: Optional["_models.ControlPlanAclIpMatchCondition"] = rest_field( + name="ipCondition", visibility=["read", "create", "update", "delete", "query"] + ) + """IP condition that needs to be matched.""" + ttl_match_condition: Optional["_models.ControlPlaneAclTtlMatchCondition"] = rest_field( + name="ttlMatchCondition", visibility=["read", "create", "update", "delete", "query"] + ) + """TTL [Time To Live] values that need to be matched.""" + port_condition: Optional["_models.ControlPlaneAclPortMatchCondition"] = rest_field( + name="portCondition", visibility=["read", "create", "update", "delete", "query"] + ) + """Port condition that needs to be matched.""" + flags: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Flags that need to be matched. Example: established | initial | . List of + eligible TCP Flags are ack, cwr, ece, fin, psh, rst, syn, urg, established.""" + icmp_configuration: Optional["_models.IcmpConfigurationProperties"] = rest_field( + name="icmpConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Internet Control Message Protocol (ICMP) configuration.""" + + @overload + def __init__( + self, + *, + protocol_types: Optional[str] = None, + ip_condition: Optional["_models.ControlPlanAclIpMatchCondition"] = None, + ttl_match_condition: Optional["_models.ControlPlaneAclTtlMatchCondition"] = None, + port_condition: Optional["_models.ControlPlaneAclPortMatchCondition"] = None, + flags: Optional[list[str]] = None, + icmp_configuration: Optional["_models.IcmpConfigurationProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ControlPlaneAclMatchConditionPatch(_Model): + """Control Plane Access Control List (ACL) match conditions properties. + + :ivar protocol_types: Protocols that need to be matched. + :vartype protocol_types: str + :ivar ip_condition: IP condition that needs to be matched. + :vartype ip_condition: + ~azure.mgmt.managednetworkfabric.models.ControlPlaneAclIpMatchConditionPatch + :ivar ttl_match_condition: TTL [Time To Live] values that need to be matched. + :vartype ttl_match_condition: + ~azure.mgmt.managednetworkfabric.models.ControlPlaneAclTtlMatchConditionPatch + :ivar port_condition: Port condition that needs to be matched. + :vartype port_condition: + ~azure.mgmt.managednetworkfabric.models.ControlPlaneAclPortMatchConditionPatch + :ivar flags: Flags that need to be matched. Example: established | initial | + . List of eligible TCP Flags are ack, cwr, ece, fin, psh, rst, syn, urg, + established. + :vartype flags: list[str] + :ivar icmp_configuration: Internet Control Message Protocol (ICMP) configuration. + :vartype icmp_configuration: + ~azure.mgmt.managednetworkfabric.models.IcmpConfigurationPatchProperties + """ + + protocol_types: Optional[str] = rest_field( + name="protocolTypes", visibility=["read", "create", "update", "delete", "query"] + ) + """Protocols that need to be matched.""" + ip_condition: Optional["_models.ControlPlaneAclIpMatchConditionPatch"] = rest_field( + name="ipCondition", visibility=["read", "create", "update", "delete", "query"] + ) + """IP condition that needs to be matched.""" + ttl_match_condition: Optional["_models.ControlPlaneAclTtlMatchConditionPatch"] = rest_field( + name="ttlMatchCondition", visibility=["read", "create", "update", "delete", "query"] + ) + """TTL [Time To Live] values that need to be matched.""" + port_condition: Optional["_models.ControlPlaneAclPortMatchConditionPatch"] = rest_field( + name="portCondition", visibility=["read", "create", "update", "delete", "query"] + ) + """Port condition that needs to be matched.""" + flags: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Flags that need to be matched. Example: established | initial | . List of + eligible TCP Flags are ack, cwr, ece, fin, psh, rst, syn, urg, established.""" + icmp_configuration: Optional["_models.IcmpConfigurationPatchProperties"] = rest_field( + name="icmpConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Internet Control Message Protocol (ICMP) configuration.""" + + @overload + def __init__( + self, + *, + protocol_types: Optional[str] = None, + ip_condition: Optional["_models.ControlPlaneAclIpMatchConditionPatch"] = None, + ttl_match_condition: Optional["_models.ControlPlaneAclTtlMatchConditionPatch"] = None, + port_condition: Optional["_models.ControlPlaneAclPortMatchConditionPatch"] = None, + flags: Optional[list[str]] = None, + icmp_configuration: Optional["_models.IcmpConfigurationPatchProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ControlPlaneAclMatchConfigurationPatchProperties(_Model): # pylint: disable=name-too-long + """Control Plane Access Control List (ACL) match configurations properties. + + :ivar match_configuration_name: The name of the match configuration. + :vartype match_configuration_name: str + :ivar sequence_number: Sequence Number of the match configuration. + :vartype sequence_number: int + :ivar match_condition: Match conditions. + :vartype match_condition: + ~azure.mgmt.managednetworkfabric.models.ControlPlaneAclMatchConditionPatch + :ivar action: Action that need to be performed for the matched conditions. + :vartype action: ~azure.mgmt.managednetworkfabric.models.ControlPlaneAclActionPatch + """ + + match_configuration_name: Optional[str] = rest_field( + name="matchConfigurationName", visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the match configuration.""" + sequence_number: Optional[int] = rest_field( + name="sequenceNumber", visibility=["read", "create", "update", "delete", "query"] + ) + """Sequence Number of the match configuration.""" + match_condition: Optional["_models.ControlPlaneAclMatchConditionPatch"] = rest_field( + name="matchCondition", visibility=["read", "create", "update", "delete", "query"] + ) + """Match conditions.""" + action: Optional["_models.ControlPlaneAclActionPatch"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Action that need to be performed for the matched conditions.""" + + @overload + def __init__( + self, + *, + match_configuration_name: Optional[str] = None, + sequence_number: Optional[int] = None, + match_condition: Optional["_models.ControlPlaneAclMatchConditionPatch"] = None, + action: Optional["_models.ControlPlaneAclActionPatch"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ControlPlaneAclMatchConfigurationProperties(_Model): # pylint: disable=name-too-long + """Control Plane Access Control List (ACL) match configurations properties. + + :ivar match_configuration_name: The name of the match configuration. + :vartype match_configuration_name: str + :ivar sequence_number: Sequence Number of the match configuration. + :vartype sequence_number: int + :ivar match_condition: Match conditions. + :vartype match_condition: ~azure.mgmt.managednetworkfabric.models.ControlPlaneAclMatchCondition + :ivar action: Action that need to be performed for the matched conditions. + :vartype action: ~azure.mgmt.managednetworkfabric.models.ControlPlaneAclAction + """ + + match_configuration_name: Optional[str] = rest_field( + name="matchConfigurationName", visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the match configuration.""" + sequence_number: Optional[int] = rest_field( + name="sequenceNumber", visibility=["read", "create", "update", "delete", "query"] + ) + """Sequence Number of the match configuration.""" + match_condition: Optional["_models.ControlPlaneAclMatchCondition"] = rest_field( + name="matchCondition", visibility=["read", "create", "update", "delete", "query"] + ) + """Match conditions.""" + action: Optional["_models.ControlPlaneAclAction"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Action that need to be performed for the matched conditions.""" + + @overload + def __init__( + self, + *, + match_configuration_name: Optional[str] = None, + sequence_number: Optional[int] = None, + match_condition: Optional["_models.ControlPlaneAclMatchCondition"] = None, + action: Optional["_models.ControlPlaneAclAction"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ControlPlaneAclPatchProperties(_Model): + """Access Control List (ACL) configurations patch properties. + + :ivar ip_address_type: IP Address Type. IPv4 or IPv6. Known values are: "IPv4" and "IPv6". + :vartype ip_address_type: str or ~azure.mgmt.managednetworkfabric.models.IPAddressType + :ivar match_configurations: Access Control List (ACL) match configurations. + :vartype match_configurations: + list[~azure.mgmt.managednetworkfabric.models.ControlPlaneAclMatchConfigurationPatchProperties] + """ + + ip_address_type: Optional[Union[str, "_models.IPAddressType"]] = rest_field( + name="ipAddressType", visibility=["read", "create", "update", "delete", "query"] + ) + """IP Address Type. IPv4 or IPv6. Known values are: \"IPv4\" and \"IPv6\".""" + match_configurations: Optional[list["_models.ControlPlaneAclMatchConfigurationPatchProperties"]] = rest_field( + name="matchConfigurations", visibility=["read", "create", "update", "delete", "query"] + ) + """Access Control List (ACL) match configurations.""" + + @overload + def __init__( + self, + *, + ip_address_type: Optional[Union[str, "_models.IPAddressType"]] = None, + match_configurations: Optional[list["_models.ControlPlaneAclMatchConfigurationPatchProperties"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ControlPlaneAclPortCondition(_Model): + """Control Plane Access Control List (ACL) Port Match conditions properties. + + :ivar ports: List of the ports that need to be matched. Possible values: 1234, 1234-1235, + 1234,1235,1236. + :vartype ports: list[str] + :ivar port_match_type: Port match type. Example: eq | neq | gt | lt | range. Known values are: + "eq", "neq", "gt", "lt", and "range". + :vartype port_match_type: str or + ~azure.mgmt.managednetworkfabric.models.ControlPlaneAclPortMatchType + """ + + ports: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of the ports that need to be matched. Possible values: 1234, 1234-1235, 1234,1235,1236.""" + port_match_type: Optional[Union[str, "_models.ControlPlaneAclPortMatchType"]] = rest_field( + name="portMatchType", visibility=["read", "create", "update", "delete", "query"] + ) + """Port match type. Example: eq | neq | gt | lt | range. Known values are: \"eq\", \"neq\", + \"gt\", \"lt\", and \"range\".""" + + @overload + def __init__( + self, + *, + ports: Optional[list[str]] = None, + port_match_type: Optional[Union[str, "_models.ControlPlaneAclPortMatchType"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ControlPlaneAclPortMatchCondition(_Model): + """Control Plane Access Control List (ACL) Port Match conditions properties. + + :ivar source_ports: List of the ports that need to be matched. + :vartype source_ports: ~azure.mgmt.managednetworkfabric.models.ControlPlaneAclPortCondition + :ivar destination_ports: List of the destination ports that need to be matched. + :vartype destination_ports: + ~azure.mgmt.managednetworkfabric.models.ControlPlaneAclPortCondition + """ + + source_ports: Optional["_models.ControlPlaneAclPortCondition"] = rest_field( + name="sourcePorts", visibility=["read", "create", "update", "delete", "query"] + ) + """List of the ports that need to be matched.""" + destination_ports: Optional["_models.ControlPlaneAclPortCondition"] = rest_field( + name="destinationPorts", visibility=["read", "create", "update", "delete", "query"] + ) + """List of the destination ports that need to be matched.""" + + @overload + def __init__( + self, + *, + source_ports: Optional["_models.ControlPlaneAclPortCondition"] = None, + destination_ports: Optional["_models.ControlPlaneAclPortCondition"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ControlPlaneAclPortMatchConditionPatch(_Model): + """Control Plane Access Control List (ACL) Port Match conditions properties. + + :ivar source_ports: List of the ports that need to be matched. + :vartype source_ports: ~azure.mgmt.managednetworkfabric.models.ControlPlaneAclPortCondition + :ivar destination_ports: List of the destination ports that need to be matched. + :vartype destination_ports: + ~azure.mgmt.managednetworkfabric.models.ControlPlaneAclPortCondition + """ + + source_ports: Optional["_models.ControlPlaneAclPortCondition"] = rest_field( + name="sourcePorts", visibility=["read", "create", "update", "delete", "query"] + ) + """List of the ports that need to be matched.""" + destination_ports: Optional["_models.ControlPlaneAclPortCondition"] = rest_field( + name="destinationPorts", visibility=["read", "create", "update", "delete", "query"] + ) + """List of the destination ports that need to be matched.""" + + @overload + def __init__( + self, + *, + source_ports: Optional["_models.ControlPlaneAclPortCondition"] = None, + destination_ports: Optional["_models.ControlPlaneAclPortCondition"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ControlPlaneAclProperties(_Model): + """Access Control List (ACL) configurations properties. + + :ivar ip_address_type: IP Address Type. IPv4 or IPv6. Known values are: "IPv4" and "IPv6". + :vartype ip_address_type: str or ~azure.mgmt.managednetworkfabric.models.IPAddressType + :ivar match_configurations: Access Control List (ACL) match configurations. + :vartype match_configurations: + list[~azure.mgmt.managednetworkfabric.models.ControlPlaneAclMatchConfigurationProperties] + """ + + ip_address_type: Optional[Union[str, "_models.IPAddressType"]] = rest_field( + name="ipAddressType", visibility=["read", "create", "update", "delete", "query"] + ) + """IP Address Type. IPv4 or IPv6. Known values are: \"IPv4\" and \"IPv6\".""" + match_configurations: Optional[list["_models.ControlPlaneAclMatchConfigurationProperties"]] = rest_field( + name="matchConfigurations", visibility=["read", "create", "update", "delete", "query"] + ) + """Access Control List (ACL) match configurations.""" + + @overload + def __init__( + self, + *, + ip_address_type: Optional[Union[str, "_models.IPAddressType"]] = None, + match_configurations: Optional[list["_models.ControlPlaneAclMatchConfigurationProperties"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ControlPlaneAclTtlMatchCondition(_Model): + """TTL [Time To Live] match conditions properties. + + :ivar ttl_value: TTL [Time To Live] values that need to be matched. + :vartype ttl_value: str + :ivar ttl_match_type: TTL [Time To Live] match type. Example: eq | neq | gt | lt | range. Known + values are: "eq", "neq", "gt", and "lt". + :vartype ttl_match_type: str or + ~azure.mgmt.managednetworkfabric.models.ControlPlaneAclTtlMatchType + """ + + ttl_value: Optional[str] = rest_field(name="ttlValue", visibility=["read", "create", "update", "delete", "query"]) + """TTL [Time To Live] values that need to be matched.""" + ttl_match_type: Optional[Union[str, "_models.ControlPlaneAclTtlMatchType"]] = rest_field( + name="ttlMatchType", visibility=["read", "create", "update", "delete", "query"] + ) + """TTL [Time To Live] match type. Example: eq | neq | gt | lt | range. Known values are: \"eq\", + \"neq\", \"gt\", and \"lt\".""" + + @overload + def __init__( + self, + *, + ttl_value: Optional[str] = None, + ttl_match_type: Optional[Union[str, "_models.ControlPlaneAclTtlMatchType"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ControlPlaneAclTtlMatchConditionPatch(_Model): + """TTL [Time To Live] match conditions patch properties. + + :ivar ttl_value: TTL [Time To Live] values that need to be matched. + :vartype ttl_value: str + :ivar ttl_match_type: TTL [Time To Live] match type. Example: eq | neq | gt | lt | range. Known + values are: "eq", "neq", "gt", and "lt". + :vartype ttl_match_type: str or + ~azure.mgmt.managednetworkfabric.models.ControlPlaneAclTtlMatchType + """ + + ttl_value: Optional[str] = rest_field(name="ttlValue", visibility=["read", "create", "update", "delete", "query"]) + """TTL [Time To Live] values that need to be matched.""" + ttl_match_type: Optional[Union[str, "_models.ControlPlaneAclTtlMatchType"]] = rest_field( + name="ttlMatchType", visibility=["read", "create", "update", "delete", "query"] + ) + """TTL [Time To Live] match type. Example: eq | neq | gt | lt | range. Known values are: \"eq\", + \"neq\", \"gt\", and \"lt\".""" + + @overload + def __init__( + self, + *, + ttl_value: Optional[str] = None, + ttl_match_type: Optional[Union[str, "_models.ControlPlaneAclTtlMatchType"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DestinationPatchProperties(_Model): + """The network tap destination properties. + + :ivar name: Destination name. + :vartype name: str + :ivar destination_type: Type of destination. Input can be IsolationDomain or Direct. Known + values are: "IsolationDomain" and "Direct". + :vartype destination_type: str or ~azure.mgmt.managednetworkfabric.models.DestinationType + :ivar destination_id: The destination Id. ARM Resource ID of either NNI or Internal Networks. + :vartype destination_id: str + :ivar isolation_domain_properties: Isolation Domain Properties. + :vartype isolation_domain_properties: + ~azure.mgmt.managednetworkfabric.models.IsolationDomainPatchProperties + :ivar destination_tap_rule_id: ARM Resource ID of destination Tap Rule that contains match + configurations. + :vartype destination_tap_rule_id: str + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Destination name.""" + destination_type: Optional[Union[str, "_models.DestinationType"]] = rest_field( + name="destinationType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of destination. Input can be IsolationDomain or Direct. Known values are: + \"IsolationDomain\" and \"Direct\".""" + destination_id: Optional[str] = rest_field( + name="destinationId", visibility=["read", "create", "update", "delete", "query"] + ) + """The destination Id. ARM Resource ID of either NNI or Internal Networks.""" + isolation_domain_properties: Optional["_models.IsolationDomainPatchProperties"] = rest_field( + name="isolationDomainProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """Isolation Domain Properties.""" + destination_tap_rule_id: Optional[str] = rest_field( + name="destinationTapRuleId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM Resource ID of destination Tap Rule that contains match configurations.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + destination_type: Optional[Union[str, "_models.DestinationType"]] = None, + destination_id: Optional[str] = None, + isolation_domain_properties: Optional["_models.IsolationDomainPatchProperties"] = None, + destination_tap_rule_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DestinationProperties(_Model): + """The network tap destination properties. + + :ivar name: Destination name. Required. + :vartype name: str + :ivar destination_type: Type of destination. Input can be IsolationDomain or Direct. Required. + Known values are: "IsolationDomain" and "Direct". + :vartype destination_type: str or ~azure.mgmt.managednetworkfabric.models.DestinationType + :ivar destination_id: The destination Id. ARM Resource ID of either NNI or Internal Networks. + Required. + :vartype destination_id: str + :ivar isolation_domain_properties: Isolation Domain Properties. + :vartype isolation_domain_properties: + ~azure.mgmt.managednetworkfabric.models.IsolationDomainProperties + :ivar destination_tap_rule_id: ARM Resource ID of destination Tap Rule that contains match + configurations. + :vartype destination_tap_rule_id: str + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Destination name. Required.""" + destination_type: Union[str, "_models.DestinationType"] = rest_field( + name="destinationType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of destination. Input can be IsolationDomain or Direct. Required. Known values are: + \"IsolationDomain\" and \"Direct\".""" + destination_id: str = rest_field(name="destinationId", visibility=["read", "create", "update", "delete", "query"]) + """The destination Id. ARM Resource ID of either NNI or Internal Networks. Required.""" + isolation_domain_properties: Optional["_models.IsolationDomainProperties"] = rest_field( + name="isolationDomainProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """Isolation Domain Properties.""" + destination_tap_rule_id: Optional[str] = rest_field( + name="destinationTapRuleId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM Resource ID of destination Tap Rule that contains match configurations.""" + + @overload + def __init__( + self, + *, + name: str, + destination_type: Union[str, "_models.DestinationType"], + destination_id: str, + isolation_domain_properties: Optional["_models.IsolationDomainProperties"] = None, + destination_tap_rule_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DeviceInterfaceProperties(_Model): + """Network device interface properties. + + :ivar identifier: Interface identifier. Example: HundredGigE0/0. + :vartype identifier: str + :ivar interface_type: Interface type. + :vartype interface_type: str + :ivar supported_connector_types: List of supported connector types. + :vartype supported_connector_types: + list[~azure.mgmt.managednetworkfabric.models.SupportedConnectorProperties] + """ + + identifier: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Interface identifier. Example: HundredGigE0/0.""" + interface_type: Optional[str] = rest_field( + name="interfaceType", visibility=["read", "create", "update", "delete", "query"] + ) + """Interface type.""" + supported_connector_types: Optional[list["_models.SupportedConnectorProperties"]] = rest_field( + name="supportedConnectorTypes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of supported connector types.""" + + @overload + def __init__( + self, + *, + identifier: Optional[str] = None, + interface_type: Optional[str] = None, + supported_connector_types: Optional[list["_models.SupportedConnectorProperties"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DeviceRoCommand(_Model): + """Provide the RO command. + + :ivar command: Specify the command. + :vartype command: str + """ + + command: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Specify the command.""" + + @overload + def __init__( + self, + *, + command: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DeviceRwCommand(_Model): + """Provide the Rw command. + + :ivar command: Specify the command. + :vartype command: str + :ivar command_url: Specify the commands file URL. + :vartype command_url: str + """ + + command: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Specify the command.""" + command_url: Optional[str] = rest_field( + name="commandUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """Specify the commands file URL.""" + + @overload + def __init__( + self, + *, + command: Optional[str] = None, + command_url: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DiscardCommitBatchOperationResponse(_Model): + """Discard Commit Batch Response. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + :ivar properties: Discard commit batch response properties. + :vartype properties: + ~azure.mgmt.managednetworkfabric.models.DiscardCommitBatchResponseProperties + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the async operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + percent_complete: Optional[float] = rest_field( + name="percentComplete", visibility=["read", "create", "update", "delete", "query"] + ) + """Percent of the operation that is complete.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the operation.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the operation.""" + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operations list.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If present, details of the operation error.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + properties: Optional["_models.DiscardCommitBatchResponseProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Discard commit batch response properties.""" + + @overload + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + properties: Optional["_models.DiscardCommitBatchResponseProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DiscardCommitBatchRequest(_Model): + """Discard Commit Batch Request. + + :ivar commit_batch_id: Commit Batch Identifier. If not provided, the latest commit batch status + will be returned. + :vartype commit_batch_id: str + """ + + commit_batch_id: Optional[str] = rest_field( + name="commitBatchId", visibility=["read", "create", "update", "delete", "query"] + ) + """Commit Batch Identifier. If not provided, the latest commit batch status will be returned.""" + + @overload + def __init__( + self, + *, + commit_batch_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DiscardCommitBatchResponseProperties(_Model): + """Discard Commit Batch Response Properties. + + :ivar commit_batch_id: Commit Batch Identifier. + :vartype commit_batch_id: str + """ + + commit_batch_id: Optional[str] = rest_field( + name="commitBatchId", visibility=["read", "create", "update", "delete", "query"] + ) + """Commit Batch Identifier.""" + + @overload + def __init__( + self, + *, + commit_batch_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class EnableDisableOnResources(_Model): + """Update administrative state on list of resources. + + :ivar resource_ids: Network Fabrics or Network Rack resource Id. + :vartype resource_ids: list[str] + """ + + resource_ids: Optional[list[str]] = rest_field( + name="resourceIds", visibility=["read", "create", "update", "delete", "query"] + ) + """Network Fabrics or Network Rack resource Id.""" + + @overload + def __init__( + self, + *, + resource_ids: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ErrorAdditionalInfo(_Model): + """The resource management error additional info. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: any + """ + + type: Optional[str] = rest_field(visibility=["read"]) + """The additional info type.""" + info: Optional[Any] = rest_field(visibility=["read"]) + """The additional info.""" + + +class ErrorDetail(_Model): + """The error detail. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.managednetworkfabric.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.managednetworkfabric.models.ErrorAdditionalInfo] + """ + + code: Optional[str] = rest_field(visibility=["read"]) + """The error code.""" + message: Optional[str] = rest_field(visibility=["read"]) + """The error message.""" + target: Optional[str] = rest_field(visibility=["read"]) + """The error target.""" + details: Optional[list["_models.ErrorDetail"]] = rest_field(visibility=["read"]) + """The error details.""" + additional_info: Optional[list["_models.ErrorAdditionalInfo"]] = rest_field( + name="additionalInfo", visibility=["read"] + ) + """The error additional info.""" + + +class ErrorResponse(_Model): + """Error response. + + :ivar error: The error object. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + """ + + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The error object.""" + + @overload + def __init__( + self, + *, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExportRoutePolicy(_Model): + """Export Route Policy either IPv4 or IPv6. + + :ivar export_ipv4_route_policy_id: ARM resource ID of RoutePolicy. + :vartype export_ipv4_route_policy_id: str + :ivar export_ipv6_route_policy_id: ARM resource ID of RoutePolicy. + :vartype export_ipv6_route_policy_id: str + """ + + export_ipv4_route_policy_id: Optional[str] = rest_field( + name="exportIpv4RoutePolicyId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM resource ID of RoutePolicy.""" + export_ipv6_route_policy_id: Optional[str] = rest_field( + name="exportIpv6RoutePolicyId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM resource ID of RoutePolicy.""" + + @overload + def __init__( + self, + *, + export_ipv4_route_policy_id: Optional[str] = None, + export_ipv6_route_policy_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExportRoutePolicyInformation(_Model): + """Export Route Policy Configuration. + + :ivar export_ipv4_route_policy_id: Export IPv4 Route Policy Id. + :vartype export_ipv4_route_policy_id: str + :ivar export_ipv6_route_policy_id: Export IPv6 Route Policy Id. + :vartype export_ipv6_route_policy_id: str + """ + + export_ipv4_route_policy_id: Optional[str] = rest_field( + name="exportIpv4RoutePolicyId", visibility=["read", "create", "update", "delete", "query"] + ) + """Export IPv4 Route Policy Id.""" + export_ipv6_route_policy_id: Optional[str] = rest_field( + name="exportIpv6RoutePolicyId", visibility=["read", "create", "update", "delete", "query"] + ) + """Export IPv6 Route Policy Id.""" + + @overload + def __init__( + self, + *, + export_ipv4_route_policy_id: Optional[str] = None, + export_ipv6_route_policy_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExportRoutePolicyInformationPatch(_Model): + """Export Route Policy Configuration. + + :ivar export_ipv4_route_policy_id: Export IPv4 Route Policy Id. + :vartype export_ipv4_route_policy_id: str + :ivar export_ipv6_route_policy_id: Export IPv6 Route Policy Id. + :vartype export_ipv6_route_policy_id: str + """ + + export_ipv4_route_policy_id: Optional[str] = rest_field( + name="exportIpv4RoutePolicyId", visibility=["read", "create", "update", "delete", "query"] + ) + """Export IPv4 Route Policy Id.""" + export_ipv6_route_policy_id: Optional[str] = rest_field( + name="exportIpv6RoutePolicyId", visibility=["read", "create", "update", "delete", "query"] + ) + """Export IPv6 Route Policy Id.""" + + @overload + def __init__( + self, + *, + export_ipv4_route_policy_id: Optional[str] = None, + export_ipv6_route_policy_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExportRoutePolicyPatch(_Model): + """Export Route Policy either IPv4 or IPv6. + + :ivar export_ipv4_route_policy_id: ARM resource ID of RoutePolicy. + :vartype export_ipv4_route_policy_id: str + :ivar export_ipv6_route_policy_id: ARM resource ID of RoutePolicy. + :vartype export_ipv6_route_policy_id: str + """ + + export_ipv4_route_policy_id: Optional[str] = rest_field( + name="exportIpv4RoutePolicyId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM resource ID of RoutePolicy.""" + export_ipv6_route_policy_id: Optional[str] = rest_field( + name="exportIpv6RoutePolicyId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM resource ID of RoutePolicy.""" + + @overload + def __init__( + self, + *, + export_ipv4_route_policy_id: Optional[str] = None, + export_ipv6_route_policy_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExpressRouteConnectionInformation(_Model): + """The ExpressRoute circuit ID and the Auth Key are required for you to successfully deploy NFC + service. + + :ivar express_route_circuit_id: The express route circuit Azure resource ID, must be of type + Microsoft.Network/expressRouteCircuits/circuitName. The ExpressRoute Circuit is a mandatory + attribute. Required. + :vartype express_route_circuit_id: str + :ivar express_route_authorization_key: Authorization key for the circuit, must be of type + Microsoft.Network/expressRouteCircuits/authorizations. The Auth Key is a mandatory attribute. + Required. + :vartype express_route_authorization_key: str + """ + + express_route_circuit_id: str = rest_field( + name="expressRouteCircuitId", visibility=["read", "create", "update", "delete", "query"] + ) + """The express route circuit Azure resource ID, must be of type + Microsoft.Network/expressRouteCircuits/circuitName. The ExpressRoute Circuit is a mandatory + attribute. Required.""" + express_route_authorization_key: str = rest_field( + name="expressRouteAuthorizationKey", visibility=["read", "create", "update", "delete", "query"] + ) + """Authorization key for the circuit, must be of type + Microsoft.Network/expressRouteCircuits/authorizations. The Auth Key is a mandatory attribute. + Required.""" + + @overload + def __init__( + self, + *, + express_route_circuit_id: str, + express_route_authorization_key: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ProxyResource(Resource): + """Proxy Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + """ + + +class ExternalNetwork(ProxyResource): + """Defines the External Network resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + :ivar properties: External Network Properties. Required. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.ExternalNetworkProperties + """ + + properties: "_models.ExternalNetworkProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """External Network Properties. Required.""" + + __flattened_items = [ + "annotation", + "network_to_network_interconnect_id", + "import_route_policy", + "export_route_policy", + "peering_option", + "option_b_properties", + "option_a_properties", + "static_route_configuration", + "last_operation", + "network_fabric_id", + "configuration_state", + "provisioning_state", + "administrative_state", + ] + + @overload + def __init__( + self, + *, + properties: "_models.ExternalNetworkProperties", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ExternalNetworkBmpPatchProperties(_Model): + """BMP Monitoring Configuration patch properties. + + :ivar configuration_state: BMP Configuration State. Known values are: "Enabled" and "Disabled". + :vartype configuration_state: str or + ~azure.mgmt.managednetworkfabric.models.BmpConfigurationState + """ + + configuration_state: Optional[Union[str, "_models.BmpConfigurationState"]] = rest_field( + name="configurationState", visibility=["read", "create", "update", "delete", "query"] + ) + """BMP Configuration State. Known values are: \"Enabled\" and \"Disabled\".""" + + @overload + def __init__( + self, + *, + configuration_state: Optional[Union[str, "_models.BmpConfigurationState"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExternalNetworkBmpProperties(_Model): + """BGP Monitoring Protocol (BMP) Configuration properties. + + :ivar configuration_state: BMP Configuration State. Known values are: "Enabled" and "Disabled". + :vartype configuration_state: str or + ~azure.mgmt.managednetworkfabric.models.BmpConfigurationState + """ + + configuration_state: Optional[Union[str, "_models.BmpConfigurationState"]] = rest_field( + name="configurationState", visibility=["read", "create", "update", "delete", "query"] + ) + """BMP Configuration State. Known values are: \"Enabled\" and \"Disabled\".""" + + @overload + def __init__( + self, + *, + configuration_state: Optional[Union[str, "_models.BmpConfigurationState"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExternalNetworkPatch(_Model): + """The ExternalNetwork patch resource definition. + + :ivar properties: External Network Patch properties. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.ExternalNetworkPatchProperties + """ + + properties: Optional["_models.ExternalNetworkPatchProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """External Network Patch properties.""" + + __flattened_items = [ + "annotation", + "network_to_network_interconnect_id", + "import_route_policy", + "export_route_policy", + "peering_option", + "option_b_properties", + "option_a_properties", + "static_route_configuration", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ExternalNetworkPatchProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ExternalNetworkPatchProperties(_Model): + """External Network Patch properties. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar network_to_network_interconnect_id: ARM Resource ID of the networkToNetworkInterconnectId + of the ExternalNetwork resource. + :vartype network_to_network_interconnect_id: str + :ivar import_route_policy: Import Route Policy either IPv4 or IPv6. + :vartype import_route_policy: ~azure.mgmt.managednetworkfabric.models.ImportRoutePolicyPatch + :ivar export_route_policy: Export Route Policy either IPv4 or IPv6. + :vartype export_route_policy: ~azure.mgmt.managednetworkfabric.models.ExportRoutePolicyPatch + :ivar peering_option: Peering option list. Known values are: "OptionA" and "OptionB". + :vartype peering_option: str or ~azure.mgmt.managednetworkfabric.models.PeeringOption + :ivar option_b_properties: option B properties object. + :vartype option_b_properties: ~azure.mgmt.managednetworkfabric.models.L3OptionBPatchProperties + :ivar option_a_properties: option A properties object. + :vartype option_a_properties: + ~azure.mgmt.managednetworkfabric.models.ExternalNetworkPatchPropertiesOptionAProperties + :ivar static_route_configuration: Static Route Configuration. + :vartype static_route_configuration: + ~azure.mgmt.managednetworkfabric.models.ExternalNetworkStaticRoutePatchConfiguration + """ + + annotation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Switch configuration description.""" + network_to_network_interconnect_id: Optional[str] = rest_field( + name="networkToNetworkInterconnectId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM Resource ID of the networkToNetworkInterconnectId of the ExternalNetwork resource.""" + import_route_policy: Optional["_models.ImportRoutePolicyPatch"] = rest_field( + name="importRoutePolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Import Route Policy either IPv4 or IPv6.""" + export_route_policy: Optional["_models.ExportRoutePolicyPatch"] = rest_field( + name="exportRoutePolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Export Route Policy either IPv4 or IPv6.""" + peering_option: Optional[Union[str, "_models.PeeringOption"]] = rest_field( + name="peeringOption", visibility=["read", "create", "update", "delete", "query"] + ) + """Peering option list. Known values are: \"OptionA\" and \"OptionB\".""" + option_b_properties: Optional["_models.L3OptionBPatchProperties"] = rest_field( + name="optionBProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """option B properties object.""" + option_a_properties: Optional["_models.ExternalNetworkPatchPropertiesOptionAProperties"] = rest_field( + name="optionAProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """option A properties object.""" + static_route_configuration: Optional["_models.ExternalNetworkStaticRoutePatchConfiguration"] = rest_field( + name="staticRouteConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Static Route Configuration.""" + + @overload + def __init__( + self, + *, + annotation: Optional[str] = None, + network_to_network_interconnect_id: Optional[str] = None, + import_route_policy: Optional["_models.ImportRoutePolicyPatch"] = None, + export_route_policy: Optional["_models.ExportRoutePolicyPatch"] = None, + peering_option: Optional[Union[str, "_models.PeeringOption"]] = None, + option_b_properties: Optional["_models.L3OptionBPatchProperties"] = None, + option_a_properties: Optional["_models.ExternalNetworkPatchPropertiesOptionAProperties"] = None, + static_route_configuration: Optional["_models.ExternalNetworkStaticRoutePatchConfiguration"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExternalNetworkPatchPropertiesOptionAProperties(_Model): # pylint: disable=name-too-long + """option A properties object. + + :ivar primary_ipv4_prefix: IPv4 Address Prefix. + :vartype primary_ipv4_prefix: str + :ivar primary_ipv6_prefix: IPv6 Address Prefix. + :vartype primary_ipv6_prefix: str + :ivar secondary_ipv4_prefix: Secondary IPv4 Address Prefix. + :vartype secondary_ipv4_prefix: str + :ivar secondary_ipv6_prefix: Secondary IPv6 Address Prefix. + :vartype secondary_ipv6_prefix: str + :ivar mtu: MTU to use for option A peering. + :vartype mtu: int + :ivar vlan_id: Vlan identifier. Example : 501. + :vartype vlan_id: int + :ivar fabric_asn: Fabric ASN number. Example 65001. + :vartype fabric_asn: int + :ivar peer_asn: Peer ASN number.Example : 28. + :vartype peer_asn: int + :ivar bfd_configuration: BFD configuration properties. + :vartype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdPatchConfiguration + :ivar ingress_acl_id: Ingress Acl. ARM resource ID of Access Control Lists. + :vartype ingress_acl_id: str + :ivar egress_acl_id: Egress Acl. ARM resource ID of Access Control Lists. + :vartype egress_acl_id: str + :ivar bmp_configuration: BMP Monitor Configuration. + :vartype bmp_configuration: + ~azure.mgmt.managednetworkfabric.models.ExternalNetworkBmpPatchProperties + :ivar v4_over_v6_bgp_session: V4OverV6 BGP Session state. Known values are: "Enabled" and + "Disabled". + :vartype v4_over_v6_bgp_session: str or + ~azure.mgmt.managednetworkfabric.models.V4OverV6BgpSessionState + :ivar v6_over_v4_bgp_session: V6OverV4 BGP Session state. Known values are: "Enabled" and + "Disabled". + :vartype v6_over_v4_bgp_session: str or + ~azure.mgmt.managednetworkfabric.models.V6OverV4BgpSessionState + :ivar native_ipv4_prefix_limit: Native IPv4 prefix limit configuration. + :vartype native_ipv4_prefix_limit: + ~azure.mgmt.managednetworkfabric.models.NativeIpv4PrefixLimitPatchProperties + :ivar native_ipv6_prefix_limit: Native IPv6 prefix limit configuration. + :vartype native_ipv6_prefix_limit: + ~azure.mgmt.managednetworkfabric.models.NativeIpv6PrefixLimitPatchProperties + """ + + primary_ipv4_prefix: Optional[str] = rest_field( + name="primaryIpv4Prefix", visibility=["read", "create", "update", "delete", "query"] + ) + """IPv4 Address Prefix.""" + primary_ipv6_prefix: Optional[str] = rest_field( + name="primaryIpv6Prefix", visibility=["read", "create", "update", "delete", "query"] + ) + """IPv6 Address Prefix.""" + secondary_ipv4_prefix: Optional[str] = rest_field( + name="secondaryIpv4Prefix", visibility=["read", "create", "update", "delete", "query"] + ) + """Secondary IPv4 Address Prefix.""" + secondary_ipv6_prefix: Optional[str] = rest_field( + name="secondaryIpv6Prefix", visibility=["read", "create", "update", "delete", "query"] + ) + """Secondary IPv6 Address Prefix.""" + mtu: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """MTU to use for option A peering.""" + vlan_id: Optional[int] = rest_field(name="vlanId", visibility=["read", "create", "update", "delete", "query"]) + """Vlan identifier. Example : 501.""" + fabric_asn: Optional[int] = rest_field(name="fabricASN", visibility=["read"]) + """Fabric ASN number. Example 65001.""" + peer_asn: Optional[int] = rest_field(name="peerASN", visibility=["read", "create", "update", "delete", "query"]) + """Peer ASN number.Example : 28.""" + bfd_configuration: Optional["_models.BfdPatchConfiguration"] = rest_field( + name="bfdConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """BFD configuration properties.""" + ingress_acl_id: Optional[str] = rest_field( + name="ingressAclId", visibility=["read", "create", "update", "delete", "query"] + ) + """Ingress Acl. ARM resource ID of Access Control Lists.""" + egress_acl_id: Optional[str] = rest_field( + name="egressAclId", visibility=["read", "create", "update", "delete", "query"] + ) + """Egress Acl. ARM resource ID of Access Control Lists.""" + bmp_configuration: Optional["_models.ExternalNetworkBmpPatchProperties"] = rest_field( + name="bmpConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """BMP Monitor Configuration.""" + v4_over_v6_bgp_session: Optional[Union[str, "_models.V4OverV6BgpSessionState"]] = rest_field( + name="v4OverV6BgpSession", visibility=["read", "create", "update", "delete", "query"] + ) + """V4OverV6 BGP Session state. Known values are: \"Enabled\" and \"Disabled\".""" + v6_over_v4_bgp_session: Optional[Union[str, "_models.V6OverV4BgpSessionState"]] = rest_field( + name="v6OverV4BgpSession", visibility=["read", "create", "update", "delete", "query"] + ) + """V6OverV4 BGP Session state. Known values are: \"Enabled\" and \"Disabled\".""" + native_ipv4_prefix_limit: Optional["_models.NativeIpv4PrefixLimitPatchProperties"] = rest_field( + name="nativeIpv4PrefixLimit", visibility=["read", "create", "update", "delete", "query"] + ) + """Native IPv4 prefix limit configuration.""" + native_ipv6_prefix_limit: Optional["_models.NativeIpv6PrefixLimitPatchProperties"] = rest_field( + name="nativeIpv6PrefixLimit", visibility=["read", "create", "update", "delete", "query"] + ) + """Native IPv6 prefix limit configuration.""" + + @overload + def __init__( + self, + *, + primary_ipv4_prefix: Optional[str] = None, + primary_ipv6_prefix: Optional[str] = None, + secondary_ipv4_prefix: Optional[str] = None, + secondary_ipv6_prefix: Optional[str] = None, + mtu: Optional[int] = None, + vlan_id: Optional[int] = None, + peer_asn: Optional[int] = None, + bfd_configuration: Optional["_models.BfdPatchConfiguration"] = None, + ingress_acl_id: Optional[str] = None, + egress_acl_id: Optional[str] = None, + bmp_configuration: Optional["_models.ExternalNetworkBmpPatchProperties"] = None, + v4_over_v6_bgp_session: Optional[Union[str, "_models.V4OverV6BgpSessionState"]] = None, + v6_over_v4_bgp_session: Optional[Union[str, "_models.V6OverV4BgpSessionState"]] = None, + native_ipv4_prefix_limit: Optional["_models.NativeIpv4PrefixLimitPatchProperties"] = None, + native_ipv6_prefix_limit: Optional["_models.NativeIpv6PrefixLimitPatchProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExternalNetworkProperties(_Model): + """External Network Properties. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar network_to_network_interconnect_id: ARM Resource ID of the networkToNetworkInterconnectId + of the ExternalNetwork resource. + :vartype network_to_network_interconnect_id: str + :ivar import_route_policy: Import Route Policy either IPv4 or IPv6. + :vartype import_route_policy: ~azure.mgmt.managednetworkfabric.models.ImportRoutePolicy + :ivar export_route_policy: Export Route Policy either IPv4 or IPv6. + :vartype export_route_policy: ~azure.mgmt.managednetworkfabric.models.ExportRoutePolicy + :ivar peering_option: Peering option list. Required. Known values are: "OptionA" and "OptionB". + :vartype peering_option: str or ~azure.mgmt.managednetworkfabric.models.PeeringOption + :ivar option_b_properties: option B properties object. + :vartype option_b_properties: ~azure.mgmt.managednetworkfabric.models.L3OptionBProperties + :ivar option_a_properties: option A properties object. + :vartype option_a_properties: + ~azure.mgmt.managednetworkfabric.models.ExternalNetworkPropertiesOptionAProperties + :ivar static_route_configuration: Static Route Configuration. + :vartype static_route_configuration: + ~azure.mgmt.managednetworkfabric.models.ExternalNetworkStaticRouteConfiguration + :ivar last_operation: Details of the last operation performed on the resource. + :vartype last_operation: ~azure.mgmt.managednetworkfabric.models.LastOperationProperties + :ivar network_fabric_id: Associated Network Fabric Resource ID. + :vartype network_fabric_id: str + :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", + "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", + "Deprovisioned", "ErrorDeprovisioning", "DeferredControl", "Provisioning", "PendingCommit", and + "PendingAdministrativeUpdate". + :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState + :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", + "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState + :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", + "Disabled", "MAT", "RMA", "UnderMaintenance", and "EnabledDegraded". + :vartype administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.AdministrativeState + """ + + annotation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Switch configuration description.""" + network_to_network_interconnect_id: Optional[str] = rest_field( + name="networkToNetworkInterconnectId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM Resource ID of the networkToNetworkInterconnectId of the ExternalNetwork resource.""" + import_route_policy: Optional["_models.ImportRoutePolicy"] = rest_field( + name="importRoutePolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Import Route Policy either IPv4 or IPv6.""" + export_route_policy: Optional["_models.ExportRoutePolicy"] = rest_field( + name="exportRoutePolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Export Route Policy either IPv4 or IPv6.""" + peering_option: Union[str, "_models.PeeringOption"] = rest_field( + name="peeringOption", visibility=["read", "create", "update", "delete", "query"] + ) + """Peering option list. Required. Known values are: \"OptionA\" and \"OptionB\".""" + option_b_properties: Optional["_models.L3OptionBProperties"] = rest_field( + name="optionBProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """option B properties object.""" + option_a_properties: Optional["_models.ExternalNetworkPropertiesOptionAProperties"] = rest_field( + name="optionAProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """option A properties object.""" + static_route_configuration: Optional["_models.ExternalNetworkStaticRouteConfiguration"] = rest_field( + name="staticRouteConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Static Route Configuration.""" + last_operation: Optional["_models.LastOperationProperties"] = rest_field(name="lastOperation", visibility=["read"]) + """Details of the last operation performed on the resource.""" + network_fabric_id: Optional[str] = rest_field(name="networkFabricId", visibility=["read"]) + """Associated Network Fabric Resource ID.""" + configuration_state: Optional[Union[str, "_models.ConfigurationState"]] = rest_field( + name="configurationState", visibility=["read"] + ) + """Configuration state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Rejected\", + \"Accepted\", \"Provisioned\", \"ErrorProvisioning\", \"Deprovisioning\", \"Deprovisioned\", + \"ErrorDeprovisioning\", \"DeferredControl\", \"Provisioning\", \"PendingCommit\", and + \"PendingAdministrativeUpdate\".""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the resource. Known values are: \"Accepted\", \"Succeeded\", + \"Updating\", \"Deleting\", \"Failed\", and \"Canceled\".""" + administrative_state: Optional[Union[str, "_models.AdministrativeState"]] = rest_field( + name="administrativeState", visibility=["read"] + ) + """Administrative state of the resource. Known values are: \"Enabled\", \"Disabled\", \"MAT\", + \"RMA\", \"UnderMaintenance\", and \"EnabledDegraded\".""" + + @overload + def __init__( + self, + *, + peering_option: Union[str, "_models.PeeringOption"], + annotation: Optional[str] = None, + network_to_network_interconnect_id: Optional[str] = None, + import_route_policy: Optional["_models.ImportRoutePolicy"] = None, + export_route_policy: Optional["_models.ExportRoutePolicy"] = None, + option_b_properties: Optional["_models.L3OptionBProperties"] = None, + option_a_properties: Optional["_models.ExternalNetworkPropertiesOptionAProperties"] = None, + static_route_configuration: Optional["_models.ExternalNetworkStaticRouteConfiguration"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExternalNetworkPropertiesOptionAProperties(_Model): # pylint: disable=name-too-long + """option A properties object. + + :ivar primary_ipv4_prefix: IPv4 Address Prefix. + :vartype primary_ipv4_prefix: str + :ivar primary_ipv6_prefix: IPv6 Address Prefix. + :vartype primary_ipv6_prefix: str + :ivar secondary_ipv4_prefix: Secondary IPv4 Address Prefix. + :vartype secondary_ipv4_prefix: str + :ivar secondary_ipv6_prefix: Secondary IPv6 Address Prefix. + :vartype secondary_ipv6_prefix: str + :ivar mtu: MTU to use for option A peering. + :vartype mtu: int + :ivar vlan_id: Vlan identifier. Example : 501. Required. + :vartype vlan_id: int + :ivar fabric_asn: Fabric ASN number. Example 65001. + :vartype fabric_asn: int + :ivar peer_asn: Peer ASN number.Example : 28. Required. + :vartype peer_asn: int + :ivar bfd_configuration: BFD configuration properties. + :vartype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdConfiguration + :ivar ingress_acl_id: Ingress Acl. ARM resource ID of Access Control Lists. + :vartype ingress_acl_id: str + :ivar bmp_configuration: BMP Monitor Configuration. + :vartype bmp_configuration: + ~azure.mgmt.managednetworkfabric.models.ExternalNetworkBmpProperties + :ivar egress_acl_id: Egress Acl. ARM resource ID of Access Control Lists. + :vartype egress_acl_id: str + :ivar v4_over_v6_bgp_session: V4OverV6 BGP Session state. Known values are: "Enabled" and + "Disabled". + :vartype v4_over_v6_bgp_session: str or + ~azure.mgmt.managednetworkfabric.models.V4OverV6BgpSessionState + :ivar v6_over_v4_bgp_session: V6OverV4 BGP Session state. Known values are: "Enabled" and + "Disabled". + :vartype v6_over_v4_bgp_session: str or + ~azure.mgmt.managednetworkfabric.models.V6OverV4BgpSessionState + :ivar native_ipv4_prefix_limit: Native IPv4 prefix limits configuration. + :vartype native_ipv4_prefix_limit: + ~azure.mgmt.managednetworkfabric.models.NativeIpv4PrefixLimitProperties + :ivar native_ipv6_prefix_limit: Native IPv6 prefix limits configuration. + :vartype native_ipv6_prefix_limit: + ~azure.mgmt.managednetworkfabric.models.NativeIpv6PrefixLimitProperties + """ + + primary_ipv4_prefix: Optional[str] = rest_field( + name="primaryIpv4Prefix", visibility=["read", "create", "update", "delete", "query"] + ) + """IPv4 Address Prefix.""" + primary_ipv6_prefix: Optional[str] = rest_field( + name="primaryIpv6Prefix", visibility=["read", "create", "update", "delete", "query"] + ) + """IPv6 Address Prefix.""" + secondary_ipv4_prefix: Optional[str] = rest_field( + name="secondaryIpv4Prefix", visibility=["read", "create", "update", "delete", "query"] + ) + """Secondary IPv4 Address Prefix.""" + secondary_ipv6_prefix: Optional[str] = rest_field( + name="secondaryIpv6Prefix", visibility=["read", "create", "update", "delete", "query"] + ) + """Secondary IPv6 Address Prefix.""" + mtu: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """MTU to use for option A peering.""" + vlan_id: int = rest_field(name="vlanId", visibility=["read", "create", "update", "delete", "query"]) + """Vlan identifier. Example : 501. Required.""" + fabric_asn: Optional[int] = rest_field(name="fabricASN", visibility=["read"]) + """Fabric ASN number. Example 65001.""" + peer_asn: int = rest_field(name="peerASN", visibility=["read", "create", "update", "delete", "query"]) + """Peer ASN number.Example : 28. Required.""" + bfd_configuration: Optional["_models.BfdConfiguration"] = rest_field( + name="bfdConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """BFD configuration properties.""" + ingress_acl_id: Optional[str] = rest_field( + name="ingressAclId", visibility=["read", "create", "update", "delete", "query"] + ) + """Ingress Acl. ARM resource ID of Access Control Lists.""" + bmp_configuration: Optional["_models.ExternalNetworkBmpProperties"] = rest_field( + name="bmpConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """BMP Monitor Configuration.""" + egress_acl_id: Optional[str] = rest_field( + name="egressAclId", visibility=["read", "create", "update", "delete", "query"] + ) + """Egress Acl. ARM resource ID of Access Control Lists.""" + v4_over_v6_bgp_session: Optional[Union[str, "_models.V4OverV6BgpSessionState"]] = rest_field( + name="v4OverV6BgpSession", visibility=["read", "create", "update", "delete", "query"] + ) + """V4OverV6 BGP Session state. Known values are: \"Enabled\" and \"Disabled\".""" + v6_over_v4_bgp_session: Optional[Union[str, "_models.V6OverV4BgpSessionState"]] = rest_field( + name="v6OverV4BgpSession", visibility=["read", "create", "update", "delete", "query"] + ) + """V6OverV4 BGP Session state. Known values are: \"Enabled\" and \"Disabled\".""" + native_ipv4_prefix_limit: Optional["_models.NativeIpv4PrefixLimitProperties"] = rest_field( + name="nativeIpv4PrefixLimit", visibility=["read", "create", "update", "delete", "query"] + ) + """Native IPv4 prefix limits configuration.""" + native_ipv6_prefix_limit: Optional["_models.NativeIpv6PrefixLimitProperties"] = rest_field( + name="nativeIpv6PrefixLimit", visibility=["read", "create", "update", "delete", "query"] + ) + """Native IPv6 prefix limits configuration.""" + + @overload + def __init__( + self, + *, + vlan_id: int, + peer_asn: int, + primary_ipv4_prefix: Optional[str] = None, + primary_ipv6_prefix: Optional[str] = None, + secondary_ipv4_prefix: Optional[str] = None, + secondary_ipv6_prefix: Optional[str] = None, + mtu: Optional[int] = None, + bfd_configuration: Optional["_models.BfdConfiguration"] = None, + ingress_acl_id: Optional[str] = None, + bmp_configuration: Optional["_models.ExternalNetworkBmpProperties"] = None, + egress_acl_id: Optional[str] = None, + v4_over_v6_bgp_session: Optional[Union[str, "_models.V4OverV6BgpSessionState"]] = None, + v6_over_v4_bgp_session: Optional[Union[str, "_models.V6OverV4BgpSessionState"]] = None, + native_ipv4_prefix_limit: Optional["_models.NativeIpv4PrefixLimitProperties"] = None, + native_ipv6_prefix_limit: Optional["_models.NativeIpv6PrefixLimitProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExternalNetworkStaticRouteConfiguration(_Model): + """Static Route Configuration properties for ExternalNetwork. + + :ivar bfd_configuration: BFD configuration properties. + :vartype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdConfiguration + :ivar ipv4_routes: List of IPv4 Routes. + :vartype ipv4_routes: list[~azure.mgmt.managednetworkfabric.models.StaticRouteProperties] + :ivar ipv6_routes: List of IPv6 Routes. + :vartype ipv6_routes: list[~azure.mgmt.managednetworkfabric.models.StaticRouteProperties] + """ + + bfd_configuration: Optional["_models.BfdConfiguration"] = rest_field( + name="bfdConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """BFD configuration properties.""" + ipv4_routes: Optional[list["_models.StaticRouteProperties"]] = rest_field( + name="ipv4Routes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IPv4 Routes.""" + ipv6_routes: Optional[list["_models.StaticRouteProperties"]] = rest_field( + name="ipv6Routes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IPv6 Routes.""" + + @overload + def __init__( + self, + *, + bfd_configuration: Optional["_models.BfdConfiguration"] = None, + ipv4_routes: Optional[list["_models.StaticRouteProperties"]] = None, + ipv6_routes: Optional[list["_models.StaticRouteProperties"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExternalNetworkStaticRoutePatchConfiguration(_Model): # pylint: disable=name-too-long + """Static Route Configuration properties for External Network. + + :ivar bfd_configuration: BFD configuration properties. + :vartype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdPatchConfiguration + :ivar ipv4_routes: List of IPv4 Routes. + :vartype ipv4_routes: list[~azure.mgmt.managednetworkfabric.models.StaticRoutePatchProperties] + :ivar ipv6_routes: List of IPv6 Routes. + :vartype ipv6_routes: list[~azure.mgmt.managednetworkfabric.models.StaticRoutePatchProperties] + """ + + bfd_configuration: Optional["_models.BfdPatchConfiguration"] = rest_field( + name="bfdConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """BFD configuration properties.""" + ipv4_routes: Optional[list["_models.StaticRoutePatchProperties"]] = rest_field( + name="ipv4Routes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IPv4 Routes.""" + ipv6_routes: Optional[list["_models.StaticRoutePatchProperties"]] = rest_field( + name="ipv6Routes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IPv6 Routes.""" + + @overload + def __init__( + self, + *, + bfd_configuration: Optional["_models.BfdPatchConfiguration"] = None, + ipv4_routes: Optional[list["_models.StaticRoutePatchProperties"]] = None, + ipv6_routes: Optional[list["_models.StaticRoutePatchProperties"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExternalNetworkUpdateBfdAdministrativeStateRequest(_Model): # pylint: disable=name-too-long + """External Network Update Administrative State request. + + :ivar route_type: Route Type that helps to know which bfd we are updating. Known values are: + "Static" and "OptionA". + :vartype route_type: str or ~azure.mgmt.managednetworkfabric.models.ExternalNetworkRouteType + :ivar administrative_state: Administrative state. Known values are: "Enabled", "Disabled", + "MAT", and "RMA". + :vartype administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.BfdAdministrativeState + """ + + route_type: Optional[Union[str, "_models.ExternalNetworkRouteType"]] = rest_field( + name="routeType", visibility=["read", "create", "update", "delete", "query"] + ) + """Route Type that helps to know which bfd we are updating. Known values are: \"Static\" and + \"OptionA\".""" + administrative_state: Optional[Union[str, "_models.BfdAdministrativeState"]] = rest_field( + name="administrativeState", visibility=["read", "create", "update", "delete", "query"] + ) + """Administrative state. Known values are: \"Enabled\", \"Disabled\", \"MAT\", and \"RMA\".""" + + @overload + def __init__( + self, + *, + route_type: Optional[Union[str, "_models.ExternalNetworkRouteType"]] = None, + administrative_state: Optional[Union[str, "_models.BfdAdministrativeState"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExternalNetworkUpdateBfdAdministrativeStateResponse(_Model): # pylint: disable=name-too-long + """External Network Update Administrative State response. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + :ivar properties: Response properties. + :vartype properties: + ~azure.mgmt.managednetworkfabric.models.ExternalNetworkUpdateBfdAdministrativeStateResponseProperties + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the async operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + percent_complete: Optional[float] = rest_field( + name="percentComplete", visibility=["read", "create", "update", "delete", "query"] + ) + """Percent of the operation that is complete.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the operation.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the operation.""" + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operations list.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If present, details of the operation error.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + properties: Optional["_models.ExternalNetworkUpdateBfdAdministrativeStateResponseProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Response properties.""" + + @overload + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + properties: Optional["_models.ExternalNetworkUpdateBfdAdministrativeStateResponseProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExternalNetworkUpdateBfdAdministrativeStateResponseProperties(_Model): # pylint: disable=name-too-long + """Response properties for External Network BFD Administrative State. + + :ivar route_type: Route Type that helps to know which bfd we are updating. Known values are: + "Static" and "OptionA". + :vartype route_type: str or ~azure.mgmt.managednetworkfabric.models.ExternalNetworkRouteType + :ivar administrative_state: Administrative state. Known values are: "Enabled", "Disabled", + "MAT", and "RMA". + :vartype administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.BfdAdministrativeState + """ + + route_type: Optional[Union[str, "_models.ExternalNetworkRouteType"]] = rest_field( + name="routeType", visibility=["read", "create", "update", "delete", "query"] + ) + """Route Type that helps to know which bfd we are updating. Known values are: \"Static\" and + \"OptionA\".""" + administrative_state: Optional[Union[str, "_models.BfdAdministrativeState"]] = rest_field( + name="administrativeState", visibility=["read", "create", "update", "delete", "query"] + ) + """Administrative state. Known values are: \"Enabled\", \"Disabled\", \"MAT\", and \"RMA\".""" + + @overload + def __init__( + self, + *, + route_type: Optional[Union[str, "_models.ExternalNetworkRouteType"]] = None, + administrative_state: Optional[Union[str, "_models.BfdAdministrativeState"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class FabricLockProperties(_Model): + """Network Fabric Lock Configuration. + + :ivar lock_state: NetworkFabric Lock State. Known values are: "Enabled" and "Disabled". + :vartype lock_state: str or ~azure.mgmt.managednetworkfabric.models.LockConfigurationState + :ivar lock_type: NetworkFabric Lock Type. Known values are: "Administrative" and + "Configuration". + :vartype lock_type: str or ~azure.mgmt.managednetworkfabric.models.NetworkFabricLockType + """ + + lock_state: Optional[Union[str, "_models.LockConfigurationState"]] = rest_field( + name="lockState", visibility=["read", "create", "update", "delete", "query"] + ) + """NetworkFabric Lock State. Known values are: \"Enabled\" and \"Disabled\".""" + lock_type: Optional[Union[str, "_models.NetworkFabricLockType"]] = rest_field( + name="lockType", visibility=["read", "create", "update", "delete", "query"] + ) + """NetworkFabric Lock Type. Known values are: \"Administrative\" and \"Configuration\".""" + + @overload + def __init__( + self, + *, + lock_state: Optional[Union[str, "_models.LockConfigurationState"]] = None, + lock_type: Optional[Union[str, "_models.NetworkFabricLockType"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class FeatureFlagProperties(_Model): + """Feature flag properties. + + :ivar feature_flag_name: Feature flag name. + :vartype feature_flag_name: str + :ivar feature_flag_value: Feature flag value. + :vartype feature_flag_value: str + """ + + feature_flag_name: Optional[str] = rest_field( + name="featureFlagName", visibility=["read", "create", "update", "delete", "query"] + ) + """Feature flag name.""" + feature_flag_value: Optional[str] = rest_field( + name="featureFlagValue", visibility=["read", "create", "update", "delete", "query"] + ) + """Feature flag value.""" + + @overload + def __init__( + self, + *, + feature_flag_name: Optional[str] = None, + feature_flag_value: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class GetTopologyResponse(_Model): + """GetTopology Response. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + :ivar properties: Properties of the GetTopology Response. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.GetTopologyResponseProperties + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the async operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + percent_complete: Optional[float] = rest_field( + name="percentComplete", visibility=["read", "create", "update", "delete", "query"] + ) + """Percent of the operation that is complete.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the operation.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the operation.""" + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operations list.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If present, details of the operation error.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + properties: Optional["_models.GetTopologyResponseProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Properties of the GetTopology Response.""" + + @overload + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + properties: Optional["_models.GetTopologyResponseProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class GetTopologyResponseProperties(_Model): + """Properties of the GetTopology Response. + + :ivar url: Topology JSON string. + :vartype url: str + """ + + url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Topology JSON string.""" + + @overload + def __init__( + self, + *, + url: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class GlobalAccessControlListActionPatchProperties(_Model): # pylint: disable=name-too-long + """Global Access Control List actions patch properties. + + :ivar enable_count: Configuration to enable or disable ACL action count. Known values are: + "True" and "False". + :vartype enable_count: str or ~azure.mgmt.managednetworkfabric.models.BooleanEnumProperty + """ + + enable_count: Optional[Union[str, "_models.BooleanEnumProperty"]] = rest_field( + name="enableCount", visibility=["read", "create", "update", "delete", "query"] + ) + """Configuration to enable or disable ACL action count. Known values are: \"True\" and \"False\".""" + + @overload + def __init__( + self, + *, + enable_count: Optional[Union[str, "_models.BooleanEnumProperty"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class GlobalAccessControlListActionProperties(_Model): + """Global Access Control List actions properties. + + :ivar enable_count: Configuration to enable or disable ACL action count. Known values are: + "True" and "False". + :vartype enable_count: str or ~azure.mgmt.managednetworkfabric.models.BooleanEnumProperty + """ + + enable_count: Optional[Union[str, "_models.BooleanEnumProperty"]] = rest_field( + name="enableCount", visibility=["read", "create", "update", "delete", "query"] + ) + """Configuration to enable or disable ACL action count. Known values are: \"True\" and \"False\".""" + + @overload + def __init__( + self, + *, + enable_count: Optional[Union[str, "_models.BooleanEnumProperty"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class GlobalNetworkTapRuleActionPatchProperties(_Model): # pylint: disable=name-too-long + """Global network tap rule actions patch properties. + + :ivar enable_count: Configuration to enable network tap rule counter. Known values are: "True" + and "False". + :vartype enable_count: str or ~azure.mgmt.managednetworkfabric.models.BooleanEnumProperty + :ivar truncate: Truncate. 0 indicates do not truncate. + :vartype truncate: str + """ + + enable_count: Optional[Union[str, "_models.BooleanEnumProperty"]] = rest_field( + name="enableCount", visibility=["read", "create", "update", "delete", "query"] + ) + """Configuration to enable network tap rule counter. Known values are: \"True\" and \"False\".""" + truncate: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Truncate. 0 indicates do not truncate.""" + + @overload + def __init__( + self, + *, + enable_count: Optional[Union[str, "_models.BooleanEnumProperty"]] = None, + truncate: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class GlobalNetworkTapRuleActionProperties(_Model): + """Global network tap rule actions properties. + + :ivar enable_count: Configuration to enable network tap rule counter. Known values are: "True" + and "False". + :vartype enable_count: str or ~azure.mgmt.managednetworkfabric.models.BooleanEnumProperty + :ivar truncate: Truncate. 0 indicates do not truncate. + :vartype truncate: str + """ + + enable_count: Optional[Union[str, "_models.BooleanEnumProperty"]] = rest_field( + name="enableCount", visibility=["read", "create", "update", "delete", "query"] + ) + """Configuration to enable network tap rule counter. Known values are: \"True\" and \"False\".""" + truncate: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Truncate. 0 indicates do not truncate.""" + + @overload + def __init__( + self, + *, + enable_count: Optional[Union[str, "_models.BooleanEnumProperty"]] = None, + truncate: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class HeaderAddressProperties(_Model): + """Header name and source addresses associated with the header. + + :ivar header_name: Name of the header. + :vartype header_name: str + :ivar address_list: List of source remote IP to be allowed or denied. + :vartype address_list: list[str] + """ + + header_name: Optional[str] = rest_field( + name="headerName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the header.""" + address_list: Optional[list[str]] = rest_field( + name="addressList", visibility=["read", "create", "update", "delete", "query"] + ) + """List of source remote IP to be allowed or denied.""" + + @overload + def __init__( + self, + *, + header_name: Optional[str] = None, + address_list: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IcmpConfigurationPatchProperties(_Model): + """Internet Control Message Protocol (ICMP) configuration patch properties. + + :ivar icmp_types: Internet Control Message Protocol (ICMP) types. + :vartype icmp_types: list[str] + """ + + icmp_types: Optional[list[str]] = rest_field( + name="icmpTypes", visibility=["read", "create", "update", "delete", "query"] + ) + """Internet Control Message Protocol (ICMP) types.""" + + @overload + def __init__( + self, + *, + icmp_types: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IcmpConfigurationProperties(_Model): + """Internet Control Message Protocol (ICMP) configuration. + + :ivar icmp_types: Internet Control Message Protocol (ICMP) types. + :vartype icmp_types: list[str] + """ + + icmp_types: Optional[list[str]] = rest_field( + name="icmpTypes", visibility=["read", "create", "update", "delete", "query"] + ) + """Internet Control Message Protocol (ICMP) types.""" + + @overload + def __init__( + self, + *, + icmp_types: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IdentitySelector(_Model): + """IdentitySelector represents the selection of a managed identity for use. + + :ivar identity_type: The type of managed identity that is being selected. Required. Known + values are: "SystemAssignedIdentity" and "UserAssignedIdentity". + :vartype identity_type: str or + ~azure.mgmt.managednetworkfabric.models.ManagedServiceIdentitySelectorType + :ivar user_assigned_identity_resource_id: The user assigned managed identity resource ID to + use. Mutually exclusive with a system assigned identity type. + :vartype user_assigned_identity_resource_id: str + """ + + identity_type: Union[str, "_models.ManagedServiceIdentitySelectorType"] = rest_field( + name="identityType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of managed identity that is being selected. Required. Known values are: + \"SystemAssignedIdentity\" and \"UserAssignedIdentity\".""" + user_assigned_identity_resource_id: Optional[str] = rest_field( + name="userAssignedIdentityResourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """The user assigned managed identity resource ID to use. Mutually exclusive with a system + assigned identity type.""" + + @overload + def __init__( + self, + *, + identity_type: Union[str, "_models.ManagedServiceIdentitySelectorType"], + user_assigned_identity_resource_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IdentitySelectorPatch(_Model): + """IdentitySelector represents the selection of a managed identity for use. + + :ivar identity_type: The type of managed identity that is being selected. Known values are: + "SystemAssignedIdentity" and "UserAssignedIdentity". + :vartype identity_type: str or + ~azure.mgmt.managednetworkfabric.models.ManagedServiceIdentitySelectorType + :ivar user_assigned_identity_resource_id: The user assigned managed identity resource ID to + use. Mutually exclusive with a system assigned identity type. + :vartype user_assigned_identity_resource_id: str + """ + + identity_type: Optional[Union[str, "_models.ManagedServiceIdentitySelectorType"]] = rest_field( + name="identityType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of managed identity that is being selected. Known values are: + \"SystemAssignedIdentity\" and \"UserAssignedIdentity\".""" + user_assigned_identity_resource_id: Optional[str] = rest_field( + name="userAssignedIdentityResourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """The user assigned managed identity resource ID to use. Mutually exclusive with a system + assigned identity type.""" + + @overload + def __init__( + self, + *, + identity_type: Optional[Union[str, "_models.ManagedServiceIdentitySelectorType"]] = None, + user_assigned_identity_resource_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ImportRoutePolicy(_Model): + """Import Route Policy either IPv4 or IPv6. + + :ivar import_ipv4_route_policy_id: ARM resource ID of RoutePolicy. + :vartype import_ipv4_route_policy_id: str + :ivar import_ipv6_route_policy_id: ARM resource ID of RoutePolicy. + :vartype import_ipv6_route_policy_id: str + """ + + import_ipv4_route_policy_id: Optional[str] = rest_field( + name="importIpv4RoutePolicyId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM resource ID of RoutePolicy.""" + import_ipv6_route_policy_id: Optional[str] = rest_field( + name="importIpv6RoutePolicyId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM resource ID of RoutePolicy.""" + + @overload + def __init__( + self, + *, + import_ipv4_route_policy_id: Optional[str] = None, + import_ipv6_route_policy_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ImportRoutePolicyInformation(_Model): + """Import Route Policy Configuration. + + :ivar import_ipv4_route_policy_id: Import IPv4 Route Policy Id. + :vartype import_ipv4_route_policy_id: str + :ivar import_ipv6_route_policy_id: Import IPv6 Route Policy Id. + :vartype import_ipv6_route_policy_id: str + """ + + import_ipv4_route_policy_id: Optional[str] = rest_field( + name="importIpv4RoutePolicyId", visibility=["read", "create", "update", "delete", "query"] + ) + """Import IPv4 Route Policy Id.""" + import_ipv6_route_policy_id: Optional[str] = rest_field( + name="importIpv6RoutePolicyId", visibility=["read", "create", "update", "delete", "query"] + ) + """Import IPv6 Route Policy Id.""" + + @overload + def __init__( + self, + *, + import_ipv4_route_policy_id: Optional[str] = None, + import_ipv6_route_policy_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ImportRoutePolicyInformationPatch(_Model): + """Import Route Policy Configuration. + + :ivar import_ipv4_route_policy_id: Import IPv4 Route Policy Id. + :vartype import_ipv4_route_policy_id: str + :ivar import_ipv6_route_policy_id: Import IPv6 Route Policy Id. + :vartype import_ipv6_route_policy_id: str + """ + + import_ipv4_route_policy_id: Optional[str] = rest_field( + name="importIpv4RoutePolicyId", visibility=["read", "create", "update", "delete", "query"] + ) + """Import IPv4 Route Policy Id.""" + import_ipv6_route_policy_id: Optional[str] = rest_field( + name="importIpv6RoutePolicyId", visibility=["read", "create", "update", "delete", "query"] + ) + """Import IPv6 Route Policy Id.""" + + @overload + def __init__( + self, + *, + import_ipv4_route_policy_id: Optional[str] = None, + import_ipv6_route_policy_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ImportRoutePolicyPatch(_Model): + """Import Route Policy either IPv4 or IPv6. + + :ivar import_ipv4_route_policy_id: ARM resource ID of RoutePolicy. + :vartype import_ipv4_route_policy_id: str + :ivar import_ipv6_route_policy_id: ARM resource ID of RoutePolicy. + :vartype import_ipv6_route_policy_id: str + """ + + import_ipv4_route_policy_id: Optional[str] = rest_field( + name="importIpv4RoutePolicyId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM resource ID of RoutePolicy.""" + import_ipv6_route_policy_id: Optional[str] = rest_field( + name="importIpv6RoutePolicyId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM resource ID of RoutePolicy.""" + + @overload + def __init__( + self, + *, + import_ipv4_route_policy_id: Optional[str] = None, + import_ipv6_route_policy_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class InternalNetwork(ProxyResource): + """Defines the Internal Network resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + :ivar properties: The Internal Network Properties. Required. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.InternalNetworkProperties + """ + + properties: "_models.InternalNetworkProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The Internal Network Properties. Required.""" + + __flattened_items = [ + "annotation", + "extension", + "mtu", + "connected_i_pv4_subnets", + "connected_i_pv6_subnets", + "import_route_policy", + "export_route_policy", + "ingress_acl_id", + "egress_acl_id", + "is_monitoring_enabled", + "vlan_id", + "bgp_configuration", + "static_route_configuration", + "native_ipv4_prefix_limit", + "native_ipv6_prefix_limit", + "last_operation", + "network_fabric_id", + "configuration_state", + "provisioning_state", + "administrative_state", + ] + + @overload + def __init__( + self, + *, + properties: "_models.InternalNetworkProperties", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class InternalNetworkBmpPatchProperties(_Model): + """Internal Network BMP Configuration. + + :ivar neighbor_ip_exclusions: Neighbor IP Address exclusions for BMP. + :vartype neighbor_ip_exclusions: list[str] + :ivar bmp_configuration_state: BMP Monitoring configuration state. Known values are: "Enabled" + and "Disabled". + :vartype bmp_configuration_state: str or + ~azure.mgmt.managednetworkfabric.models.BmpConfigurationState + """ + + neighbor_ip_exclusions: Optional[list[str]] = rest_field( + name="neighborIpExclusions", visibility=["read", "create", "update", "delete", "query"] + ) + """Neighbor IP Address exclusions for BMP.""" + bmp_configuration_state: Optional[Union[str, "_models.BmpConfigurationState"]] = rest_field( + name="bmpConfigurationState", visibility=["read", "create", "update", "delete", "query"] + ) + """BMP Monitoring configuration state. Known values are: \"Enabled\" and \"Disabled\".""" + + @overload + def __init__( + self, + *, + neighbor_ip_exclusions: Optional[list[str]] = None, + bmp_configuration_state: Optional[Union[str, "_models.BmpConfigurationState"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class InternalNetworkBmpProperties(_Model): + """Internal Network BMP Configuration. + + :ivar neighbor_ip_exclusions: BMP Collector Address. + :vartype neighbor_ip_exclusions: list[str] + :ivar bmp_configuration_state: BMP Monitoring configuration state. Known values are: "Enabled" + and "Disabled". + :vartype bmp_configuration_state: str or + ~azure.mgmt.managednetworkfabric.models.BmpConfigurationState + :ivar export_policy_configuration: BMP Export Policy configuration. + :vartype export_policy_configuration: + ~azure.mgmt.managednetworkfabric.models.BmpExportPolicyProperties + """ + + neighbor_ip_exclusions: Optional[list[str]] = rest_field( + name="neighborIpExclusions", visibility=["read", "create", "update", "delete", "query"] + ) + """BMP Collector Address.""" + bmp_configuration_state: Optional[Union[str, "_models.BmpConfigurationState"]] = rest_field( + name="bmpConfigurationState", visibility=["read", "create", "update", "delete", "query"] + ) + """BMP Monitoring configuration state. Known values are: \"Enabled\" and \"Disabled\".""" + export_policy_configuration: Optional["_models.BmpExportPolicyProperties"] = rest_field( + name="exportPolicyConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """BMP Export Policy configuration.""" + + @overload + def __init__( + self, + *, + neighbor_ip_exclusions: Optional[list[str]] = None, + bmp_configuration_state: Optional[Union[str, "_models.BmpConfigurationState"]] = None, + export_policy_configuration: Optional["_models.BmpExportPolicyProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class InternalNetworkPatch(_Model): + """The InternalNetwork patch resource definition. + + :ivar properties: InternalNetwork Patch properties. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.InternalNetworkPatchProperties + """ + + properties: Optional["_models.InternalNetworkPatchProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """InternalNetwork Patch properties.""" + + __flattened_items = [ + "annotation", + "mtu", + "connected_i_pv4_subnets", + "connected_i_pv6_subnets", + "import_route_policy", + "export_route_policy", + "ingress_acl_id", + "egress_acl_id", + "is_monitoring_enabled", + "bgp_configuration", + "static_route_configuration", + "native_ipv4_prefix_limit", + "native_ipv6_prefix_limit", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.InternalNetworkPatchProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class InternalNetworkPatchProperties(_Model): + """InternalNetwork Patch properties. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar mtu: Maximum transmission unit. Default value is 1500. + :vartype mtu: int + :ivar connected_i_pv4_subnets: List of Connected IPv4 Subnets. + :vartype connected_i_pv4_subnets: + list[~azure.mgmt.managednetworkfabric.models.ConnectedSubnetPatch] + :ivar connected_i_pv6_subnets: List of connected IPv6 Subnets. + :vartype connected_i_pv6_subnets: + list[~azure.mgmt.managednetworkfabric.models.ConnectedSubnetPatch] + :ivar import_route_policy: Import Route Policy either IPv4 or IPv6. + :vartype import_route_policy: ~azure.mgmt.managednetworkfabric.models.ImportRoutePolicy + :ivar export_route_policy: Export Route Policy either IPv4 or IPv6. + :vartype export_route_policy: ~azure.mgmt.managednetworkfabric.models.ExportRoutePolicy + :ivar ingress_acl_id: Ingress Acl. ARM resource ID of Access Control Lists. + :vartype ingress_acl_id: str + :ivar egress_acl_id: Egress Acl. ARM resource ID of Access Control Lists. + :vartype egress_acl_id: str + :ivar is_monitoring_enabled: To check whether monitoring of internal network is enabled or not. + Known values are: "True" and "False". + :vartype is_monitoring_enabled: str or + ~azure.mgmt.managednetworkfabric.models.IsMonitoringEnabled + :ivar bgp_configuration: BGP configuration properties. + :vartype bgp_configuration: ~azure.mgmt.managednetworkfabric.models.BgpPatchConfiguration + :ivar static_route_configuration: Static Route Configuration properties. + :vartype static_route_configuration: + ~azure.mgmt.managednetworkfabric.models.StaticRoutePatchConfiguration + :ivar native_ipv4_prefix_limit: Native IPv4 Prefix Limit Configuration properties. + :vartype native_ipv4_prefix_limit: + ~azure.mgmt.managednetworkfabric.models.NativeIpv4PrefixLimitPatchProperties + :ivar native_ipv6_prefix_limit: Native IPv6 Prefix Limit Configuration properties. + :vartype native_ipv6_prefix_limit: + ~azure.mgmt.managednetworkfabric.models.NativeIpv6PrefixLimitPatchProperties + """ + + annotation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Switch configuration description.""" + mtu: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum transmission unit. Default value is 1500.""" + connected_i_pv4_subnets: Optional[list["_models.ConnectedSubnetPatch"]] = rest_field( + name="connectedIPv4Subnets", visibility=["read", "create", "update", "delete", "query"] + ) + """List of Connected IPv4 Subnets.""" + connected_i_pv6_subnets: Optional[list["_models.ConnectedSubnetPatch"]] = rest_field( + name="connectedIPv6Subnets", visibility=["read", "create", "update", "delete", "query"] + ) + """List of connected IPv6 Subnets.""" + import_route_policy: Optional["_models.ImportRoutePolicy"] = rest_field( + name="importRoutePolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Import Route Policy either IPv4 or IPv6.""" + export_route_policy: Optional["_models.ExportRoutePolicy"] = rest_field( + name="exportRoutePolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Export Route Policy either IPv4 or IPv6.""" + ingress_acl_id: Optional[str] = rest_field( + name="ingressAclId", visibility=["read", "create", "update", "delete", "query"] + ) + """Ingress Acl. ARM resource ID of Access Control Lists.""" + egress_acl_id: Optional[str] = rest_field( + name="egressAclId", visibility=["read", "create", "update", "delete", "query"] + ) + """Egress Acl. ARM resource ID of Access Control Lists.""" + is_monitoring_enabled: Optional[Union[str, "_models.IsMonitoringEnabled"]] = rest_field( + name="isMonitoringEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """To check whether monitoring of internal network is enabled or not. Known values are: \"True\" + and \"False\".""" + bgp_configuration: Optional["_models.BgpPatchConfiguration"] = rest_field( + name="bgpConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """BGP configuration properties.""" + static_route_configuration: Optional["_models.StaticRoutePatchConfiguration"] = rest_field( + name="staticRouteConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Static Route Configuration properties.""" + native_ipv4_prefix_limit: Optional["_models.NativeIpv4PrefixLimitPatchProperties"] = rest_field( + name="nativeIpv4PrefixLimit", visibility=["read", "create", "update", "delete", "query"] + ) + """Native IPv4 Prefix Limit Configuration properties.""" + native_ipv6_prefix_limit: Optional["_models.NativeIpv6PrefixLimitPatchProperties"] = rest_field( + name="nativeIpv6PrefixLimit", visibility=["read", "create", "update", "delete", "query"] + ) + """Native IPv6 Prefix Limit Configuration properties.""" + + @overload + def __init__( + self, + *, + annotation: Optional[str] = None, + mtu: Optional[int] = None, + connected_i_pv4_subnets: Optional[list["_models.ConnectedSubnetPatch"]] = None, + connected_i_pv6_subnets: Optional[list["_models.ConnectedSubnetPatch"]] = None, + import_route_policy: Optional["_models.ImportRoutePolicy"] = None, + export_route_policy: Optional["_models.ExportRoutePolicy"] = None, + ingress_acl_id: Optional[str] = None, + egress_acl_id: Optional[str] = None, + is_monitoring_enabled: Optional[Union[str, "_models.IsMonitoringEnabled"]] = None, + bgp_configuration: Optional["_models.BgpPatchConfiguration"] = None, + static_route_configuration: Optional["_models.StaticRoutePatchConfiguration"] = None, + native_ipv4_prefix_limit: Optional["_models.NativeIpv4PrefixLimitPatchProperties"] = None, + native_ipv6_prefix_limit: Optional["_models.NativeIpv6PrefixLimitPatchProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class InternalNetworkProperties(_Model): + """Internal Network Properties defines the properties of the resource. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar extension: Extension. Example: NoExtension | NPB. Known values are: "NoExtension" and + "NPB". + :vartype extension: str or ~azure.mgmt.managednetworkfabric.models.Extension + :ivar mtu: Maximum transmission unit. Default value is 1500. + :vartype mtu: int + :ivar connected_i_pv4_subnets: List of Connected IPv4 Subnets. + :vartype connected_i_pv4_subnets: list[~azure.mgmt.managednetworkfabric.models.ConnectedSubnet] + :ivar connected_i_pv6_subnets: List of connected IPv6 Subnets. + :vartype connected_i_pv6_subnets: list[~azure.mgmt.managednetworkfabric.models.ConnectedSubnet] + :ivar import_route_policy: Import Route Policy either IPv4 or IPv6. + :vartype import_route_policy: ~azure.mgmt.managednetworkfabric.models.ImportRoutePolicy + :ivar export_route_policy: Export Route Policy either IPv4 or IPv6. + :vartype export_route_policy: ~azure.mgmt.managednetworkfabric.models.ExportRoutePolicy + :ivar ingress_acl_id: Ingress Acl. ARM resource ID of Access Control Lists. + :vartype ingress_acl_id: str + :ivar egress_acl_id: Egress Acl. ARM resource ID of Access Control Lists. + :vartype egress_acl_id: str + :ivar is_monitoring_enabled: To check whether monitoring of internal network is enabled or not. + Known values are: "True" and "False". + :vartype is_monitoring_enabled: str or + ~azure.mgmt.managednetworkfabric.models.IsMonitoringEnabled + :ivar vlan_id: Vlan identifier. Example: 1001. Required. + :vartype vlan_id: int + :ivar bgp_configuration: BGP configuration properties. + :vartype bgp_configuration: ~azure.mgmt.managednetworkfabric.models.BgpConfiguration + :ivar static_route_configuration: Static Route Configuration properties. + :vartype static_route_configuration: + ~azure.mgmt.managednetworkfabric.models.StaticRouteConfiguration + :ivar native_ipv4_prefix_limit: Native IPv4 Prefix Limit Configuration properties. + :vartype native_ipv4_prefix_limit: + ~azure.mgmt.managednetworkfabric.models.NativeIpv4PrefixLimitProperties + :ivar native_ipv6_prefix_limit: Native IPv6 Prefix Limit Configuration properties. + :vartype native_ipv6_prefix_limit: + ~azure.mgmt.managednetworkfabric.models.NativeIpv6PrefixLimitProperties + :ivar last_operation: Details of the last operation performed on the resource. + :vartype last_operation: ~azure.mgmt.managednetworkfabric.models.LastOperationProperties + :ivar network_fabric_id: Associated Network Fabric Resource ID. + :vartype network_fabric_id: str + :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", + "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", + "Deprovisioned", "ErrorDeprovisioning", "DeferredControl", "Provisioning", "PendingCommit", and + "PendingAdministrativeUpdate". + :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState + :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", + "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState + :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", + "Disabled", "MAT", "RMA", "UnderMaintenance", and "EnabledDegraded". + :vartype administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.AdministrativeState + """ + + annotation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Switch configuration description.""" + extension: Optional[Union[str, "_models.Extension"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Extension. Example: NoExtension | NPB. Known values are: \"NoExtension\" and \"NPB\".""" + mtu: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum transmission unit. Default value is 1500.""" + connected_i_pv4_subnets: Optional[list["_models.ConnectedSubnet"]] = rest_field( + name="connectedIPv4Subnets", visibility=["read", "create", "update", "delete", "query"] + ) + """List of Connected IPv4 Subnets.""" + connected_i_pv6_subnets: Optional[list["_models.ConnectedSubnet"]] = rest_field( + name="connectedIPv6Subnets", visibility=["read", "create", "update", "delete", "query"] + ) + """List of connected IPv6 Subnets.""" + import_route_policy: Optional["_models.ImportRoutePolicy"] = rest_field( + name="importRoutePolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Import Route Policy either IPv4 or IPv6.""" + export_route_policy: Optional["_models.ExportRoutePolicy"] = rest_field( + name="exportRoutePolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Export Route Policy either IPv4 or IPv6.""" + ingress_acl_id: Optional[str] = rest_field( + name="ingressAclId", visibility=["read", "create", "update", "delete", "query"] + ) + """Ingress Acl. ARM resource ID of Access Control Lists.""" + egress_acl_id: Optional[str] = rest_field( + name="egressAclId", visibility=["read", "create", "update", "delete", "query"] + ) + """Egress Acl. ARM resource ID of Access Control Lists.""" + is_monitoring_enabled: Optional[Union[str, "_models.IsMonitoringEnabled"]] = rest_field( + name="isMonitoringEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """To check whether monitoring of internal network is enabled or not. Known values are: \"True\" + and \"False\".""" + vlan_id: int = rest_field(name="vlanId", visibility=["read", "create", "update", "delete", "query"]) + """Vlan identifier. Example: 1001. Required.""" + bgp_configuration: Optional["_models.BgpConfiguration"] = rest_field( + name="bgpConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """BGP configuration properties.""" + static_route_configuration: Optional["_models.StaticRouteConfiguration"] = rest_field( + name="staticRouteConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Static Route Configuration properties.""" + native_ipv4_prefix_limit: Optional["_models.NativeIpv4PrefixLimitProperties"] = rest_field( + name="nativeIpv4PrefixLimit", visibility=["read", "create", "update", "delete", "query"] + ) + """Native IPv4 Prefix Limit Configuration properties.""" + native_ipv6_prefix_limit: Optional["_models.NativeIpv6PrefixLimitProperties"] = rest_field( + name="nativeIpv6PrefixLimit", visibility=["read", "create", "update", "delete", "query"] + ) + """Native IPv6 Prefix Limit Configuration properties.""" + last_operation: Optional["_models.LastOperationProperties"] = rest_field(name="lastOperation", visibility=["read"]) + """Details of the last operation performed on the resource.""" + network_fabric_id: Optional[str] = rest_field(name="networkFabricId", visibility=["read"]) + """Associated Network Fabric Resource ID.""" + configuration_state: Optional[Union[str, "_models.ConfigurationState"]] = rest_field( + name="configurationState", visibility=["read"] + ) + """Configuration state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Rejected\", + \"Accepted\", \"Provisioned\", \"ErrorProvisioning\", \"Deprovisioning\", \"Deprovisioned\", + \"ErrorDeprovisioning\", \"DeferredControl\", \"Provisioning\", \"PendingCommit\", and + \"PendingAdministrativeUpdate\".""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the resource. Known values are: \"Accepted\", \"Succeeded\", + \"Updating\", \"Deleting\", \"Failed\", and \"Canceled\".""" + administrative_state: Optional[Union[str, "_models.AdministrativeState"]] = rest_field( + name="administrativeState", visibility=["read"] + ) + """Administrative state of the resource. Known values are: \"Enabled\", \"Disabled\", \"MAT\", + \"RMA\", \"UnderMaintenance\", and \"EnabledDegraded\".""" + + @overload + def __init__( + self, + *, + vlan_id: int, + annotation: Optional[str] = None, + extension: Optional[Union[str, "_models.Extension"]] = None, + mtu: Optional[int] = None, + connected_i_pv4_subnets: Optional[list["_models.ConnectedSubnet"]] = None, + connected_i_pv6_subnets: Optional[list["_models.ConnectedSubnet"]] = None, + import_route_policy: Optional["_models.ImportRoutePolicy"] = None, + export_route_policy: Optional["_models.ExportRoutePolicy"] = None, + ingress_acl_id: Optional[str] = None, + egress_acl_id: Optional[str] = None, + is_monitoring_enabled: Optional[Union[str, "_models.IsMonitoringEnabled"]] = None, + bgp_configuration: Optional["_models.BgpConfiguration"] = None, + static_route_configuration: Optional["_models.StaticRouteConfiguration"] = None, + native_ipv4_prefix_limit: Optional["_models.NativeIpv4PrefixLimitProperties"] = None, + native_ipv6_prefix_limit: Optional["_models.NativeIpv6PrefixLimitProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class InternalNetworkUpdateBfdAdministrativeStateRequest(_Model): # pylint: disable=name-too-long + """Internal Network BFD Administrative State request. + + :ivar route_type: Route Type that helps to know which bfd we are updating. Known values are: + "Static" and "Bgp". + :vartype route_type: str or ~azure.mgmt.managednetworkfabric.models.InternalNetworkRouteType + :ivar neighbor_address: NeighborAddress - Input should be either All or Specific Ipv4 Address + or Specific Ipv6 Address. + :vartype neighbor_address: str + :ivar administrative_state: BFD Administrative state. Known values are: "Enabled", "Disabled", + "MAT", and "RMA". + :vartype administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.BfdAdministrativeState + """ + + route_type: Optional[Union[str, "_models.InternalNetworkRouteType"]] = rest_field( + name="routeType", visibility=["read", "create", "update", "delete", "query"] + ) + """Route Type that helps to know which bfd we are updating. Known values are: \"Static\" and + \"Bgp\".""" + neighbor_address: Optional[str] = rest_field( + name="neighborAddress", visibility=["read", "create", "update", "delete", "query"] + ) + """NeighborAddress - Input should be either All or Specific Ipv4 Address or Specific Ipv6 Address.""" + administrative_state: Optional[Union[str, "_models.BfdAdministrativeState"]] = rest_field( + name="administrativeState", visibility=["read", "create", "update", "delete", "query"] + ) + """BFD Administrative state. Known values are: \"Enabled\", \"Disabled\", \"MAT\", and \"RMA\".""" + + @overload + def __init__( + self, + *, + route_type: Optional[Union[str, "_models.InternalNetworkRouteType"]] = None, + neighbor_address: Optional[str] = None, + administrative_state: Optional[Union[str, "_models.BfdAdministrativeState"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class InternalNetworkUpdateBfdAdministrativeStateResponse(_Model): # pylint: disable=name-too-long + """Internal Network BFD Administrative State response. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + :ivar properties: Internal Network BFD Administrative State response properties. + :vartype properties: + ~azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBfdAdministrativeStateResponseProperties + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the async operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + percent_complete: Optional[float] = rest_field( + name="percentComplete", visibility=["read", "create", "update", "delete", "query"] + ) + """Percent of the operation that is complete.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the operation.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the operation.""" + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operations list.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If present, details of the operation error.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + properties: Optional["_models.InternalNetworkUpdateBfdAdministrativeStateResponseProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Internal Network BFD Administrative State response properties.""" + + @overload + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + properties: Optional["_models.InternalNetworkUpdateBfdAdministrativeStateResponseProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class InternalNetworkUpdateBfdAdministrativeStateResponseProperties(_Model): # pylint: disable=name-too-long + """Internal Network BFD Administrative State response properties. + + :ivar neighbor_address_administrative_status: NeighborAddress administrative status. + :vartype neighbor_address_administrative_status: + list[~azure.mgmt.managednetworkfabric.models.NeighborAddressBfdAdministrativeStatus] + """ + + neighbor_address_administrative_status: Optional[list["_models.NeighborAddressBfdAdministrativeStatus"]] = ( + rest_field( + name="neighborAddressAdministrativeStatus", visibility=["read", "create", "update", "delete", "query"] + ) + ) + """NeighborAddress administrative status.""" + + @overload + def __init__( + self, + *, + neighbor_address_administrative_status: Optional[list["_models.NeighborAddressBfdAdministrativeStatus"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class InternalNetworkUpdateBgpAdministrativeStateRequest(_Model): # pylint: disable=name-too-long + """Internal Network Administrative State Request. + + :ivar neighbor_address: NeighborAddress - Input should be either All or Specific Ipv4 Address + or Specific Ipv6 Address. + :vartype neighbor_address: str + :ivar administrative_state: BGP Administrative state. Known values are: "Enabled" and + "Disabled". + :vartype administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.BgpAdministrativeState + """ + + neighbor_address: Optional[str] = rest_field( + name="neighborAddress", visibility=["read", "create", "update", "delete", "query"] + ) + """NeighborAddress - Input should be either All or Specific Ipv4 Address or Specific Ipv6 Address.""" + administrative_state: Optional[Union[str, "_models.BgpAdministrativeState"]] = rest_field( + name="administrativeState", visibility=["read", "create", "update", "delete", "query"] + ) + """BGP Administrative state. Known values are: \"Enabled\" and \"Disabled\".""" + + @overload + def __init__( + self, + *, + neighbor_address: Optional[str] = None, + administrative_state: Optional[Union[str, "_models.BgpAdministrativeState"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class InternalNetworkUpdateBgpAdministrativeStateResponse(_Model): # pylint: disable=name-too-long + """Internal Network Administrative State Response. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + :ivar properties: Internal Network BGP Administrative State response properties. + :vartype properties: + ~azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBgpAdministrativeStateResponseProperties + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the async operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + percent_complete: Optional[float] = rest_field( + name="percentComplete", visibility=["read", "create", "update", "delete", "query"] + ) + """Percent of the operation that is complete.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the operation.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the operation.""" + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operations list.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If present, details of the operation error.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + properties: Optional["_models.InternalNetworkUpdateBgpAdministrativeStateResponseProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Internal Network BGP Administrative State response properties.""" + + @overload + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + properties: Optional["_models.InternalNetworkUpdateBgpAdministrativeStateResponseProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class InternalNetworkUpdateBgpAdministrativeStateResponseProperties(_Model): # pylint: disable=name-too-long + """Internal Network BGP Administrative State response properties. + + :ivar neighbor_address_administrative_status: NeighborAddress administrative status. + :vartype neighbor_address_administrative_status: + list[~azure.mgmt.managednetworkfabric.models.NeighborAddressBgpAdministrativeStatus] + """ + + neighbor_address_administrative_status: Optional[list["_models.NeighborAddressBgpAdministrativeStatus"]] = ( + rest_field( + name="neighborAddressAdministrativeStatus", visibility=["read", "create", "update", "delete", "query"] + ) + ) + """NeighborAddress administrative status.""" + + @overload + def __init__( + self, + *, + neighbor_address_administrative_status: Optional[list["_models.NeighborAddressBgpAdministrativeStatus"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class InternetGateway(TrackedResource): + """The Internet Gateway resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The Internet Gateway Properties. Required. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.InternetGatewayProperties + """ + + properties: "_models.InternetGatewayProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The Internet Gateway Properties. Required.""" + + __flattened_items = [ + "annotation", + "internet_gateway_rule_id", + "ipv4_address", + "port", + "type", + "internet_gateway_type", + "network_fabric_controller_id", + "last_operation", + "provisioning_state", + ] + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.InternetGatewayProperties", + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class InternetGatewayPatch(TagsUpdate): + """The Internet Gateway patch resource definition. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.InternetGatewayPatchProperties + """ + + properties: Optional["_models.InternetGatewayPatchProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["internet_gateway_rule_id"] + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.InternetGatewayPatchProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class InternetGatewayPatchProperties(_Model): + """PatchProperties for InternetGateway. + + :ivar internet_gateway_rule_id: ARM Resource ID of the Internet Gateway Rule. + :vartype internet_gateway_rule_id: str + """ + + internet_gateway_rule_id: Optional[str] = rest_field( + name="internetGatewayRuleId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM Resource ID of the Internet Gateway Rule.""" + + @overload + def __init__( + self, + *, + internet_gateway_rule_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class InternetGatewayProperties(_Model): + """Internet Gateway Properties defines the properties of the resource. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar internet_gateway_rule_id: ARM Resource ID of the Internet Gateway Rule. + :vartype internet_gateway_rule_id: str + :ivar ipv4_address: IPv4 Address of Internet Gateway. + :vartype ipv4_address: str + :ivar port: Port number of Internet Gateway. + :vartype port: int + :ivar type: Gateway Type of the resource. Known values are: "Infrastructure" and "Workload". + :vartype type: str or ~azure.mgmt.managednetworkfabric.models.GatewayType + :ivar internet_gateway_type: Gateway Type of the resource. Known values are: "Infrastructure" + and "Workload". + :vartype internet_gateway_type: str or ~azure.mgmt.managednetworkfabric.models.GatewayType + :ivar network_fabric_controller_id: ARM Resource ID of the Network Fabric Controller. Required. + :vartype network_fabric_controller_id: str + :ivar last_operation: Details of the last operation performed on the resource. + :vartype last_operation: ~azure.mgmt.managednetworkfabric.models.LastOperationProperties + :ivar provisioning_state: Provisioning state of resource. Known values are: "Accepted", + "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState + """ + + annotation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Switch configuration description.""" + internet_gateway_rule_id: Optional[str] = rest_field( + name="internetGatewayRuleId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM Resource ID of the Internet Gateway Rule.""" + ipv4_address: Optional[str] = rest_field(name="ipv4Address", visibility=["read"]) + """IPv4 Address of Internet Gateway.""" + port: Optional[int] = rest_field(visibility=["read"]) + """Port number of Internet Gateway.""" + type: Optional[Union[str, "_models.GatewayType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Gateway Type of the resource. Known values are: \"Infrastructure\" and \"Workload\".""" + internet_gateway_type: Optional[Union[str, "_models.GatewayType"]] = rest_field( + name="internetGatewayType", visibility=["read", "create", "update", "delete", "query"] + ) + """Gateway Type of the resource. Known values are: \"Infrastructure\" and \"Workload\".""" + network_fabric_controller_id: str = rest_field( + name="networkFabricControllerId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM Resource ID of the Network Fabric Controller. Required.""" + last_operation: Optional["_models.LastOperationProperties"] = rest_field(name="lastOperation", visibility=["read"]) + """Details of the last operation performed on the resource.""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of resource. Known values are: \"Accepted\", \"Succeeded\", \"Updating\", + \"Deleting\", \"Failed\", and \"Canceled\".""" + + @overload + def __init__( + self, + *, + network_fabric_controller_id: str, + annotation: Optional[str] = None, + internet_gateway_rule_id: Optional[str] = None, + type: Optional[Union[str, "_models.GatewayType"]] = None, + internet_gateway_type: Optional[Union[str, "_models.GatewayType"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class InternetGatewayRule(TrackedResource): + """The Internet Gateway Rule resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The Internet Gateway Rule properties. Required. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.InternetGatewayRuleProperties + """ + + properties: "_models.InternetGatewayRuleProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The Internet Gateway Rule properties. Required.""" + + __flattened_items = [ + "annotation", + "rule_properties", + "last_operation", + "provisioning_state", + "internet_gateway_ids", + ] + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.InternetGatewayRuleProperties", + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class InternetGatewayRulePatch(_Model): + """The Internet Gateway Rules patch resource definition. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class InternetGatewayRuleProperties(AnnotationResource): + """Internet Gateway Rule Properties defines the resource properties. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar rule_properties: Rules for the InternetGateways. Required. + :vartype rule_properties: ~azure.mgmt.managednetworkfabric.models.RuleProperties + :ivar last_operation: Details of the last operation performed on the resource. + :vartype last_operation: ~azure.mgmt.managednetworkfabric.models.LastOperationProperties + :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", + "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState + :ivar internet_gateway_ids: List of Internet Gateway resource Id. + :vartype internet_gateway_ids: list[str] + """ + + rule_properties: "_models.RuleProperties" = rest_field( + name="ruleProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """Rules for the InternetGateways. Required.""" + last_operation: Optional["_models.LastOperationProperties"] = rest_field(name="lastOperation", visibility=["read"]) + """Details of the last operation performed on the resource.""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the resource. Known values are: \"Accepted\", \"Succeeded\", + \"Updating\", \"Deleting\", \"Failed\", and \"Canceled\".""" + internet_gateway_ids: Optional[list[str]] = rest_field(name="internetGatewayIds", visibility=["read"]) + """List of Internet Gateway resource Id.""" + + @overload + def __init__( + self, + *, + rule_properties: "_models.RuleProperties", + annotation: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IpCommunity(TrackedResource): + """The IP Community resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The IP Community Properties. Required. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.IpCommunityProperties + """ + + properties: "_models.IpCommunityProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The IP Community Properties. Required.""" + + __flattened_items = [ + "annotation", + "network_fabric_id", + "ip_community_rules", + "last_operation", + "configuration_state", + "provisioning_state", + "administrative_state", + ] + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.IpCommunityProperties", + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class IpCommunityIdList(_Model): + """IP Community ID list properties. + + :ivar ip_community_ids: List of IP Community resource IDs. + :vartype ip_community_ids: list[str] + """ + + ip_community_ids: Optional[list[str]] = rest_field( + name="ipCommunityIds", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IP Community resource IDs.""" + + @overload + def __init__( + self, + *, + ip_community_ids: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IpCommunityPatch(TagsUpdate): + """The IP Community patch resource definition. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: IP Community patchable properties. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.IpCommunityPatchableProperties + """ + + properties: Optional["_models.IpCommunityPatchableProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """IP Community patchable properties.""" + + __flattened_items = ["ip_community_rules"] + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.IpCommunityPatchableProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class IpCommunityPatchableProperties(_Model): + """IP Community patchable properties. + + :ivar ip_community_rules: List of IP Community Rules. + :vartype ip_community_rules: list[~azure.mgmt.managednetworkfabric.models.IpCommunityRule] + """ + + ip_community_rules: Optional[list["_models.IpCommunityRule"]] = rest_field( + name="ipCommunityRules", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IP Community Rules.""" + + @overload + def __init__( + self, + *, + ip_community_rules: Optional[list["_models.IpCommunityRule"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IpCommunityProperties(_Model): + """IP Community Properties defines the resource properties. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar network_fabric_id: ARM Resource ID of the Network Fabric. + :vartype network_fabric_id: str + :ivar ip_community_rules: List of IP Community Rules. Required. + :vartype ip_community_rules: list[~azure.mgmt.managednetworkfabric.models.IpCommunityRule] + :ivar last_operation: Details of the last operation performed on the resource. + :vartype last_operation: ~azure.mgmt.managednetworkfabric.models.LastOperationProperties + :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", + "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", + "Deprovisioned", "ErrorDeprovisioning", "DeferredControl", "Provisioning", "PendingCommit", and + "PendingAdministrativeUpdate". + :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState + :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", + "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState + :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", + "Disabled", "MAT", "RMA", "UnderMaintenance", and "EnabledDegraded". + :vartype administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.AdministrativeState + """ + + annotation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Switch configuration description.""" + network_fabric_id: Optional[str] = rest_field(name="networkFabricId", visibility=["read"]) + """ARM Resource ID of the Network Fabric.""" + ip_community_rules: list["_models.IpCommunityRule"] = rest_field( + name="ipCommunityRules", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IP Community Rules. Required.""" + last_operation: Optional["_models.LastOperationProperties"] = rest_field(name="lastOperation", visibility=["read"]) + """Details of the last operation performed on the resource.""" + configuration_state: Optional[Union[str, "_models.ConfigurationState"]] = rest_field( + name="configurationState", visibility=["read"] + ) + """Configuration state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Rejected\", + \"Accepted\", \"Provisioned\", \"ErrorProvisioning\", \"Deprovisioning\", \"Deprovisioned\", + \"ErrorDeprovisioning\", \"DeferredControl\", \"Provisioning\", \"PendingCommit\", and + \"PendingAdministrativeUpdate\".""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the resource. Known values are: \"Accepted\", \"Succeeded\", + \"Updating\", \"Deleting\", \"Failed\", and \"Canceled\".""" + administrative_state: Optional[Union[str, "_models.AdministrativeState"]] = rest_field( + name="administrativeState", visibility=["read"] + ) + """Administrative state of the resource. Known values are: \"Enabled\", \"Disabled\", \"MAT\", + \"RMA\", \"UnderMaintenance\", and \"EnabledDegraded\".""" + + @overload + def __init__( + self, + *, + ip_community_rules: list["_models.IpCommunityRule"], + annotation: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IpCommunityRule(_Model): + """IP Community patchable properties. + + :ivar action: Action to be taken on the configuration. Example: Permit | Deny. Required. Known + values are: "Permit" and "Deny". + :vartype action: str or ~azure.mgmt.managednetworkfabric.models.CommunityActionTypes + :ivar sequence_number: Sequence to insert to/delete from existing route. Prefix lists are + evaluated starting with the lowest sequence number and continue down the list until a match is + made. Once a match is made, the permit or deny statement is applied to that network and the + rest of the list is ignored. Required. + :vartype sequence_number: int + :ivar well_known_communities: Supported well known Community List. + :vartype well_known_communities: list[str or + ~azure.mgmt.managednetworkfabric.models.WellKnownCommunities] + :ivar community_members: List the community members of IP Community. Required. + :vartype community_members: list[str] + """ + + action: Union[str, "_models.CommunityActionTypes"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Action to be taken on the configuration. Example: Permit | Deny. Required. Known values are: + \"Permit\" and \"Deny\".""" + sequence_number: int = rest_field(name="sequenceNumber", visibility=["read", "create", "update", "delete", "query"]) + """Sequence to insert to/delete from existing route. Prefix lists are evaluated starting with the + lowest sequence number and continue down the list until a match is made. Once a match is made, + the permit or deny statement is applied to that network and the rest of the list is ignored. + Required.""" + well_known_communities: Optional[list[Union[str, "_models.WellKnownCommunities"]]] = rest_field( + name="wellKnownCommunities", visibility=["read", "create", "update", "delete", "query"] + ) + """Supported well known Community List.""" + community_members: list[str] = rest_field( + name="communityMembers", visibility=["read", "create", "update", "delete", "query"] + ) + """List the community members of IP Community. Required.""" + + @overload + def __init__( + self, + *, + action: Union[str, "_models.CommunityActionTypes"], + sequence_number: int, + community_members: list[str], + well_known_communities: Optional[list[Union[str, "_models.WellKnownCommunities"]]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IpExtendedCommunity(TrackedResource): + """The IP Extended Community resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The IpExtendedCommunity properties. Required. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityProperties + """ + + properties: "_models.IpExtendedCommunityProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The IpExtendedCommunity properties. Required.""" + + __flattened_items = [ + "annotation", + "ip_extended_community_rules", + "network_fabric_id", + "last_operation", + "configuration_state", + "provisioning_state", + "administrative_state", + ] + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.IpExtendedCommunityProperties", + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class IpExtendedCommunityIdList(_Model): + """IP Extended Community Id list properties. + + :ivar ip_extended_community_ids: List of IP Extended Community resource IDs. + :vartype ip_extended_community_ids: list[str] + """ + + ip_extended_community_ids: Optional[list[str]] = rest_field( + name="ipExtendedCommunityIds", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IP Extended Community resource IDs.""" + + @overload + def __init__( + self, + *, + ip_extended_community_ids: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IpExtendedCommunityPatch(TagsUpdate): + """The IP Extended Communities patch resource definition. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: IP Extended Community patchable properties. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityPatchProperties + """ + + properties: Optional["_models.IpExtendedCommunityPatchProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """IP Extended Community patchable properties.""" + + __flattened_items = ["annotation", "ip_extended_community_rules"] + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.IpExtendedCommunityPatchProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class IpExtendedCommunityPatchProperties(_Model): + """IP Extended Community patchable properties. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar ip_extended_community_rules: List of IP Extended Community Rules. + :vartype ip_extended_community_rules: + list[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityRule] + """ + + annotation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Switch configuration description.""" + ip_extended_community_rules: Optional[list["_models.IpExtendedCommunityRule"]] = rest_field( + name="ipExtendedCommunityRules", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IP Extended Community Rules.""" + + @overload + def __init__( + self, + *, + annotation: Optional[str] = None, + ip_extended_community_rules: Optional[list["_models.IpExtendedCommunityRule"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IpExtendedCommunityProperties(_Model): + """IP Extended Community Properties defines the resource properties. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar ip_extended_community_rules: List of IP Extended Community Rules. Required. + :vartype ip_extended_community_rules: + list[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityRule] + :ivar network_fabric_id: ARM Resource ID of the Network Fabric. + :vartype network_fabric_id: str + :ivar last_operation: Details of the last operation performed on the resource. + :vartype last_operation: ~azure.mgmt.managednetworkfabric.models.LastOperationProperties + :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", + "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", + "Deprovisioned", "ErrorDeprovisioning", "DeferredControl", "Provisioning", "PendingCommit", and + "PendingAdministrativeUpdate". + :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState + :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", + "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState + :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", + "Disabled", "MAT", "RMA", "UnderMaintenance", and "EnabledDegraded". + :vartype administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.AdministrativeState + """ + + annotation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Switch configuration description.""" + ip_extended_community_rules: list["_models.IpExtendedCommunityRule"] = rest_field( + name="ipExtendedCommunityRules", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IP Extended Community Rules. Required.""" + network_fabric_id: Optional[str] = rest_field(name="networkFabricId", visibility=["read"]) + """ARM Resource ID of the Network Fabric.""" + last_operation: Optional["_models.LastOperationProperties"] = rest_field(name="lastOperation", visibility=["read"]) + """Details of the last operation performed on the resource.""" + configuration_state: Optional[Union[str, "_models.ConfigurationState"]] = rest_field( + name="configurationState", visibility=["read"] + ) + """Configuration state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Rejected\", + \"Accepted\", \"Provisioned\", \"ErrorProvisioning\", \"Deprovisioning\", \"Deprovisioned\", + \"ErrorDeprovisioning\", \"DeferredControl\", \"Provisioning\", \"PendingCommit\", and + \"PendingAdministrativeUpdate\".""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the resource. Known values are: \"Accepted\", \"Succeeded\", + \"Updating\", \"Deleting\", \"Failed\", and \"Canceled\".""" + administrative_state: Optional[Union[str, "_models.AdministrativeState"]] = rest_field( + name="administrativeState", visibility=["read"] + ) + """Administrative state of the resource. Known values are: \"Enabled\", \"Disabled\", \"MAT\", + \"RMA\", \"UnderMaintenance\", and \"EnabledDegraded\".""" + + @overload + def __init__( + self, + *, + ip_extended_community_rules: list["_models.IpExtendedCommunityRule"], + annotation: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IpExtendedCommunityRule(_Model): + """List of IP Extended Community Rules. + + :ivar action: Action to be taken on the configuration. Example: Permit | Deny. Required. Known + values are: "Permit" and "Deny". + :vartype action: str or ~azure.mgmt.managednetworkfabric.models.CommunityActionTypes + :ivar sequence_number: Sequence to insert to/delete from existing route. Prefix lists are + evaluated starting with the lowest sequence number and continue down the list until a match is + made. Once a match is made, the permit or deny statement is applied to that network and the + rest of the list is ignored. Required. + :vartype sequence_number: int + :ivar route_targets: Route Target List.The expected formats are ASN(plain):NN >> example + 4294967294:50, ASN.ASN:NN >> example 65533.65333:40, IP-address:NN >> example + 10.10.10.10:65535. The possible values of ASN,NN are in range of 0-65535, ASN(plain) is in + range of 0-4294967295. Required. + :vartype route_targets: list[str] + """ + + action: Union[str, "_models.CommunityActionTypes"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Action to be taken on the configuration. Example: Permit | Deny. Required. Known values are: + \"Permit\" and \"Deny\".""" + sequence_number: int = rest_field(name="sequenceNumber", visibility=["read", "create", "update", "delete", "query"]) + """Sequence to insert to/delete from existing route. Prefix lists are evaluated starting with the + lowest sequence number and continue down the list until a match is made. Once a match is made, + the permit or deny statement is applied to that network and the rest of the list is ignored. + Required.""" + route_targets: list[str] = rest_field( + name="routeTargets", visibility=["read", "create", "update", "delete", "query"] + ) + """Route Target List.The expected formats are ASN(plain):NN >> example 4294967294:50, ASN.ASN:NN + >> example 65533.65333:40, IP-address:NN >> example 10.10.10.10:65535. The possible values of + ASN,NN are in range of 0-65535, ASN(plain) is in range of 0-4294967295. Required.""" + + @overload + def __init__( + self, + *, + action: Union[str, "_models.CommunityActionTypes"], + sequence_number: int, + route_targets: list[str], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IpGroupPatchProperties(_Model): + """IP Group properties. + + :ivar name: IP Group name. + :vartype name: str + :ivar ip_address_type: IP Address type. Known values are: "IPv4" and "IPv6". + :vartype ip_address_type: str or ~azure.mgmt.managednetworkfabric.models.IPAddressType + :ivar ip_prefixes: List of IP Prefixes. + :vartype ip_prefixes: list[str] + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """IP Group name.""" + ip_address_type: Optional[Union[str, "_models.IPAddressType"]] = rest_field( + name="ipAddressType", visibility=["read", "create", "update", "delete", "query"] + ) + """IP Address type. Known values are: \"IPv4\" and \"IPv6\".""" + ip_prefixes: Optional[list[str]] = rest_field( + name="ipPrefixes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IP Prefixes.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + ip_address_type: Optional[Union[str, "_models.IPAddressType"]] = None, + ip_prefixes: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IpGroupProperties(_Model): + """IP Group properties. + + :ivar name: IP Group name. + :vartype name: str + :ivar ip_address_type: IP Address type. Known values are: "IPv4" and "IPv6". + :vartype ip_address_type: str or ~azure.mgmt.managednetworkfabric.models.IPAddressType + :ivar ip_prefixes: List of IP Prefixes. + :vartype ip_prefixes: list[str] + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """IP Group name.""" + ip_address_type: Optional[Union[str, "_models.IPAddressType"]] = rest_field( + name="ipAddressType", visibility=["read", "create", "update", "delete", "query"] + ) + """IP Address type. Known values are: \"IPv4\" and \"IPv6\".""" + ip_prefixes: Optional[list[str]] = rest_field( + name="ipPrefixes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IP Prefixes.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + ip_address_type: Optional[Union[str, "_models.IPAddressType"]] = None, + ip_prefixes: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IpMatchCondition(_Model): + """Defines the condition that can be filtered using the selected IPs. + + :ivar type: IP Address type that needs to be matched. Known values are: "SourceIP", + "DestinationIP", and "Bidirectional". + :vartype type: str or ~azure.mgmt.managednetworkfabric.models.SourceDestinationType + :ivar prefix_type: IP Prefix Type that needs to be matched. Known values are: "Prefix" and + "LongestPrefix". + :vartype prefix_type: str or ~azure.mgmt.managednetworkfabric.models.PrefixType + :ivar ip_prefix_values: The list of IP Prefixes that need to be matched. + :vartype ip_prefix_values: list[str] + :ivar ip_group_names: The List of IP Group Names that need to be matched. + :vartype ip_group_names: list[str] + """ + + type: Optional[Union[str, "_models.SourceDestinationType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """IP Address type that needs to be matched. Known values are: \"SourceIP\", \"DestinationIP\", + and \"Bidirectional\".""" + prefix_type: Optional[Union[str, "_models.PrefixType"]] = rest_field( + name="prefixType", visibility=["read", "create", "update", "delete", "query"] + ) + """IP Prefix Type that needs to be matched. Known values are: \"Prefix\" and \"LongestPrefix\".""" + ip_prefix_values: Optional[list[str]] = rest_field( + name="ipPrefixValues", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of IP Prefixes that need to be matched.""" + ip_group_names: Optional[list[str]] = rest_field( + name="ipGroupNames", visibility=["read", "create", "update", "delete", "query"] + ) + """The List of IP Group Names that need to be matched.""" + + @overload + def __init__( + self, + *, + type: Optional[Union[str, "_models.SourceDestinationType"]] = None, + prefix_type: Optional[Union[str, "_models.PrefixType"]] = None, + ip_prefix_values: Optional[list[str]] = None, + ip_group_names: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IpMatchConditionPatch(_Model): + """Defines the condition that can be filtered using the selected IPs. + + :ivar type: IP Address type that needs to be matched. Known values are: "SourceIP", + "DestinationIP", and "Bidirectional". + :vartype type: str or ~azure.mgmt.managednetworkfabric.models.SourceDestinationType + :ivar prefix_type: IP Prefix Type that needs to be matched. Known values are: "Prefix" and + "LongestPrefix". + :vartype prefix_type: str or ~azure.mgmt.managednetworkfabric.models.PrefixType + :ivar ip_prefix_values: The list of IP Prefixes that need to be matched. + :vartype ip_prefix_values: list[str] + :ivar ip_group_names: The List of IP Group Names that need to be matched. + :vartype ip_group_names: list[str] + """ + + type: Optional[Union[str, "_models.SourceDestinationType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """IP Address type that needs to be matched. Known values are: \"SourceIP\", \"DestinationIP\", + and \"Bidirectional\".""" + prefix_type: Optional[Union[str, "_models.PrefixType"]] = rest_field( + name="prefixType", visibility=["read", "create", "update", "delete", "query"] + ) + """IP Prefix Type that needs to be matched. Known values are: \"Prefix\" and \"LongestPrefix\".""" + ip_prefix_values: Optional[list[str]] = rest_field( + name="ipPrefixValues", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of IP Prefixes that need to be matched.""" + ip_group_names: Optional[list[str]] = rest_field( + name="ipGroupNames", visibility=["read", "create", "update", "delete", "query"] + ) + """The List of IP Group Names that need to be matched.""" + + @overload + def __init__( + self, + *, + type: Optional[Union[str, "_models.SourceDestinationType"]] = None, + prefix_type: Optional[Union[str, "_models.PrefixType"]] = None, + ip_prefix_values: Optional[list[str]] = None, + ip_group_names: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IpPrefix(TrackedResource): + """The IP Prefix resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The IP Prefix properties. Required. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.IpPrefixProperties + """ + + properties: "_models.IpPrefixProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The IP Prefix properties. Required.""" + + __flattened_items = [ + "annotation", + "network_fabric_id", + "ip_prefix_rules", + "last_operation", + "configuration_state", + "provisioning_state", + "administrative_state", + ] + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.IpPrefixProperties", + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class IpPrefixPatch(TagsUpdate): + """The IP Prefix patch resource definition. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: IP Prefix patchable properties. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.IpPrefixPatchProperties + """ + + properties: Optional["_models.IpPrefixPatchProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """IP Prefix patchable properties.""" + + __flattened_items = ["annotation", "ip_prefix_rules"] + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.IpPrefixPatchProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class IpPrefixPatchProperties(_Model): + """IP Prefix patchable properties. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar ip_prefix_rules: The list of IP Prefix Rules. + :vartype ip_prefix_rules: list[~azure.mgmt.managednetworkfabric.models.IpPrefixRule] + """ + + annotation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Switch configuration description.""" + ip_prefix_rules: Optional[list["_models.IpPrefixRule"]] = rest_field( + name="ipPrefixRules", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of IP Prefix Rules.""" + + @overload + def __init__( + self, + *, + annotation: Optional[str] = None, + ip_prefix_rules: Optional[list["_models.IpPrefixRule"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IpPrefixProperties(_Model): + """IP Prefix Properties defines the properties of the resource. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar network_fabric_id: ARM Resource ID of the Network Fabric. + :vartype network_fabric_id: str + :ivar ip_prefix_rules: The list of IP Prefix Rules. Required. + :vartype ip_prefix_rules: list[~azure.mgmt.managednetworkfabric.models.IpPrefixRule] + :ivar last_operation: Details of the last operation performed on the resource. + :vartype last_operation: ~azure.mgmt.managednetworkfabric.models.LastOperationProperties + :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", + "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", + "Deprovisioned", "ErrorDeprovisioning", "DeferredControl", "Provisioning", "PendingCommit", and + "PendingAdministrativeUpdate". + :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState + :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", + "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState + :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", + "Disabled", "MAT", "RMA", "UnderMaintenance", and "EnabledDegraded". + :vartype administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.AdministrativeState + """ + + annotation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Switch configuration description.""" + network_fabric_id: Optional[str] = rest_field(name="networkFabricId", visibility=["read"]) + """ARM Resource ID of the Network Fabric.""" + ip_prefix_rules: list["_models.IpPrefixRule"] = rest_field( + name="ipPrefixRules", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of IP Prefix Rules. Required.""" + last_operation: Optional["_models.LastOperationProperties"] = rest_field(name="lastOperation", visibility=["read"]) + """Details of the last operation performed on the resource.""" + configuration_state: Optional[Union[str, "_models.ConfigurationState"]] = rest_field( + name="configurationState", visibility=["read"] + ) + """Configuration state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Rejected\", + \"Accepted\", \"Provisioned\", \"ErrorProvisioning\", \"Deprovisioning\", \"Deprovisioned\", + \"ErrorDeprovisioning\", \"DeferredControl\", \"Provisioning\", \"PendingCommit\", and + \"PendingAdministrativeUpdate\".""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the resource. Known values are: \"Accepted\", \"Succeeded\", + \"Updating\", \"Deleting\", \"Failed\", and \"Canceled\".""" + administrative_state: Optional[Union[str, "_models.AdministrativeState"]] = rest_field( + name="administrativeState", visibility=["read"] + ) + """Administrative state of the resource. Known values are: \"Enabled\", \"Disabled\", \"MAT\", + \"RMA\", \"UnderMaintenance\", and \"EnabledDegraded\".""" + + @overload + def __init__( + self, + *, + ip_prefix_rules: list["_models.IpPrefixRule"], + annotation: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IpPrefixRule(_Model): + """IP Prefix Rule properties. + + :ivar action: Action to be taken on the configuration. Example: Permit | Deny. Required. Known + values are: "Permit" and "Deny". + :vartype action: str or ~azure.mgmt.managednetworkfabric.models.CommunityActionTypes + :ivar sequence_number: Sequence to insert to/delete from existing route. Prefix lists are + evaluated starting with the lowest sequence number and continue down the list until a match is + made. Once a match is made, the permit or deny statement is applied to that network and the + rest of the list is ignored. Required. + :vartype sequence_number: int + :ivar network_prefix: Network Prefix specifying IPv4/IPv6 packets to be permitted or denied. + Example: 1.1.1.0/24 | 3FFE:FFFF:0:CD30::/126. Required. + :vartype network_prefix: str + :ivar condition: Specify prefix-list bounds. Known values are: "EqualTo", + "GreaterThanOrEqualTo", "LesserThanOrEqualTo", and "Range". + :vartype condition: str or ~azure.mgmt.managednetworkfabric.models.Condition + :ivar subnet_mask_length: SubnetMaskLength gives the minimum NetworkPrefix length to be + matched. Possible values for IPv4 are 1 - 32 . Possible values of IPv6 are 1 - 128. + :vartype subnet_mask_length: str + """ + + action: Union[str, "_models.CommunityActionTypes"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Action to be taken on the configuration. Example: Permit | Deny. Required. Known values are: + \"Permit\" and \"Deny\".""" + sequence_number: int = rest_field(name="sequenceNumber", visibility=["read", "create", "update", "delete", "query"]) + """Sequence to insert to/delete from existing route. Prefix lists are evaluated starting with the + lowest sequence number and continue down the list until a match is made. Once a match is made, + the permit or deny statement is applied to that network and the rest of the list is ignored. + Required.""" + network_prefix: str = rest_field(name="networkPrefix", visibility=["read", "create", "update", "delete", "query"]) + """Network Prefix specifying IPv4/IPv6 packets to be permitted or denied. Example: 1.1.1.0/24 | + 3FFE:FFFF:0:CD30::/126. Required.""" + condition: Optional[Union[str, "_models.Condition"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Specify prefix-list bounds. Known values are: \"EqualTo\", \"GreaterThanOrEqualTo\", + \"LesserThanOrEqualTo\", and \"Range\".""" + subnet_mask_length: Optional[str] = rest_field( + name="subnetMaskLength", visibility=["read", "create", "update", "delete", "query"] + ) + """SubnetMaskLength gives the minimum NetworkPrefix length to be matched. Possible values for IPv4 + are 1 - 32 . Possible values of IPv6 are 1 - 128.""" + + @overload + def __init__( + self, + *, + action: Union[str, "_models.CommunityActionTypes"], + sequence_number: int, + network_prefix: str, + condition: Optional[Union[str, "_models.Condition"]] = None, + subnet_mask_length: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IsolationDomainPatchProperties(_Model): + """Isolation Domain Properties. + + :ivar encapsulation: Type of encapsulation. Known values are: "None" and "GRE". + :vartype encapsulation: str or ~azure.mgmt.managednetworkfabric.models.Encapsulation + :ivar neighbor_group_ids: List of Neighbor Group IDs. + :vartype neighbor_group_ids: list[str] + """ + + encapsulation: Optional[Union[str, "_models.Encapsulation"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Type of encapsulation. Known values are: \"None\" and \"GRE\".""" + neighbor_group_ids: Optional[list[str]] = rest_field( + name="neighborGroupIds", visibility=["read", "create", "update", "delete", "query"] + ) + """List of Neighbor Group IDs.""" + + @overload + def __init__( + self, + *, + encapsulation: Optional[Union[str, "_models.Encapsulation"]] = None, + neighbor_group_ids: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IsolationDomainProperties(_Model): + """Isolation Domain Properties. + + :ivar encapsulation: Type of encapsulation. Known values are: "None" and "GRE". + :vartype encapsulation: str or ~azure.mgmt.managednetworkfabric.models.Encapsulation + :ivar neighbor_group_ids: List of Neighbor Group IDs. + :vartype neighbor_group_ids: list[str] + """ + + encapsulation: Optional[Union[str, "_models.Encapsulation"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Type of encapsulation. Known values are: \"None\" and \"GRE\".""" + neighbor_group_ids: Optional[list[str]] = rest_field( + name="neighborGroupIds", visibility=["read", "create", "update", "delete", "query"] + ) + """List of Neighbor Group IDs.""" + + @overload + def __init__( + self, + *, + encapsulation: Optional[Union[str, "_models.Encapsulation"]] = None, + neighbor_group_ids: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class L2IsolationDomain(TrackedResource): + """The L2 Isolation Domain resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The L2IsolationDomain properties. Required. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.L2IsolationDomainProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.managednetworkfabric.models.ManagedServiceIdentity + """ + + properties: "_models.L2IsolationDomainProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The L2IsolationDomain properties. Required.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + __flattened_items = [ + "annotation", + "network_fabric_id", + "vlan_id", + "mtu", + "extended_vlan", + "network_to_network_interconnect_id", + "last_operation", + "configuration_state", + "provisioning_state", + "administrative_state", + ] + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.L2IsolationDomainProperties", + tags: Optional[dict[str, str]] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class L2IsolationDomainPatch(TagsUpdate): + """The L2 Isolation Domain patch resource definition. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: L2 Isolation Domain resource patch properties. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.L2IsolationDomainPatchProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.managednetworkfabric.models.ManagedServiceIdentityPatch + """ + + properties: Optional["_models.L2IsolationDomainPatchProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """L2 Isolation Domain resource patch properties.""" + identity: Optional["_models.ManagedServiceIdentityPatch"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + __flattened_items = ["annotation", "mtu", "extended_vlan", "network_to_network_interconnect_id"] + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.L2IsolationDomainPatchProperties"] = None, + identity: Optional["_models.ManagedServiceIdentityPatch"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class L2IsolationDomainPatchProperties(AnnotationResource): + """L2 Isolation Domain Patch Properties defines the patchable properties of the resource. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar mtu: Maximum transmission unit. Default value is 1500. + :vartype mtu: int + :ivar extended_vlan: Extended VLAN status. Known values are: "Enabled" and "Disabled". + :vartype extended_vlan: str or ~azure.mgmt.managednetworkfabric.models.ExtendedVlan + :ivar network_to_network_interconnect_id: ARM Resource ID of the networkToNetworkInterconnectId + of the L2 ISD resource. + :vartype network_to_network_interconnect_id: str + """ + + mtu: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum transmission unit. Default value is 1500.""" + extended_vlan: Optional[Union[str, "_models.ExtendedVlan"]] = rest_field( + name="extendedVlan", visibility=["read", "create", "update", "delete", "query"] + ) + """Extended VLAN status. Known values are: \"Enabled\" and \"Disabled\".""" + network_to_network_interconnect_id: Optional[str] = rest_field( + name="networkToNetworkInterconnectId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM Resource ID of the networkToNetworkInterconnectId of the L2 ISD resource.""" + + @overload + def __init__( + self, + *, + annotation: Optional[str] = None, + mtu: Optional[int] = None, + extended_vlan: Optional[Union[str, "_models.ExtendedVlan"]] = None, + network_to_network_interconnect_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class L2IsolationDomainProperties(AnnotationResource): + """L2Isolation Domain Properties defines the properties of the resource. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar network_fabric_id: ARM Resource ID of the Network Fabric. Required. + :vartype network_fabric_id: str + :ivar vlan_id: Vlan Identifier of the Network Fabric. Example: 501. Required. + :vartype vlan_id: int + :ivar mtu: Maximum transmission unit. Default value is 1500. + :vartype mtu: int + :ivar extended_vlan: Extended VLAN status, default value is Disabled. Known values are: + "Enabled" and "Disabled". + :vartype extended_vlan: str or ~azure.mgmt.managednetworkfabric.models.ExtendedVlan + :ivar network_to_network_interconnect_id: ARM Resource ID of the networkToNetworkInterconnectId + of the L2 ISD resource. + :vartype network_to_network_interconnect_id: str + :ivar last_operation: Details of the last operation performed on the resource. + :vartype last_operation: ~azure.mgmt.managednetworkfabric.models.LastOperationProperties + :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", + "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", + "Deprovisioned", "ErrorDeprovisioning", "DeferredControl", "Provisioning", "PendingCommit", and + "PendingAdministrativeUpdate". + :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState + :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", + "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState + :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", + "Disabled", "MAT", "RMA", "UnderMaintenance", and "EnabledDegraded". + :vartype administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.AdministrativeState + """ + + network_fabric_id: str = rest_field( + name="networkFabricId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM Resource ID of the Network Fabric. Required.""" + vlan_id: int = rest_field(name="vlanId", visibility=["read", "create", "update", "delete", "query"]) + """Vlan Identifier of the Network Fabric. Example: 501. Required.""" + mtu: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum transmission unit. Default value is 1500.""" + extended_vlan: Optional[Union[str, "_models.ExtendedVlan"]] = rest_field( + name="extendedVlan", visibility=["read", "create", "update", "delete", "query"] + ) + """Extended VLAN status, default value is Disabled. Known values are: \"Enabled\" and + \"Disabled\".""" + network_to_network_interconnect_id: Optional[str] = rest_field( + name="networkToNetworkInterconnectId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM Resource ID of the networkToNetworkInterconnectId of the L2 ISD resource.""" + last_operation: Optional["_models.LastOperationProperties"] = rest_field(name="lastOperation", visibility=["read"]) + """Details of the last operation performed on the resource.""" + configuration_state: Optional[Union[str, "_models.ConfigurationState"]] = rest_field( + name="configurationState", visibility=["read"] + ) + """Configuration state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Rejected\", + \"Accepted\", \"Provisioned\", \"ErrorProvisioning\", \"Deprovisioning\", \"Deprovisioned\", + \"ErrorDeprovisioning\", \"DeferredControl\", \"Provisioning\", \"PendingCommit\", and + \"PendingAdministrativeUpdate\".""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the resource. Known values are: \"Accepted\", \"Succeeded\", + \"Updating\", \"Deleting\", \"Failed\", and \"Canceled\".""" + administrative_state: Optional[Union[str, "_models.AdministrativeState"]] = rest_field( + name="administrativeState", visibility=["read"] + ) + """Administrative state of the resource. Known values are: \"Enabled\", \"Disabled\", \"MAT\", + \"RMA\", \"UnderMaintenance\", and \"EnabledDegraded\".""" + + @overload + def __init__( + self, + *, + network_fabric_id: str, + vlan_id: int, + annotation: Optional[str] = None, + mtu: Optional[int] = None, + extended_vlan: Optional[Union[str, "_models.ExtendedVlan"]] = None, + network_to_network_interconnect_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class L3ExportRoutePolicy(_Model): + """Array of ARM Resource ID of the RoutePolicies. + + :ivar export_ipv4_route_policy_id: ARM Resource ID of the RoutePolicy. + :vartype export_ipv4_route_policy_id: str + :ivar export_ipv6_route_policy_id: ARM Resource ID of the RoutePolicy. + :vartype export_ipv6_route_policy_id: str + """ + + export_ipv4_route_policy_id: Optional[str] = rest_field( + name="exportIpv4RoutePolicyId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM Resource ID of the RoutePolicy.""" + export_ipv6_route_policy_id: Optional[str] = rest_field( + name="exportIpv6RoutePolicyId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM Resource ID of the RoutePolicy.""" + + @overload + def __init__( + self, + *, + export_ipv4_route_policy_id: Optional[str] = None, + export_ipv6_route_policy_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class L3ExportRoutePolicyPatch(_Model): + """Array of ARM Resource ID of the RoutePolicies. + + :ivar export_ipv4_route_policy_id: ARM Resource ID of the RoutePolicy. + :vartype export_ipv4_route_policy_id: str + :ivar export_ipv6_route_policy_id: ARM Resource ID of the RoutePolicy. + :vartype export_ipv6_route_policy_id: str + """ + + export_ipv4_route_policy_id: Optional[str] = rest_field( + name="exportIpv4RoutePolicyId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM Resource ID of the RoutePolicy.""" + export_ipv6_route_policy_id: Optional[str] = rest_field( + name="exportIpv6RoutePolicyId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM Resource ID of the RoutePolicy.""" + + @overload + def __init__( + self, + *, + export_ipv4_route_policy_id: Optional[str] = None, + export_ipv6_route_policy_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class L3IsolationDomain(TrackedResource): + """The L3 Isolation Domain resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The L3 Isolation Domain Properties. Required. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.L3IsolationDomainProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.managednetworkfabric.models.ManagedServiceIdentity + """ + + properties: "_models.L3IsolationDomainProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The L3 Isolation Domain Properties. Required.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + __flattened_items = [ + "annotation", + "redistribute_connected_subnets", + "redistribute_static_routes", + "aggregate_route_configuration", + "connected_subnet_route_policy", + "network_fabric_id", + "static_route_route_policy", + "unique_rd_configuration", + "v4_route_prefix_limit", + "v6_route_prefix_limit", + "last_operation", + "export_policy_configuration", + "configuration_state", + "provisioning_state", + "administrative_state", + ] + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.L3IsolationDomainProperties", + tags: Optional[dict[str, str]] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class L3IsolationDomainPatch(TagsUpdate): + """The L3 Isolation Domain patch resource definition. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: L3 Isolation Domain resource patch properties. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.L3IsolationDomainPatchProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.managednetworkfabric.models.ManagedServiceIdentityPatch + """ + + properties: Optional["_models.L3IsolationDomainPatchProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """L3 Isolation Domain resource patch properties.""" + identity: Optional["_models.ManagedServiceIdentityPatch"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + __flattened_items = [ + "annotation", + "redistribute_connected_subnets", + "redistribute_static_routes", + "aggregate_route_configuration", + "connected_subnet_route_policy", + "static_route_route_policy", + "v4_route_prefix_limit", + "v6_route_prefix_limit", + "export_policy_configuration", + ] + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.L3IsolationDomainPatchProperties"] = None, + identity: Optional["_models.ManagedServiceIdentityPatch"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class L3IsolationDomainPatchProperties(_Model): + """Resource properties. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar redistribute_connected_subnets: Advertise Connected Subnets. Ex: "True" | "False". Known + values are: "True" and "False". + :vartype redistribute_connected_subnets: str or + ~azure.mgmt.managednetworkfabric.models.RedistributeConnectedSubnets + :ivar redistribute_static_routes: Advertise Static Routes. Ex: "True" | "False". Known values + are: "True" and "False". + :vartype redistribute_static_routes: str or + ~azure.mgmt.managednetworkfabric.models.RedistributeStaticRoutes + :ivar aggregate_route_configuration: Aggregate route configurations. + :vartype aggregate_route_configuration: + ~azure.mgmt.managednetworkfabric.models.AggregateRoutePatchConfiguration + :ivar connected_subnet_route_policy: Connected Subnet RoutePolicy. + :vartype connected_subnet_route_policy: + ~azure.mgmt.managednetworkfabric.models.ConnectedSubnetRoutePolicyPatch + :ivar static_route_route_policy: Static Route - route policy. + :vartype static_route_route_policy: + ~azure.mgmt.managednetworkfabric.models.StaticRouteRoutePolicyPatch + :ivar v4_route_prefix_limit: IPv4 VRF Limit configuration. + :vartype v4_route_prefix_limit: + ~azure.mgmt.managednetworkfabric.models.RoutePrefixLimitPatchProperties + :ivar v6_route_prefix_limit: IPv6 VRF Limit configuration. + :vartype v6_route_prefix_limit: + ~azure.mgmt.managednetworkfabric.models.RoutePrefixLimitPatchProperties + :ivar export_policy_configuration: BMP Export Policy configuration. + :vartype export_policy_configuration: + ~azure.mgmt.managednetworkfabric.models.BmpExportPolicyPatchProperties + """ + + annotation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Switch configuration description.""" + redistribute_connected_subnets: Optional[Union[str, "_models.RedistributeConnectedSubnets"]] = rest_field( + name="redistributeConnectedSubnets", visibility=["read", "create", "update", "delete", "query"] + ) + """Advertise Connected Subnets. Ex: \"True\" | \"False\". Known values are: \"True\" and + \"False\".""" + redistribute_static_routes: Optional[Union[str, "_models.RedistributeStaticRoutes"]] = rest_field( + name="redistributeStaticRoutes", visibility=["read", "create", "update", "delete", "query"] + ) + """Advertise Static Routes. Ex: \"True\" | \"False\". Known values are: \"True\" and \"False\".""" + aggregate_route_configuration: Optional["_models.AggregateRoutePatchConfiguration"] = rest_field( + name="aggregateRouteConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Aggregate route configurations.""" + connected_subnet_route_policy: Optional["_models.ConnectedSubnetRoutePolicyPatch"] = rest_field( + name="connectedSubnetRoutePolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Connected Subnet RoutePolicy.""" + static_route_route_policy: Optional["_models.StaticRouteRoutePolicyPatch"] = rest_field( + name="staticRouteRoutePolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Static Route - route policy.""" + v4_route_prefix_limit: Optional["_models.RoutePrefixLimitPatchProperties"] = rest_field( + name="v4routePrefixLimit", visibility=["read", "create", "update", "delete", "query"] + ) + """IPv4 VRF Limit configuration.""" + v6_route_prefix_limit: Optional["_models.RoutePrefixLimitPatchProperties"] = rest_field( + name="v6routePrefixLimit", visibility=["read", "create", "update", "delete", "query"] + ) + """IPv6 VRF Limit configuration.""" + export_policy_configuration: Optional["_models.BmpExportPolicyPatchProperties"] = rest_field( + name="exportPolicyConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """BMP Export Policy configuration.""" + + @overload + def __init__( + self, + *, + annotation: Optional[str] = None, + redistribute_connected_subnets: Optional[Union[str, "_models.RedistributeConnectedSubnets"]] = None, + redistribute_static_routes: Optional[Union[str, "_models.RedistributeStaticRoutes"]] = None, + aggregate_route_configuration: Optional["_models.AggregateRoutePatchConfiguration"] = None, + connected_subnet_route_policy: Optional["_models.ConnectedSubnetRoutePolicyPatch"] = None, + static_route_route_policy: Optional["_models.StaticRouteRoutePolicyPatch"] = None, + v4_route_prefix_limit: Optional["_models.RoutePrefixLimitPatchProperties"] = None, + v6_route_prefix_limit: Optional["_models.RoutePrefixLimitPatchProperties"] = None, + export_policy_configuration: Optional["_models.BmpExportPolicyPatchProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class L3IsolationDomainProperties(_Model): + """L3 Isolation Domain Properties defines the properties of the resource. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar redistribute_connected_subnets: Advertise Connected Subnets. Ex: "True" | "False". Known + values are: "True" and "False". + :vartype redistribute_connected_subnets: str or + ~azure.mgmt.managednetworkfabric.models.RedistributeConnectedSubnets + :ivar redistribute_static_routes: Advertise Static Routes. Ex: "True" | "False". Known values + are: "True" and "False". + :vartype redistribute_static_routes: str or + ~azure.mgmt.managednetworkfabric.models.RedistributeStaticRoutes + :ivar aggregate_route_configuration: Aggregate route configurations. + :vartype aggregate_route_configuration: + ~azure.mgmt.managednetworkfabric.models.AggregateRouteConfiguration + :ivar connected_subnet_route_policy: Connected Subnet RoutePolicy. + :vartype connected_subnet_route_policy: + ~azure.mgmt.managednetworkfabric.models.ConnectedSubnetRoutePolicy + :ivar network_fabric_id: ARM Resource ID of the Network Fabric. Required. + :vartype network_fabric_id: str + :ivar static_route_route_policy: Static Route - route policy. + :vartype static_route_route_policy: + ~azure.mgmt.managednetworkfabric.models.StaticRouteRoutePolicy + :ivar unique_rd_configuration: Unique Route Distinguisher configuration. + :vartype unique_rd_configuration: + ~azure.mgmt.managednetworkfabric.models.L3UniqueRouteDistinguisherProperties + :ivar v4_route_prefix_limit: IPv4 VRF Limit configuration. + :vartype v4_route_prefix_limit: + ~azure.mgmt.managednetworkfabric.models.RoutePrefixLimitProperties + :ivar v6_route_prefix_limit: IPv6 VRF Limit configuration. + :vartype v6_route_prefix_limit: + ~azure.mgmt.managednetworkfabric.models.RoutePrefixLimitProperties + :ivar last_operation: Details of the last operation performed on the resource. + :vartype last_operation: ~azure.mgmt.managednetworkfabric.models.LastOperationProperties + :ivar export_policy_configuration: BMP Export Policy configuration. + :vartype export_policy_configuration: + ~azure.mgmt.managednetworkfabric.models.BmpExportPolicyProperties + :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", + "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", + "Deprovisioned", "ErrorDeprovisioning", "DeferredControl", "Provisioning", "PendingCommit", and + "PendingAdministrativeUpdate". + :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState + :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", + "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState + :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", + "Disabled", "MAT", "RMA", "UnderMaintenance", and "EnabledDegraded". + :vartype administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.AdministrativeState + """ + + annotation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Switch configuration description.""" + redistribute_connected_subnets: Optional[Union[str, "_models.RedistributeConnectedSubnets"]] = rest_field( + name="redistributeConnectedSubnets", visibility=["read", "create", "update", "delete", "query"] + ) + """Advertise Connected Subnets. Ex: \"True\" | \"False\". Known values are: \"True\" and + \"False\".""" + redistribute_static_routes: Optional[Union[str, "_models.RedistributeStaticRoutes"]] = rest_field( + name="redistributeStaticRoutes", visibility=["read", "create", "update", "delete", "query"] + ) + """Advertise Static Routes. Ex: \"True\" | \"False\". Known values are: \"True\" and \"False\".""" + aggregate_route_configuration: Optional["_models.AggregateRouteConfiguration"] = rest_field( + name="aggregateRouteConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Aggregate route configurations.""" + connected_subnet_route_policy: Optional["_models.ConnectedSubnetRoutePolicy"] = rest_field( + name="connectedSubnetRoutePolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Connected Subnet RoutePolicy.""" + network_fabric_id: str = rest_field(name="networkFabricId", visibility=["read", "create"]) + """ARM Resource ID of the Network Fabric. Required.""" + static_route_route_policy: Optional["_models.StaticRouteRoutePolicy"] = rest_field( + name="staticRouteRoutePolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Static Route - route policy.""" + unique_rd_configuration: Optional["_models.L3UniqueRouteDistinguisherProperties"] = rest_field( + name="uniqueRdConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Unique Route Distinguisher configuration.""" + v4_route_prefix_limit: Optional["_models.RoutePrefixLimitProperties"] = rest_field( + name="v4routePrefixLimit", visibility=["read", "create", "update", "delete", "query"] + ) + """IPv4 VRF Limit configuration.""" + v6_route_prefix_limit: Optional["_models.RoutePrefixLimitProperties"] = rest_field( + name="v6routePrefixLimit", visibility=["read", "create", "update", "delete", "query"] + ) + """IPv6 VRF Limit configuration.""" + last_operation: Optional["_models.LastOperationProperties"] = rest_field(name="lastOperation", visibility=["read"]) + """Details of the last operation performed on the resource.""" + export_policy_configuration: Optional["_models.BmpExportPolicyProperties"] = rest_field( + name="exportPolicyConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """BMP Export Policy configuration.""" + configuration_state: Optional[Union[str, "_models.ConfigurationState"]] = rest_field( + name="configurationState", visibility=["read"] + ) + """Configuration state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Rejected\", + \"Accepted\", \"Provisioned\", \"ErrorProvisioning\", \"Deprovisioning\", \"Deprovisioned\", + \"ErrorDeprovisioning\", \"DeferredControl\", \"Provisioning\", \"PendingCommit\", and + \"PendingAdministrativeUpdate\".""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the resource. Known values are: \"Accepted\", \"Succeeded\", + \"Updating\", \"Deleting\", \"Failed\", and \"Canceled\".""" + administrative_state: Optional[Union[str, "_models.AdministrativeState"]] = rest_field( + name="administrativeState", visibility=["read"] + ) + """Administrative state of the resource. Known values are: \"Enabled\", \"Disabled\", \"MAT\", + \"RMA\", \"UnderMaintenance\", and \"EnabledDegraded\".""" + + @overload + def __init__( + self, + *, + network_fabric_id: str, + annotation: Optional[str] = None, + redistribute_connected_subnets: Optional[Union[str, "_models.RedistributeConnectedSubnets"]] = None, + redistribute_static_routes: Optional[Union[str, "_models.RedistributeStaticRoutes"]] = None, + aggregate_route_configuration: Optional["_models.AggregateRouteConfiguration"] = None, + connected_subnet_route_policy: Optional["_models.ConnectedSubnetRoutePolicy"] = None, + static_route_route_policy: Optional["_models.StaticRouteRoutePolicy"] = None, + unique_rd_configuration: Optional["_models.L3UniqueRouteDistinguisherProperties"] = None, + v4_route_prefix_limit: Optional["_models.RoutePrefixLimitProperties"] = None, + v6_route_prefix_limit: Optional["_models.RoutePrefixLimitProperties"] = None, + export_policy_configuration: Optional["_models.BmpExportPolicyProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class L3OptionBPatchProperties(_Model): + """Option B configuration. + + :ivar import_route_targets: RouteTargets to be applied. This is used for the backward + compatibility. + :vartype import_route_targets: list[str] + :ivar export_route_targets: RouteTargets to be applied. This is used for the backward + compatibility. + :vartype export_route_targets: list[str] + :ivar route_targets: RouteTargets to be applied. + :vartype route_targets: ~azure.mgmt.managednetworkfabric.models.RouteTargetPatchInformation + """ + + import_route_targets: Optional[list[str]] = rest_field( + name="importRouteTargets", visibility=["read", "create", "update", "delete", "query"] + ) + """RouteTargets to be applied. This is used for the backward compatibility.""" + export_route_targets: Optional[list[str]] = rest_field( + name="exportRouteTargets", visibility=["read", "create", "update", "delete", "query"] + ) + """RouteTargets to be applied. This is used for the backward compatibility.""" + route_targets: Optional["_models.RouteTargetPatchInformation"] = rest_field( + name="routeTargets", visibility=["read", "create", "update", "delete", "query"] + ) + """RouteTargets to be applied.""" + + @overload + def __init__( + self, + *, + import_route_targets: Optional[list[str]] = None, + export_route_targets: Optional[list[str]] = None, + route_targets: Optional["_models.RouteTargetPatchInformation"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class L3OptionBProperties(_Model): + """Option B configuration. + + :ivar import_route_targets: RouteTargets to be applied. This is used for the backward + compatibility. + :vartype import_route_targets: list[str] + :ivar export_route_targets: RouteTargets to be applied. This is used for the backward + compatibility. + :vartype export_route_targets: list[str] + :ivar route_targets: RouteTargets to be applied. + :vartype route_targets: ~azure.mgmt.managednetworkfabric.models.RouteTargetInformation + """ + + import_route_targets: Optional[list[str]] = rest_field( + name="importRouteTargets", visibility=["read", "create", "update", "delete", "query"] + ) + """RouteTargets to be applied. This is used for the backward compatibility.""" + export_route_targets: Optional[list[str]] = rest_field( + name="exportRouteTargets", visibility=["read", "create", "update", "delete", "query"] + ) + """RouteTargets to be applied. This is used for the backward compatibility.""" + route_targets: Optional["_models.RouteTargetInformation"] = rest_field( + name="routeTargets", visibility=["read", "create", "update", "delete", "query"] + ) + """RouteTargets to be applied.""" + + @overload + def __init__( + self, + *, + import_route_targets: Optional[list[str]] = None, + export_route_targets: Optional[list[str]] = None, + route_targets: Optional["_models.RouteTargetInformation"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class L3UniqueRouteDistinguisherProperties(_Model): + """Unique Route Distinguisher properties. + + :ivar unique_rds: List of Unique Route Distinguisher addresses. + :vartype unique_rds: list[str] + """ + + unique_rds: Optional[list[str]] = rest_field(name="uniqueRds", visibility=["read"]) + """List of Unique Route Distinguisher addresses.""" + + +class LastOperationProperties(_Model): + """Details of the last operations performed on the resource. + + :ivar details: Details status of the last operation performed on the resource. + :vartype details: str + """ + + details: Optional[str] = rest_field(visibility=["read"]) + """Details status of the last operation performed on the resource.""" + + +class Layer2Configuration(_Model): + """Common properties for Layer2 Configuration. + + :ivar mtu: MTU of the packets between PE & CE. + :vartype mtu: int + :ivar interfaces: List of network device interfaces resource IDs. + :vartype interfaces: list[str] + """ + + mtu: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """MTU of the packets between PE & CE.""" + interfaces: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of network device interfaces resource IDs.""" + + @overload + def __init__( + self, + *, + mtu: Optional[int] = None, + interfaces: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Layer2ConfigurationPatch(_Model): + """Common properties for Layer2 Configuration. + + :ivar mtu: MTU of the packets between PE & CE. + :vartype mtu: int + :ivar interfaces: List of network device interfaces resource IDs. + :vartype interfaces: list[str] + """ + + mtu: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """MTU of the packets between PE & CE.""" + interfaces: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of network device interfaces resource IDs.""" + + @overload + def __init__( + self, + *, + mtu: Optional[int] = None, + interfaces: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Layer3IpPrefixPatchProperties(_Model): + """Layer 3 primary and secondary IP Address prefixes. + + :ivar primary_ipv4_prefix: IPv4 Address Prefix. + :vartype primary_ipv4_prefix: str + :ivar primary_ipv6_prefix: IPv6 Address Prefix. + :vartype primary_ipv6_prefix: str + :ivar secondary_ipv4_prefix: Secondary IPv4 Address Prefix. + :vartype secondary_ipv4_prefix: str + :ivar secondary_ipv6_prefix: Secondary IPv6 Address Prefix. + :vartype secondary_ipv6_prefix: str + """ + + primary_ipv4_prefix: Optional[str] = rest_field( + name="primaryIpv4Prefix", visibility=["read", "create", "update", "delete", "query"] + ) + """IPv4 Address Prefix.""" + primary_ipv6_prefix: Optional[str] = rest_field( + name="primaryIpv6Prefix", visibility=["read", "create", "update", "delete", "query"] + ) + """IPv6 Address Prefix.""" + secondary_ipv4_prefix: Optional[str] = rest_field( + name="secondaryIpv4Prefix", visibility=["read", "create", "update", "delete", "query"] + ) + """Secondary IPv4 Address Prefix.""" + secondary_ipv6_prefix: Optional[str] = rest_field( + name="secondaryIpv6Prefix", visibility=["read", "create", "update", "delete", "query"] + ) + """Secondary IPv6 Address Prefix.""" + + @overload + def __init__( + self, + *, + primary_ipv4_prefix: Optional[str] = None, + primary_ipv6_prefix: Optional[str] = None, + secondary_ipv4_prefix: Optional[str] = None, + secondary_ipv6_prefix: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Layer3IpPrefixProperties(_Model): + """Layer 3 primary and secondary IP Address prefixes. + + :ivar primary_ipv4_prefix: IPv4 Address Prefix. + :vartype primary_ipv4_prefix: str + :ivar primary_ipv6_prefix: IPv6 Address Prefix. + :vartype primary_ipv6_prefix: str + :ivar secondary_ipv4_prefix: Secondary IPv4 Address Prefix. + :vartype secondary_ipv4_prefix: str + :ivar secondary_ipv6_prefix: Secondary IPv6 Address Prefix. + :vartype secondary_ipv6_prefix: str + """ + + primary_ipv4_prefix: Optional[str] = rest_field( + name="primaryIpv4Prefix", visibility=["read", "create", "update", "delete", "query"] + ) + """IPv4 Address Prefix.""" + primary_ipv6_prefix: Optional[str] = rest_field( + name="primaryIpv6Prefix", visibility=["read", "create", "update", "delete", "query"] + ) + """IPv6 Address Prefix.""" + secondary_ipv4_prefix: Optional[str] = rest_field( + name="secondaryIpv4Prefix", visibility=["read", "create", "update", "delete", "query"] + ) + """Secondary IPv4 Address Prefix.""" + secondary_ipv6_prefix: Optional[str] = rest_field( + name="secondaryIpv6Prefix", visibility=["read", "create", "update", "delete", "query"] + ) + """Secondary IPv6 Address Prefix.""" + + @overload + def __init__( + self, + *, + primary_ipv4_prefix: Optional[str] = None, + primary_ipv6_prefix: Optional[str] = None, + secondary_ipv4_prefix: Optional[str] = None, + secondary_ipv6_prefix: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedResourceGroupConfiguration(_Model): + """Managed Resource Group configuration properties. + + :ivar name: The NFC service will be hosted in a Managed resource group. + :vartype name: str + :ivar location: Managed resource group location. + :vartype location: str + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The NFC service will be hosted in a Managed resource group.""" + location: Optional[str] = rest_field(visibility=["read", "create"]) + """Managed resource group location.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + location: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedServiceIdentity(_Model): + """Managed service identity (system assigned and/or user assigned identities). + + :ivar principal_id: The service 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 managed identity assigned to this resource. Required. Known values are: + "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". + :vartype type: str or ~azure.mgmt.managednetworkfabric.models.ManagedServiceIdentityType + :ivar user_assigned_identities: The identities assigned to this resource by the user. + :vartype user_assigned_identities: dict[str, + ~azure.mgmt.managednetworkfabric.models.UserAssignedIdentity] + """ + + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The service principal ID of the system assigned identity. This property will only be provided + for a system assigned identity.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) + """The tenant ID of the system assigned identity. This property will only be provided for a system + assigned identity.""" + type: Union[str, "_models.ManagedServiceIdentityType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of managed identity assigned to this resource. Required. Known values are: \"None\", + \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = rest_field( + name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"] + ) + """The identities assigned to this resource by the user.""" + + @overload + def __init__( + self, + *, + type: Union[str, "_models.ManagedServiceIdentityType"], + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedServiceIdentityPatch(_Model): + """The managed service identities assigned to this resource. + + :ivar type: The type of managed identity assigned to this resource. Known values are: "None", + "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". + :vartype type: str or ~azure.mgmt.managednetworkfabric.models.ManagedServiceIdentityType + :ivar user_assigned_identities: The identities assigned to this resource by the user. + :vartype user_assigned_identities: dict[str, + ~azure.mgmt.managednetworkfabric.models.UserAssignedIdentity] + """ + + type: Optional[Union[str, "_models.ManagedServiceIdentityType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of managed identity assigned to this resource. Known values are: \"None\", + \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = rest_field( + name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"] + ) + """The identities assigned to this resource by the user.""" + + @overload + def __init__( + self, + *, + type: Optional[Union[str, "_models.ManagedServiceIdentityType"]] = None, + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagementNetworkConfigurationProperties(_Model): + """Configuration to be used to setup the management network. + + :ivar infrastructure_vpn_configuration: VPN Configuration properties. Required. + :vartype infrastructure_vpn_configuration: + ~azure.mgmt.managednetworkfabric.models.VpnConfigurationProperties + :ivar workload_vpn_configuration: VPN Configuration properties. Required. + :vartype workload_vpn_configuration: + ~azure.mgmt.managednetworkfabric.models.VpnConfigurationProperties + """ + + infrastructure_vpn_configuration: "_models.VpnConfigurationProperties" = rest_field( + name="infrastructureVpnConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """VPN Configuration properties. Required.""" + workload_vpn_configuration: "_models.VpnConfigurationProperties" = rest_field( + name="workloadVpnConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """VPN Configuration properties. Required.""" + + @overload + def __init__( + self, + *, + infrastructure_vpn_configuration: "_models.VpnConfigurationProperties", + workload_vpn_configuration: "_models.VpnConfigurationProperties", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagementNetworkPatchConfiguration(_Model): + """Configuration to be used to setup the management network. + + :ivar infrastructure_vpn_configuration: VPN Configuration properties. + :vartype infrastructure_vpn_configuration: + ~azure.mgmt.managednetworkfabric.models.VpnConfigurationPatchableProperties + :ivar workload_vpn_configuration: VPN Configuration properties. + :vartype workload_vpn_configuration: + ~azure.mgmt.managednetworkfabric.models.VpnConfigurationPatchableProperties + """ + + infrastructure_vpn_configuration: Optional["_models.VpnConfigurationPatchableProperties"] = rest_field( + name="infrastructureVpnConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """VPN Configuration properties.""" + workload_vpn_configuration: Optional["_models.VpnConfigurationPatchableProperties"] = rest_field( + name="workloadVpnConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """VPN Configuration properties.""" + + @overload + def __init__( + self, + *, + infrastructure_vpn_configuration: Optional["_models.VpnConfigurationPatchableProperties"] = None, + workload_vpn_configuration: Optional["_models.VpnConfigurationPatchableProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NativeIpv4PrefixLimitPatchProperties(_Model): + """External Network native IPv4 prefix limits patch properties. + + :ivar prefix_limits: Prefix limits. + :vartype prefix_limits: + list[~azure.mgmt.managednetworkfabric.models.PrefixLimitPatchProperties] + """ + + prefix_limits: Optional[list["_models.PrefixLimitPatchProperties"]] = rest_field( + name="prefixLimits", visibility=["read", "create", "update", "delete", "query"] + ) + """Prefix limits.""" + + @overload + def __init__( + self, + *, + prefix_limits: Optional[list["_models.PrefixLimitPatchProperties"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NativeIpv4PrefixLimitProperties(_Model): + """External Network native IPv4 prefix limit properties. + + :ivar prefix_limits: Prefix limits. + :vartype prefix_limits: list[~azure.mgmt.managednetworkfabric.models.PrefixLimitProperties] + """ + + prefix_limits: Optional[list["_models.PrefixLimitProperties"]] = rest_field( + name="prefixLimits", visibility=["read", "create", "update", "delete", "query"] + ) + """Prefix limits.""" + + @overload + def __init__( + self, + *, + prefix_limits: Optional[list["_models.PrefixLimitProperties"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NativeIpv6PrefixLimitPatchProperties(_Model): + """External Network native IPv6 prefix limits patch properties. + + :ivar prefix_limits: Prefix limits. + :vartype prefix_limits: + list[~azure.mgmt.managednetworkfabric.models.PrefixLimitPatchProperties] + """ + + prefix_limits: Optional[list["_models.PrefixLimitPatchProperties"]] = rest_field( + name="prefixLimits", visibility=["read", "create", "update", "delete", "query"] + ) + """Prefix limits.""" + + @overload + def __init__( + self, + *, + prefix_limits: Optional[list["_models.PrefixLimitPatchProperties"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NativeIpv6PrefixLimitProperties(_Model): + """External Network native IPv6 prefix limit properties. + + :ivar prefix_limits: Prefix limits. + :vartype prefix_limits: list[~azure.mgmt.managednetworkfabric.models.PrefixLimitProperties] + """ + + prefix_limits: Optional[list["_models.PrefixLimitProperties"]] = rest_field( + name="prefixLimits", visibility=["read", "create", "update", "delete", "query"] + ) + """Prefix limits.""" + + @overload + def __init__( + self, + *, + prefix_limits: Optional[list["_models.PrefixLimitProperties"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NeighborAddress(_Model): + """Neighbor Address properties. + + :ivar address: IP Address. + :vartype address: str + :ivar bfd_administrative_state: BFD Administrative State for each Neighbor Address. Example: + Enabled | Disabled. Known values are: "Enabled", "Disabled", "MAT", and "RMA". + :vartype bfd_administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.BfdAdministrativeState + :ivar bgp_administrative_state: BGP Administrative State for each Neighbor Address. Example: + Enabled | Disabled. Known values are: "Enabled" and "Disabled". + :vartype bgp_administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.BgpAdministrativeState + :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", + "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", + "Deprovisioned", "ErrorDeprovisioning", "DeferredControl", "Provisioning", "PendingCommit", and + "PendingAdministrativeUpdate". + :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState + """ + + address: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """IP Address.""" + bfd_administrative_state: Optional[Union[str, "_models.BfdAdministrativeState"]] = rest_field( + name="bfdAdministrativeState", visibility=["read"] + ) + """BFD Administrative State for each Neighbor Address. Example: Enabled | Disabled. Known values + are: \"Enabled\", \"Disabled\", \"MAT\", and \"RMA\".""" + bgp_administrative_state: Optional[Union[str, "_models.BgpAdministrativeState"]] = rest_field( + name="bgpAdministrativeState", visibility=["read"] + ) + """BGP Administrative State for each Neighbor Address. Example: Enabled | Disabled. Known values + are: \"Enabled\" and \"Disabled\".""" + configuration_state: Optional[Union[str, "_models.ConfigurationState"]] = rest_field( + name="configurationState", visibility=["read"] + ) + """Configuration state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Rejected\", + \"Accepted\", \"Provisioned\", \"ErrorProvisioning\", \"Deprovisioning\", \"Deprovisioned\", + \"ErrorDeprovisioning\", \"DeferredControl\", \"Provisioning\", \"PendingCommit\", and + \"PendingAdministrativeUpdate\".""" + + @overload + def __init__( + self, + *, + address: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NeighborAddressBfdAdministrativeStatus(_Model): + """Neighbor Address Bidirectional Forwarding Detection (BFD) Administrative Status. + + :ivar neighbor_address: NeighborAddress - Input should be either All or Specific Ipv4 Address + or Specific Ipv6 Address. + :vartype neighbor_address: str + :ivar administrative_state: BFD Administrative state. Known values are: "Enabled", "Disabled", + "MAT", and "RMA". + :vartype administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.BfdAdministrativeState + :ivar error: Error message. + :vartype error: str + """ + + neighbor_address: Optional[str] = rest_field( + name="neighborAddress", visibility=["read", "create", "update", "delete", "query"] + ) + """NeighborAddress - Input should be either All or Specific Ipv4 Address or Specific Ipv6 Address.""" + administrative_state: Optional[Union[str, "_models.BfdAdministrativeState"]] = rest_field( + name="administrativeState", visibility=["read", "create", "update", "delete", "query"] + ) + """BFD Administrative state. Known values are: \"Enabled\", \"Disabled\", \"MAT\", and \"RMA\".""" + error: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Error message.""" + + @overload + def __init__( + self, + *, + neighbor_address: Optional[str] = None, + administrative_state: Optional[Union[str, "_models.BfdAdministrativeState"]] = None, + error: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NeighborAddressBgpAdministrativeStatus(_Model): + """Neighbor Address BGP Administrative Status. + + :ivar neighbor_address: NeighborAddress - Input should be either All or Specific Ipv4 Address + or Specific Ipv6 Address. + :vartype neighbor_address: str + :ivar administrative_state: BGP Administrative state. Known values are: "Enabled" and + "Disabled". + :vartype administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.BgpAdministrativeState + :ivar error: Error message. + :vartype error: str + """ + + neighbor_address: Optional[str] = rest_field( + name="neighborAddress", visibility=["read", "create", "update", "delete", "query"] + ) + """NeighborAddress - Input should be either All or Specific Ipv4 Address or Specific Ipv6 Address.""" + administrative_state: Optional[Union[str, "_models.BgpAdministrativeState"]] = rest_field( + name="administrativeState", visibility=["read", "create", "update", "delete", "query"] + ) + """BGP Administrative state. Known values are: \"Enabled\" and \"Disabled\".""" + error: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Error message.""" + + @overload + def __init__( + self, + *, + neighbor_address: Optional[str] = None, + administrative_state: Optional[Union[str, "_models.BgpAdministrativeState"]] = None, + error: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NeighborAddressPatch(_Model): + """Neighbor Address properties. + + :ivar address: IP Address. + :vartype address: str + :ivar bfd_administrative_state: BFD Administrative State for each Neighbor Address. Example: + Enabled | Disabled. Known values are: "Enabled", "Disabled", "MAT", and "RMA". + :vartype bfd_administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.BfdAdministrativeState + :ivar bgp_administrative_state: BGP Administrative State for each Neighbor Address. Example: + Enabled | Disabled. Known values are: "Enabled" and "Disabled". + :vartype bgp_administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.BgpAdministrativeState + :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", + "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", + "Deprovisioned", "ErrorDeprovisioning", "DeferredControl", "Provisioning", "PendingCommit", and + "PendingAdministrativeUpdate". + :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState + """ + + address: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """IP Address.""" + bfd_administrative_state: Optional[Union[str, "_models.BfdAdministrativeState"]] = rest_field( + name="bfdAdministrativeState", visibility=["read"] + ) + """BFD Administrative State for each Neighbor Address. Example: Enabled | Disabled. Known values + are: \"Enabled\", \"Disabled\", \"MAT\", and \"RMA\".""" + bgp_administrative_state: Optional[Union[str, "_models.BgpAdministrativeState"]] = rest_field( + name="bgpAdministrativeState", visibility=["read"] + ) + """BGP Administrative State for each Neighbor Address. Example: Enabled | Disabled. Known values + are: \"Enabled\" and \"Disabled\".""" + configuration_state: Optional[Union[str, "_models.ConfigurationState"]] = rest_field( + name="configurationState", visibility=["read"] + ) + """Configuration state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Rejected\", + \"Accepted\", \"Provisioned\", \"ErrorProvisioning\", \"Deprovisioning\", \"Deprovisioned\", + \"ErrorDeprovisioning\", \"DeferredControl\", \"Provisioning\", \"PendingCommit\", and + \"PendingAdministrativeUpdate\".""" + + @overload + def __init__( + self, + *, + address: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NeighborGroup(TrackedResource): + """Defines the Neighbor Group. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The NeighborGroup Properties. Required. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.NeighborGroupProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.managednetworkfabric.models.ManagedServiceIdentity + """ + + properties: "_models.NeighborGroupProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The NeighborGroup Properties. Required.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + __flattened_items = [ + "annotation", + "destination", + "network_tap_ids", + "network_tap_rule_ids", + "network_fabric_ids", + "last_operation", + "provisioning_state", + "configuration_state", + ] + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.NeighborGroupProperties", + tags: Optional[dict[str, str]] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class NeighborGroupDestination(_Model): + """An array of destination IPv4 Addresses or IPv6 Addresses. + + :ivar ipv4_addresses: Array of IPv4 Addresses. + :vartype ipv4_addresses: list[str] + :ivar ipv6_addresses: Array of IPv6 Addresses. + :vartype ipv6_addresses: list[str] + """ + + ipv4_addresses: Optional[list[str]] = rest_field( + name="ipv4Addresses", visibility=["read", "create", "update", "delete", "query"] + ) + """Array of IPv4 Addresses.""" + ipv6_addresses: Optional[list[str]] = rest_field( + name="ipv6Addresses", visibility=["read", "create", "update", "delete", "query"] + ) + """Array of IPv6 Addresses.""" + + @overload + def __init__( + self, + *, + ipv4_addresses: Optional[list[str]] = None, + ipv6_addresses: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NeighborGroupDestinationPatch(_Model): + """An array of destination IPv4 Addresses or IPv6 Addresses. + + :ivar ipv4_addresses: Array of IPv4 Addresses. + :vartype ipv4_addresses: list[str] + :ivar ipv6_addresses: Array of IPv6 Addresses. + :vartype ipv6_addresses: list[str] + """ + + ipv4_addresses: Optional[list[str]] = rest_field( + name="ipv4Addresses", visibility=["read", "create", "update", "delete", "query"] + ) + """Array of IPv4 Addresses.""" + ipv6_addresses: Optional[list[str]] = rest_field( + name="ipv6Addresses", visibility=["read", "create", "update", "delete", "query"] + ) + """Array of IPv6 Addresses.""" + + @overload + def __init__( + self, + *, + ipv4_addresses: Optional[list[str]] = None, + ipv6_addresses: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NeighborGroupPatch(TagsUpdate): + """The Neighbor Group Patch definition. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: Neighbor Group Patch properties. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.NeighborGroupPatchProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.managednetworkfabric.models.ManagedServiceIdentityPatch + """ + + properties: Optional["_models.NeighborGroupPatchProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Neighbor Group Patch properties.""" + identity: Optional["_models.ManagedServiceIdentityPatch"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + __flattened_items = ["annotation", "destination"] + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.NeighborGroupPatchProperties"] = None, + identity: Optional["_models.ManagedServiceIdentityPatch"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class NeighborGroupPatchProperties(_Model): + """Neighbor Group Patch properties. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar destination: An array of destination IPv4 Addresses or IPv6 Addresses. + :vartype destination: ~azure.mgmt.managednetworkfabric.models.NeighborGroupDestinationPatch + """ + + annotation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Switch configuration description.""" + destination: Optional["_models.NeighborGroupDestinationPatch"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """An array of destination IPv4 Addresses or IPv6 Addresses.""" + + @overload + def __init__( + self, + *, + annotation: Optional[str] = None, + destination: Optional["_models.NeighborGroupDestinationPatch"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NeighborGroupProperties(_Model): + """Neighbor Group Properties defines the properties of the resource. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar destination: An array of destination IPv4 Addresses or IPv6 Addresses. Required. + :vartype destination: ~azure.mgmt.managednetworkfabric.models.NeighborGroupDestination + :ivar network_tap_ids: List of NetworkTap IDs where neighbor group is associated. + :vartype network_tap_ids: list[str] + :ivar network_tap_rule_ids: List of Network Tap Rule IDs where neighbor group is associated. + :vartype network_tap_rule_ids: list[str] + :ivar network_fabric_ids: Associated Network Fabric Resource IDs. + :vartype network_fabric_ids: list[str] + :ivar last_operation: Details of the last operation performed on the resource. + :vartype last_operation: ~azure.mgmt.managednetworkfabric.models.LastOperationProperties + :ivar provisioning_state: The provisioning state of the resource. Known values are: "Accepted", + "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState + :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", + "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", + "Deprovisioned", "ErrorDeprovisioning", "DeferredControl", "Provisioning", "PendingCommit", and + "PendingAdministrativeUpdate". + :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState + """ + + annotation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Switch configuration description.""" + destination: "_models.NeighborGroupDestination" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """An array of destination IPv4 Addresses or IPv6 Addresses. Required.""" + network_tap_ids: Optional[list[str]] = rest_field(name="networkTapIds", visibility=["read"]) + """List of NetworkTap IDs where neighbor group is associated.""" + network_tap_rule_ids: Optional[list[str]] = rest_field(name="networkTapRuleIds", visibility=["read"]) + """List of Network Tap Rule IDs where neighbor group is associated.""" + network_fabric_ids: Optional[list[str]] = rest_field(name="networkFabricIds", visibility=["read"]) + """Associated Network Fabric Resource IDs.""" + last_operation: Optional["_models.LastOperationProperties"] = rest_field(name="lastOperation", visibility=["read"]) + """Details of the last operation performed on the resource.""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The provisioning state of the resource. Known values are: \"Accepted\", \"Succeeded\", + \"Updating\", \"Deleting\", \"Failed\", and \"Canceled\".""" + configuration_state: Optional[Union[str, "_models.ConfigurationState"]] = rest_field( + name="configurationState", visibility=["read"] + ) + """Configuration state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Rejected\", + \"Accepted\", \"Provisioned\", \"ErrorProvisioning\", \"Deprovisioning\", \"Deprovisioned\", + \"ErrorDeprovisioning\", \"DeferredControl\", \"Provisioning\", \"PendingCommit\", and + \"PendingAdministrativeUpdate\".""" + + @overload + def __init__( + self, + *, + destination: "_models.NeighborGroupDestination", + annotation: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NeighborGroupResyncResponse(_Model): + """Response for Neighbor Group Resync operation. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the async operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + percent_complete: Optional[float] = rest_field( + name="percentComplete", visibility=["read", "create", "update", "delete", "query"] + ) + """Percent of the operation that is complete.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the operation.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the operation.""" + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operations list.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If present, details of the operation error.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + + @overload + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkBootstrapDevice(TrackedResource): + """The Network Bootstrap Device resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The NetworkBootstrapDevice properties. Required. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDeviceProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.managednetworkfabric.models.ManagedServiceIdentity + """ + + properties: "_models.NetworkBootstrapDeviceProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The NetworkBootstrapDevice properties. Required.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + __flattened_items = [ + "annotation", + "host_name", + "serial_number", + "version", + "network_device_sku", + "network_fabric_id", + "secondary_management_ipv4_address", + "dhcp_v4_server_ip_address", + "primary_management_ipv6_address", + "secondary_management_ipv6_address", + "provisioning_state", + "primary_management_ipv4_address", + "administrative_state", + "configuration_state", + ] + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.NetworkBootstrapDeviceProperties", + tags: Optional[dict[str, str]] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class NetworkBootstrapDevicePatch(TagsUpdate): + """The Network Bootstrap Device Patch Parameters defines the patch parameters of the resource. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: Network Bootstrap Device Patch properties. + :vartype properties: + ~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevicePatchProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.managednetworkfabric.models.ManagedServiceIdentityPatch + """ + + properties: Optional["_models.NetworkBootstrapDevicePatchProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Network Bootstrap Device Patch properties.""" + identity: Optional["_models.ManagedServiceIdentityPatch"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + __flattened_items = ["annotation", "host_name", "serial_number"] + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.NetworkBootstrapDevicePatchProperties"] = None, + identity: Optional["_models.ManagedServiceIdentityPatch"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class NetworkBootstrapDevicePatchProperties(_Model): + """Network Bootstrap Device Patch properties. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar host_name: The host name of the device. + :vartype host_name: str + :ivar serial_number: Serial number of the device. Format of serial Number - + Make;Model;HardwareRevisionId;SerialNumber. + :vartype serial_number: str + """ + + annotation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Switch configuration description.""" + host_name: Optional[str] = rest_field(name="hostName", visibility=["read", "create", "update", "delete", "query"]) + """The host name of the device.""" + serial_number: Optional[str] = rest_field( + name="serialNumber", visibility=["read", "create", "update", "delete", "query"] + ) + """Serial number of the device. Format of serial Number - + Make;Model;HardwareRevisionId;SerialNumber.""" + + @overload + def __init__( + self, + *, + annotation: Optional[str] = None, + host_name: Optional[str] = None, + serial_number: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkBootstrapDeviceProperties(_Model): + """Network Bootstrap Device Properties defines the properties of the resource. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar host_name: The host name of the device. + :vartype host_name: str + :ivar serial_number: Serial number of the device. Format of serial Number - + Make;Model;HardwareRevisionId;SerialNumber. + :vartype serial_number: str + :ivar version: Current version of the device as defined in SKU. + :vartype version: str + :ivar network_device_sku: Network Bootstrap Device SKU name. + :vartype network_device_sku: str + :ivar network_fabric_id: Associated Network Fabric Resource ID. + :vartype network_fabric_id: str + :ivar secondary_management_ipv4_address: Secondary Management IPv4 Address. + :vartype secondary_management_ipv4_address: str + :ivar dhcp_v4_server_ip_address: Dhcp server IPv4 Address. + :vartype dhcp_v4_server_ip_address: str + :ivar primary_management_ipv6_address: Primary Management IPv6 Address. + :vartype primary_management_ipv6_address: str + :ivar secondary_management_ipv6_address: Secondary Management IPv6 Address. + :vartype secondary_management_ipv6_address: str + :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", + "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState + :ivar primary_management_ipv4_address: Primary Management IPv4 Address. + :vartype primary_management_ipv4_address: str + :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", + "Disabled", "MAT", "RMA", "UnderMaintenance", and "EnabledDegraded". + :vartype administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.AdministrativeState + :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", + "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", + "Deprovisioned", "ErrorDeprovisioning", "DeferredControl", "Provisioning", "PendingCommit", and + "PendingAdministrativeUpdate". + :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState + """ + + annotation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Switch configuration description.""" + host_name: Optional[str] = rest_field(name="hostName", visibility=["read", "create", "update", "delete", "query"]) + """The host name of the device.""" + serial_number: Optional[str] = rest_field( + name="serialNumber", visibility=["read", "create", "update", "delete", "query"] + ) + """Serial number of the device. Format of serial Number - + Make;Model;HardwareRevisionId;SerialNumber.""" + version: Optional[str] = rest_field(visibility=["read"]) + """Current version of the device as defined in SKU.""" + network_device_sku: Optional[str] = rest_field(name="networkDeviceSku", visibility=["read", "create"]) + """Network Bootstrap Device SKU name.""" + network_fabric_id: Optional[str] = rest_field(name="networkFabricId", visibility=["read"]) + """Associated Network Fabric Resource ID.""" + secondary_management_ipv4_address: Optional[str] = rest_field( + name="secondaryManagementIpv4Address", visibility=["read"] + ) + """Secondary Management IPv4 Address.""" + dhcp_v4_server_ip_address: Optional[str] = rest_field(name="dhcpV4ServerIpAddress", visibility=["read"]) + """Dhcp server IPv4 Address.""" + primary_management_ipv6_address: Optional[str] = rest_field( + name="primaryManagementIpv6Address", visibility=["read"] + ) + """Primary Management IPv6 Address.""" + secondary_management_ipv6_address: Optional[str] = rest_field( + name="secondaryManagementIpv6Address", visibility=["read"] + ) + """Secondary Management IPv6 Address.""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the resource. Known values are: \"Accepted\", \"Succeeded\", + \"Updating\", \"Deleting\", \"Failed\", and \"Canceled\".""" + primary_management_ipv4_address: Optional[str] = rest_field( + name="primaryManagementIpv4Address", visibility=["read"] + ) + """Primary Management IPv4 Address.""" + administrative_state: Optional[Union[str, "_models.AdministrativeState"]] = rest_field( + name="administrativeState", visibility=["read"] + ) + """Administrative state of the resource. Known values are: \"Enabled\", \"Disabled\", \"MAT\", + \"RMA\", \"UnderMaintenance\", and \"EnabledDegraded\".""" + configuration_state: Optional[Union[str, "_models.ConfigurationState"]] = rest_field( + name="configurationState", visibility=["read"] + ) + """Configuration state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Rejected\", + \"Accepted\", \"Provisioned\", \"ErrorProvisioning\", \"Deprovisioning\", \"Deprovisioned\", + \"ErrorDeprovisioning\", \"DeferredControl\", \"Provisioning\", \"PendingCommit\", and + \"PendingAdministrativeUpdate\".""" + + @overload + def __init__( + self, + *, + annotation: Optional[str] = None, + host_name: Optional[str] = None, + serial_number: Optional[str] = None, + network_device_sku: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkBootstrapDeviceRebootResponse(_Model): + """Network Bootstrap Device reboot Response. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the async operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + percent_complete: Optional[float] = rest_field( + name="percentComplete", visibility=["read", "create", "update", "delete", "query"] + ) + """Percent of the operation that is complete.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the operation.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the operation.""" + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operations list.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If present, details of the operation error.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + + @overload + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkBootstrapDeviceRefreshConfigurationResponse(_Model): # pylint: disable=name-too-long + """The current status of an refresh configuration async operation. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the async operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + percent_complete: Optional[float] = rest_field( + name="percentComplete", visibility=["read", "create", "update", "delete", "query"] + ) + """Percent of the operation that is complete.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the operation.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the operation.""" + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operations list.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If present, details of the operation error.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + + @overload + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkBootstrapDeviceResyncPasswordsResponse(_Model): # pylint: disable=name-too-long + """Response body for a ResyncPasswords request on a Network Bootstrap Device. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the async operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + percent_complete: Optional[float] = rest_field( + name="percentComplete", visibility=["read", "create", "update", "delete", "query"] + ) + """Percent of the operation that is complete.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the operation.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the operation.""" + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operations list.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If present, details of the operation error.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + + @overload + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkBootstrapDeviceUpdateAdministrativeStateResponse(_Model): # pylint: disable=name-too-long + """Network Bootstrap Device Administrative State Update Response. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the async operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + percent_complete: Optional[float] = rest_field( + name="percentComplete", visibility=["read", "create", "update", "delete", "query"] + ) + """Percent of the operation that is complete.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the operation.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the operation.""" + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operations list.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If present, details of the operation error.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + + @overload + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkBootstrapDeviceUpgradeResponse(_Model): + """Network Bootstrap Device upgrade Response. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the async operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + percent_complete: Optional[float] = rest_field( + name="percentComplete", visibility=["read", "create", "update", "delete", "query"] + ) + """Percent of the operation that is complete.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the operation.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the operation.""" + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operations list.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If present, details of the operation error.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + + @overload + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkBootstrapInterface(ProxyResource): + """Defines the NetworkBootstrapInterface resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + :ivar properties: The NetworkBootstrapInterface properties. Required. + :vartype properties: + ~azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterfaceProperties + """ + + properties: "_models.NetworkBootstrapInterfaceProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The NetworkBootstrapInterface properties. Required.""" + + __flattened_items = [ + "annotation", + "provisioning_state", + "administrative_state", + "configuration_state", + "physical_identifier", + "connected_to", + "interface_type", + "description", + "additional_description", + "ipv4_address", + "ipv6_address", + "serial_number", + ] + + @overload + def __init__( + self, + *, + properties: "_models.NetworkBootstrapInterfaceProperties", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class NetworkBootstrapInterfacePatch(_Model): + """The NetworkBootstrapInterfacePatch resource definition. + + :ivar properties: Network Bootstrap Interface Patch properties. + :vartype properties: + ~azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterfacePatchProperties + """ + + properties: Optional["_models.NetworkBootstrapInterfacePatchProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Network Bootstrap Interface Patch properties.""" + + __flattened_items = ["annotation", "serial_number", "additional_description"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.NetworkBootstrapInterfacePatchProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class NetworkBootstrapInterfacePatchProperties(AnnotationResource): + """Network Bootstrap Interface Patch properties. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar serial_number: Serial number of the interface. Format of serial Number - + Make;Model;HardwareRevisionId;SerialNumber. + :vartype serial_number: str + :ivar additional_description: Additional description of the interface. + :vartype additional_description: str + """ + + serial_number: Optional[str] = rest_field( + name="serialNumber", visibility=["read", "create", "update", "delete", "query"] + ) + """Serial number of the interface. Format of serial Number - + Make;Model;HardwareRevisionId;SerialNumber.""" + additional_description: Optional[str] = rest_field( + name="additionalDescription", visibility=["read", "create", "update", "delete", "query"] + ) + """Additional description of the interface.""" + + @overload + def __init__( + self, + *, + annotation: Optional[str] = None, + serial_number: Optional[str] = None, + additional_description: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkBootstrapInterfaceProperties(AnnotationResource): + """Network Bootstrap Interface Properties defines the properties of the resource. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", + "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState + :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", + "Disabled", "MAT", "RMA", "UnderMaintenance", and "EnabledDegraded". + :vartype administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.AdministrativeState + :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", + "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", + "Deprovisioned", "ErrorDeprovisioning", "DeferredControl", "Provisioning", "PendingCommit", and + "PendingAdministrativeUpdate". + :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState + :ivar physical_identifier: Physical identifier of the device. + :vartype physical_identifier: str + :ivar connected_to: Connected to information of the device. + :vartype connected_to: str + :ivar interface_type: Type of the interface. Known values are: "Management" and "Data". + :vartype interface_type: str or ~azure.mgmt.managednetworkfabric.models.InterfaceType + :ivar description: Description of the interface. + :vartype description: str + :ivar additional_description: Additional description of the interface. + :vartype additional_description: str + :ivar ipv4_address: IPv4Address of the interface. + :vartype ipv4_address: str + :ivar ipv6_address: IPv6Address of the interface. + :vartype ipv6_address: str + :ivar serial_number: Serial number of the interface. Format of serial Number - + Make;Model;HardwareRevisionId;SerialNumber. + :vartype serial_number: str + """ + + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the resource. Known values are: \"Accepted\", \"Succeeded\", + \"Updating\", \"Deleting\", \"Failed\", and \"Canceled\".""" + administrative_state: Optional[Union[str, "_models.AdministrativeState"]] = rest_field( + name="administrativeState", visibility=["read"] + ) + """Administrative state of the resource. Known values are: \"Enabled\", \"Disabled\", \"MAT\", + \"RMA\", \"UnderMaintenance\", and \"EnabledDegraded\".""" + configuration_state: Optional[Union[str, "_models.ConfigurationState"]] = rest_field( + name="configurationState", visibility=["read"] + ) + """Configuration state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Rejected\", + \"Accepted\", \"Provisioned\", \"ErrorProvisioning\", \"Deprovisioning\", \"Deprovisioned\", + \"ErrorDeprovisioning\", \"DeferredControl\", \"Provisioning\", \"PendingCommit\", and + \"PendingAdministrativeUpdate\".""" + physical_identifier: Optional[str] = rest_field(name="physicalIdentifier", visibility=["read"]) + """Physical identifier of the device.""" + connected_to: Optional[str] = rest_field(name="connectedTo", visibility=["read"]) + """Connected to information of the device.""" + interface_type: Optional[Union[str, "_models.InterfaceType"]] = rest_field( + name="interfaceType", visibility=["read"] + ) + """Type of the interface. Known values are: \"Management\" and \"Data\".""" + description: Optional[str] = rest_field(visibility=["read"]) + """Description of the interface.""" + additional_description: Optional[str] = rest_field( + name="additionalDescription", visibility=["read", "create", "update", "delete", "query"] + ) + """Additional description of the interface.""" + ipv4_address: Optional[str] = rest_field(name="ipv4Address", visibility=["read"]) + """IPv4Address of the interface.""" + ipv6_address: Optional[str] = rest_field(name="ipv6Address", visibility=["read"]) + """IPv6Address of the interface.""" + serial_number: Optional[str] = rest_field( + name="serialNumber", visibility=["read", "create", "update", "delete", "query"] + ) + """Serial number of the interface. Format of serial Number - + Make;Model;HardwareRevisionId;SerialNumber.""" + + @overload + def __init__( + self, + *, + annotation: Optional[str] = None, + additional_description: Optional[str] = None, + serial_number: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkDevice(TrackedResource): + """The Network Device resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The NetworkDevice properties. Required. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.NetworkDeviceProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.managednetworkfabric.models.ManagedServiceIdentity + """ + + properties: "_models.NetworkDeviceProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The NetworkDevice properties. Required.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + __flattened_items = [ + "annotation", + "host_name", + "serial_number", + "identity_selector", + "version", + "network_device_sku", + "network_device_role", + "network_rack_id", + "management_ipv4_address", + "management_ipv6_address", + "rw_device_config", + "last_operation", + "configuration_state", + "provisioning_state", + "administrative_state", + "secret_rotation_status", + "certificate_rotation_status", + "network_fabric_id", + ] + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.NetworkDeviceProperties", + tags: Optional[dict[str, str]] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class NetworkDevicePatchParameters(TagsUpdate): + """The Network Device Patch Parameters defines the patch parameters of the resource. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: Network Device Patch properties. + :vartype properties: + ~azure.mgmt.managednetworkfabric.models.NetworkDevicePatchParametersProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.managednetworkfabric.models.ManagedServiceIdentityPatch + """ + + properties: Optional["_models.NetworkDevicePatchParametersProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Network Device Patch properties.""" + identity: Optional["_models.ManagedServiceIdentityPatch"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + __flattened_items = ["annotation", "host_name", "serial_number", "identity_selector"] + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.NetworkDevicePatchParametersProperties"] = None, + identity: Optional["_models.ManagedServiceIdentityPatch"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class NetworkDevicePatchParametersProperties(_Model): + """Network Device Patch properties. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar host_name: The host name of the device. + :vartype host_name: str + :ivar serial_number: Serial number of the device. Format of serial Number - + Make;Model;HardwareRevisionId;SerialNumber. + :vartype serial_number: str + :ivar identity_selector: The selection of the managed identity to use with this storage + account. The identity type must be either system assigned or user assigned. + :vartype identity_selector: ~azure.mgmt.managednetworkfabric.models.IdentitySelectorPatch + """ + + annotation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Switch configuration description.""" + host_name: Optional[str] = rest_field(name="hostName", visibility=["read", "create", "update", "delete", "query"]) + """The host name of the device.""" + serial_number: Optional[str] = rest_field( + name="serialNumber", visibility=["read", "create", "update", "delete", "query"] + ) + """Serial number of the device. Format of serial Number - + Make;Model;HardwareRevisionId;SerialNumber.""" + identity_selector: Optional["_models.IdentitySelectorPatch"] = rest_field( + name="identitySelector", visibility=["read", "create", "update", "delete", "query"] + ) + """The selection of the managed identity to use with this storage account. The identity type must + be either system assigned or user assigned.""" + + @overload + def __init__( + self, + *, + annotation: Optional[str] = None, + host_name: Optional[str] = None, + serial_number: Optional[str] = None, + identity_selector: Optional["_models.IdentitySelectorPatch"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkDeviceProperties(_Model): + """Network Device Properties defines the properties of the resource. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar host_name: The host name of the device. + :vartype host_name: str + :ivar serial_number: Serial number of the device. Format of serial Number - + Make;Model;HardwareRevisionId;SerialNumber. Required. + :vartype serial_number: str + :ivar identity_selector: The selection of the managed identity to use with this storage + account. The identity type must be either system assigned or user assigned. + :vartype identity_selector: ~azure.mgmt.managednetworkfabric.models.IdentitySelector + :ivar version: Current version of the device as defined in SKU. + :vartype version: str + :ivar network_device_sku: Network Device SKU name. + :vartype network_device_sku: str + :ivar network_device_role: NetworkDeviceRole is the device role: Example: CE | ToR. Known + values are: "CE", "ToR", "NPB", "TS", and "Management". + :vartype network_device_role: str or ~azure.mgmt.managednetworkfabric.models.NetworkDeviceRole + :ivar network_rack_id: Reference to network rack resource id. + :vartype network_rack_id: str + :ivar management_ipv4_address: Management IPv4 Address. + :vartype management_ipv4_address: str + :ivar management_ipv6_address: Management IPv6 Address. + :vartype management_ipv6_address: str + :ivar rw_device_config: User configured read-write configuration applied on the network + devices. + :vartype rw_device_config: str + :ivar last_operation: Details of the last operation performed on the resource. + :vartype last_operation: ~azure.mgmt.managednetworkfabric.models.LastOperationProperties + :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", + "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", + "Deprovisioned", "ErrorDeprovisioning", "DeferredControl", "Provisioning", "PendingCommit", and + "PendingAdministrativeUpdate". + :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState + :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", + "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState + :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", + "Disabled", "MAT", "RMA", "UnderMaintenance", and "EnabledDegraded". + :vartype administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.AdministrativeState + :ivar secret_rotation_status: Secret rotation status for the device's secrets. + :vartype secret_rotation_status: + list[~azure.mgmt.managednetworkfabric.models.SecretRotationStatus] + :ivar certificate_rotation_status: Certificate rotation status for the device's certificates. + :vartype certificate_rotation_status: + list[~azure.mgmt.managednetworkfabric.models.CertificateRotationStatus] + :ivar network_fabric_id: Associated Network Fabric Resource ID. + :vartype network_fabric_id: str + """ + + annotation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Switch configuration description.""" + host_name: Optional[str] = rest_field(name="hostName", visibility=["read", "create", "update", "delete", "query"]) + """The host name of the device.""" + serial_number: str = rest_field(name="serialNumber", visibility=["read", "create", "update", "delete", "query"]) + """Serial number of the device. Format of serial Number - + Make;Model;HardwareRevisionId;SerialNumber. Required.""" + identity_selector: Optional["_models.IdentitySelector"] = rest_field( + name="identitySelector", visibility=["read", "create", "update", "delete", "query"] + ) + """The selection of the managed identity to use with this storage account. The identity type must + be either system assigned or user assigned.""" + version: Optional[str] = rest_field(visibility=["read"]) + """Current version of the device as defined in SKU.""" + network_device_sku: Optional[str] = rest_field(name="networkDeviceSku", visibility=["read", "create"]) + """Network Device SKU name.""" + network_device_role: Optional[Union[str, "_models.NetworkDeviceRole"]] = rest_field( + name="networkDeviceRole", visibility=["read"] + ) + """NetworkDeviceRole is the device role: Example: CE | ToR. Known values are: \"CE\", \"ToR\", + \"NPB\", \"TS\", and \"Management\".""" + network_rack_id: Optional[str] = rest_field(name="networkRackId", visibility=["read"]) + """Reference to network rack resource id.""" + management_ipv4_address: Optional[str] = rest_field(name="managementIpv4Address", visibility=["read"]) + """Management IPv4 Address.""" + management_ipv6_address: Optional[str] = rest_field(name="managementIpv6Address", visibility=["read"]) + """Management IPv6 Address.""" + rw_device_config: Optional[str] = rest_field(name="rwDeviceConfig", visibility=["read"]) + """User configured read-write configuration applied on the network devices.""" + last_operation: Optional["_models.LastOperationProperties"] = rest_field(name="lastOperation", visibility=["read"]) + """Details of the last operation performed on the resource.""" + configuration_state: Optional[Union[str, "_models.ConfigurationState"]] = rest_field( + name="configurationState", visibility=["read"] + ) + """Configuration state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Rejected\", + \"Accepted\", \"Provisioned\", \"ErrorProvisioning\", \"Deprovisioning\", \"Deprovisioned\", + \"ErrorDeprovisioning\", \"DeferredControl\", \"Provisioning\", \"PendingCommit\", and + \"PendingAdministrativeUpdate\".""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the resource. Known values are: \"Accepted\", \"Succeeded\", + \"Updating\", \"Deleting\", \"Failed\", and \"Canceled\".""" + administrative_state: Optional[Union[str, "_models.AdministrativeState"]] = rest_field( + name="administrativeState", visibility=["read"] + ) + """Administrative state of the resource. Known values are: \"Enabled\", \"Disabled\", \"MAT\", + \"RMA\", \"UnderMaintenance\", and \"EnabledDegraded\".""" + secret_rotation_status: Optional[list["_models.SecretRotationStatus"]] = rest_field( + name="secretRotationStatus", visibility=["read"] + ) + """Secret rotation status for the device's secrets.""" + certificate_rotation_status: Optional[list["_models.CertificateRotationStatus"]] = rest_field( + name="certificateRotationStatus", visibility=["read"] + ) + """Certificate rotation status for the device's certificates.""" + network_fabric_id: Optional[str] = rest_field(name="networkFabricId", visibility=["read"]) + """Associated Network Fabric Resource ID.""" + + @overload + def __init__( + self, + *, + serial_number: str, + annotation: Optional[str] = None, + host_name: Optional[str] = None, + identity_selector: Optional["_models.IdentitySelector"] = None, + network_device_sku: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkDeviceRefreshConfigurationResponse(_Model): # pylint: disable=name-too-long + """The current status of an refresh configuration async operation. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the async operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + percent_complete: Optional[float] = rest_field( + name="percentComplete", visibility=["read", "create", "update", "delete", "query"] + ) + """Percent of the operation that is complete.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the operation.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the operation.""" + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operations list.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If present, details of the operation error.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + + @overload + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkDeviceResyncPasswordsResponse(_Model): + """Response body for a ResyncPasswords request on a Network Device. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the async operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + percent_complete: Optional[float] = rest_field( + name="percentComplete", visibility=["read", "create", "update", "delete", "query"] + ) + """Percent of the operation that is complete.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the operation.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the operation.""" + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operations list.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If present, details of the operation error.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + + @overload + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkDeviceRunRwCommandResponse(_Model): + """Response body for a RunRwCommand request on a Network Device. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + :ivar properties: Network Device Run Rw Command Response properties. + :vartype properties: + ~azure.mgmt.managednetworkfabric.models.NetworkDeviceRwCommandResponseProperties + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the async operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + percent_complete: Optional[float] = rest_field( + name="percentComplete", visibility=["read", "create", "update", "delete", "query"] + ) + """Percent of the operation that is complete.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the operation.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the operation.""" + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operations list.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If present, details of the operation error.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + properties: Optional["_models.NetworkDeviceRwCommandResponseProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Network Device Run Rw Command Response properties.""" + + @overload + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + properties: Optional["_models.NetworkDeviceRwCommandResponseProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkDeviceRwCommandResponseProperties(_Model): + """Network Device Resource defines the properties of the resource. + + :ivar configuration_state: Gets the configuration state. Known values are: "Succeeded", + "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", + "Deprovisioned", "ErrorDeprovisioning", "DeferredControl", "Provisioning", "PendingCommit", and + "PendingAdministrativeUpdate". + :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState + :ivar output_url: Predefined link containing Device Rw Command output. + :vartype output_url: str + """ + + configuration_state: Optional[Union[str, "_models.ConfigurationState"]] = rest_field( + name="configurationState", visibility=["read"] + ) + """Gets the configuration state. Known values are: \"Succeeded\", \"Failed\", \"Rejected\", + \"Accepted\", \"Provisioned\", \"ErrorProvisioning\", \"Deprovisioning\", \"Deprovisioned\", + \"ErrorDeprovisioning\", \"DeferredControl\", \"Provisioning\", \"PendingCommit\", and + \"PendingAdministrativeUpdate\".""" + output_url: Optional[str] = rest_field(name="outputUrl", visibility=["read", "create", "update", "delete", "query"]) + """Predefined link containing Device Rw Command output.""" + + @overload + def __init__( + self, + *, + output_url: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkDeviceSku(ProxyResource): + """The NetworkDeviceSku resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + :ivar properties: The Network Device SKU properties. Required. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.NetworkDeviceSkuProperties + """ + + properties: "_models.NetworkDeviceSkuProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The Network Device SKU properties. Required.""" + + __flattened_items = [ + "model", + "manufacturer", + "supported_versions", + "supported_role_types", + "interfaces", + "provisioning_state", + ] + + @overload + def __init__( + self, + *, + properties: "_models.NetworkDeviceSkuProperties", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class NetworkDeviceSkuProperties(_Model): + """Network Device SKU Properties defines the properties of the resource. + + :ivar model: Model of the network device. Required. + :vartype model: str + :ivar manufacturer: Manufacturer of the network device. + :vartype manufacturer: str + :ivar supported_versions: List of supported version details of network device. + :vartype supported_versions: + list[~azure.mgmt.managednetworkfabric.models.SupportedVersionProperties] + :ivar supported_role_types: Available roles for the network device. + :vartype supported_role_types: list[str or + ~azure.mgmt.managednetworkfabric.models.NetworkDeviceRoleName] + :ivar interfaces: List of network device interfaces. + :vartype interfaces: list[~azure.mgmt.managednetworkfabric.models.DeviceInterfaceProperties] + :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", + "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState + """ + + model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Model of the network device. Required.""" + manufacturer: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Manufacturer of the network device.""" + supported_versions: Optional[list["_models.SupportedVersionProperties"]] = rest_field( + name="supportedVersions", visibility=["read", "create", "update", "delete", "query"] + ) + """List of supported version details of network device.""" + supported_role_types: Optional[list[Union[str, "_models.NetworkDeviceRoleName"]]] = rest_field( + name="supportedRoleTypes", visibility=["read", "create", "update", "delete", "query"] + ) + """Available roles for the network device.""" + interfaces: Optional[list["_models.DeviceInterfaceProperties"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of network device interfaces.""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the resource. Known values are: \"Accepted\", \"Succeeded\", + \"Updating\", \"Deleting\", \"Failed\", and \"Canceled\".""" + + @overload + def __init__( + self, + *, + model: str, + manufacturer: Optional[str] = None, + supported_versions: Optional[list["_models.SupportedVersionProperties"]] = None, + supported_role_types: Optional[list[Union[str, "_models.NetworkDeviceRoleName"]]] = None, + interfaces: Optional[list["_models.DeviceInterfaceProperties"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkDeviceUpdateAdministrativeStateResponse(_Model): # pylint: disable=name-too-long + """Network Device Administrative State Update Response. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the async operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + percent_complete: Optional[float] = rest_field( + name="percentComplete", visibility=["read", "create", "update", "delete", "query"] + ) + """Percent of the operation that is complete.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the operation.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the operation.""" + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operations list.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If present, details of the operation error.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + + @overload + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkDeviceUpgradeRequest(_Model): + """NetworkDevice Upgrade Request Properties. + + :ivar version: Version to which the device needs to be upgraded. Required. + :vartype version: str + :ivar rw_device_config_url: URL to the file containing Read-write configuration to be applied + on the device during upgrade. + :vartype rw_device_config_url: str + """ + + version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Version to which the device needs to be upgraded. Required.""" + rw_device_config_url: Optional[str] = rest_field( + name="rwDeviceConfigUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """URL to the file containing Read-write configuration to be applied on the device during upgrade.""" + + @overload + def __init__( + self, + *, + version: str, + rw_device_config_url: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkDeviceUpgradeResponse(_Model): + """Network Device Upgrade Response. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the async operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + percent_complete: Optional[float] = rest_field( + name="percentComplete", visibility=["read", "create", "update", "delete", "query"] + ) + """Percent of the operation that is complete.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the operation.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the operation.""" + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operations list.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If present, details of the operation error.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + + @overload + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkFabric(TrackedResource): + """The Network Fabric resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The NetworkFabric Properties. Required. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.NetworkFabricProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.managednetworkfabric.models.ManagedServiceIdentity + """ + + properties: "_models.NetworkFabricProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The NetworkFabric Properties. Required.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + __flattened_items = [ + "annotation", + "network_fabric_sku", + "fabric_version", + "router_ids", + "storage_account_configuration", + "fabric_locks", + "network_fabric_controller_id", + "rack_count", + "server_count_per_rack", + "ipv4_prefix", + "ipv6_prefix", + "fabric_asn", + "terminal_server_configuration", + "management_network_configuration", + "racks", + "l2_isolation_domains", + "l3_isolation_domains", + "hardware_alert_threshold", + "control_plane_acls", + "feature_flags", + "trusted_ip_prefixes", + "unique_rd_configuration", + "storage_array_count", + "active_commit_batches", + "secret_rotation_summary", + "last_operation", + "authorized_transceiver", + "configuration_state", + "provisioning_state", + "administrative_state", + "qos_configuration", + ] + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.NetworkFabricProperties", + tags: Optional[dict[str, str]] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class NetworkFabricController(TrackedResource): + """The Network Fabric Controller resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The NetworkFabricController Properties. Required. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.NetworkFabricControllerProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.managednetworkfabric.models.ManagedServiceIdentity + """ + + properties: "_models.NetworkFabricControllerProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The NetworkFabricController Properties. Required.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + __flattened_items = [ + "annotation", + "infrastructure_express_route_connections", + "workload_express_route_connections", + "infrastructure_services", + "workload_services", + "managed_resource_group_configuration", + "network_fabric_ids", + "is_workload_management_network_enabled", + "tenant_internet_gateway_ids", + "ipv4_address_space", + "ipv6_address_space", + "nfc_sku", + "last_operation", + "provisioning_state", + ] + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.NetworkFabricControllerProperties", + tags: Optional[dict[str, str]] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class NetworkFabricControllerPatch(TagsUpdate): + """The Network Fabric Controller Patch payload definition. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: Network Fabric Controller patch properties. + :vartype properties: + ~azure.mgmt.managednetworkfabric.models.NetworkFabricControllerPatchProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.managednetworkfabric.models.ManagedServiceIdentityPatch + """ + + properties: Optional["_models.NetworkFabricControllerPatchProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Network Fabric Controller patch properties.""" + identity: Optional["_models.ManagedServiceIdentityPatch"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + __flattened_items = ["infrastructure_express_route_connections", "workload_express_route_connections"] + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.NetworkFabricControllerPatchProperties"] = None, + identity: Optional["_models.ManagedServiceIdentityPatch"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class NetworkFabricControllerPatchProperties(_Model): + """Network Fabric Controller patch properties. + + :ivar infrastructure_express_route_connections: As part of an update, the Infrastructure + ExpressRoute CircuitID should be provided to create and Provision a NFC. This Express route is + dedicated for Infrastructure services. (This is a Mandatory attribute). + :vartype infrastructure_express_route_connections: + list[~azure.mgmt.managednetworkfabric.models.ExpressRouteConnectionInformation] + :ivar workload_express_route_connections: As part of an update, the workload ExpressRoute + CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for + Workload services. (This is a Mandatory attribute). + :vartype workload_express_route_connections: + list[~azure.mgmt.managednetworkfabric.models.ExpressRouteConnectionInformation] + """ + + infrastructure_express_route_connections: Optional[list["_models.ExpressRouteConnectionInformation"]] = rest_field( + name="infrastructureExpressRouteConnections", visibility=["read", "create", "update", "delete", "query"] + ) + """As part of an update, the Infrastructure ExpressRoute CircuitID should be provided to create + and Provision a NFC. This Express route is dedicated for Infrastructure services. (This is a + Mandatory attribute).""" + workload_express_route_connections: Optional[list["_models.ExpressRouteConnectionInformation"]] = rest_field( + name="workloadExpressRouteConnections", visibility=["read", "create", "update", "delete", "query"] + ) + """As part of an update, the workload ExpressRoute CircuitID should be provided to create and + Provision a NFC. This Express route is dedicated for Workload services. (This is a Mandatory + attribute).""" + + @overload + def __init__( + self, + *, + infrastructure_express_route_connections: Optional[list["_models.ExpressRouteConnectionInformation"]] = None, + workload_express_route_connections: Optional[list["_models.ExpressRouteConnectionInformation"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkFabricControllerProperties(_Model): + """NetworkFabricControllerProperties defines the resource properties. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar infrastructure_express_route_connections: As part of an update, the Infrastructure + ExpressRoute CircuitID should be provided to create and Provision a NFC. This Express route is + dedicated for Infrastructure services. (This is a Mandatory attribute). + :vartype infrastructure_express_route_connections: + list[~azure.mgmt.managednetworkfabric.models.ExpressRouteConnectionInformation] + :ivar workload_express_route_connections: As part of an update, the workload ExpressRoute + CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for + Workload services. (This is a Mandatory attribute). + :vartype workload_express_route_connections: + list[~azure.mgmt.managednetworkfabric.models.ExpressRouteConnectionInformation] + :ivar infrastructure_services: InfrastructureServices IP ranges. + :vartype infrastructure_services: ~azure.mgmt.managednetworkfabric.models.ControllerServices + :ivar workload_services: WorkloadServices IP ranges. + :vartype workload_services: ~azure.mgmt.managednetworkfabric.models.ControllerServices + :ivar managed_resource_group_configuration: Managed Resource Group configuration properties. + :vartype managed_resource_group_configuration: + ~azure.mgmt.managednetworkfabric.models.ManagedResourceGroupConfiguration + :ivar network_fabric_ids: The NF-ID will be an input parameter used by the NF to link and get + associated with the parent NFC Service. + :vartype network_fabric_ids: list[str] + :ivar is_workload_management_network_enabled: A workload management network is required for all + the tenant (workload) traffic. This traffic is only dedicated for Tenant workloads which are + required to access internet or any other MSFT/Public endpoints. Known values are: "True" and + "False". + :vartype is_workload_management_network_enabled: str or + ~azure.mgmt.managednetworkfabric.models.IsWorkloadManagementNetworkEnabled + :ivar tenant_internet_gateway_ids: List of tenant InternetGateway resource IDs. + :vartype tenant_internet_gateway_ids: list[str] + :ivar ipv4_address_space: IPv4 Network Fabric Controller Address Space. + :vartype ipv4_address_space: str + :ivar ipv6_address_space: IPv6 Network Fabric Controller Address Space. + :vartype ipv6_address_space: str + :ivar nfc_sku: Network Fabric Controller SKU. Known values are: "Basic", "Standard", and + "HighPerformance". + :vartype nfc_sku: str or ~azure.mgmt.managednetworkfabric.models.NfcSku + :ivar last_operation: Details of the last operation performed on the resource. + :vartype last_operation: ~azure.mgmt.managednetworkfabric.models.LastOperationProperties + :ivar provisioning_state: Provides you the latest status of the NFC service, whether it is + Accepted, updating, Succeeded or Failed. During this process, the states keep changing based on + the status of NFC provisioning. Known values are: "Accepted", "Succeeded", "Updating", + "Deleting", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState + """ + + annotation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Switch configuration description.""" + infrastructure_express_route_connections: Optional[list["_models.ExpressRouteConnectionInformation"]] = rest_field( + name="infrastructureExpressRouteConnections", visibility=["read", "create", "update", "delete", "query"] + ) + """As part of an update, the Infrastructure ExpressRoute CircuitID should be provided to create + and Provision a NFC. This Express route is dedicated for Infrastructure services. (This is a + Mandatory attribute).""" + workload_express_route_connections: Optional[list["_models.ExpressRouteConnectionInformation"]] = rest_field( + name="workloadExpressRouteConnections", visibility=["read", "create", "update", "delete", "query"] + ) + """As part of an update, the workload ExpressRoute CircuitID should be provided to create and + Provision a NFC. This Express route is dedicated for Workload services. (This is a Mandatory + attribute).""" + infrastructure_services: Optional["_models.ControllerServices"] = rest_field( + name="infrastructureServices", visibility=["read"] + ) + """InfrastructureServices IP ranges.""" + workload_services: Optional["_models.ControllerServices"] = rest_field(name="workloadServices", visibility=["read"]) + """WorkloadServices IP ranges.""" + managed_resource_group_configuration: Optional["_models.ManagedResourceGroupConfiguration"] = rest_field( + name="managedResourceGroupConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Managed Resource Group configuration properties.""" + network_fabric_ids: Optional[list[str]] = rest_field(name="networkFabricIds", visibility=["read"]) + """The NF-ID will be an input parameter used by the NF to link and get associated with the parent + NFC Service.""" + is_workload_management_network_enabled: Optional[Union[str, "_models.IsWorkloadManagementNetworkEnabled"]] = ( + rest_field( + name="isWorkloadManagementNetworkEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + ) + """A workload management network is required for all the tenant (workload) traffic. This traffic + is only dedicated for Tenant workloads which are required to access internet or any other + MSFT/Public endpoints. Known values are: \"True\" and \"False\".""" + tenant_internet_gateway_ids: Optional[list[str]] = rest_field(name="tenantInternetGatewayIds", visibility=["read"]) + """List of tenant InternetGateway resource IDs.""" + ipv4_address_space: Optional[str] = rest_field( + name="ipv4AddressSpace", visibility=["read", "create", "update", "delete", "query"] + ) + """IPv4 Network Fabric Controller Address Space.""" + ipv6_address_space: Optional[str] = rest_field( + name="ipv6AddressSpace", visibility=["read", "create", "update", "delete", "query"] + ) + """IPv6 Network Fabric Controller Address Space.""" + nfc_sku: Optional[Union[str, "_models.NfcSku"]] = rest_field( + name="nfcSku", visibility=["read", "create", "update", "delete", "query"] + ) + """Network Fabric Controller SKU. Known values are: \"Basic\", \"Standard\", and + \"HighPerformance\".""" + last_operation: Optional["_models.LastOperationProperties"] = rest_field(name="lastOperation", visibility=["read"]) + """Details of the last operation performed on the resource.""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provides you the latest status of the NFC service, whether it is Accepted, updating, Succeeded + or Failed. During this process, the states keep changing based on the status of NFC + provisioning. Known values are: \"Accepted\", \"Succeeded\", \"Updating\", \"Deleting\", + \"Failed\", and \"Canceled\".""" + + @overload + def __init__( + self, + *, + annotation: Optional[str] = None, + infrastructure_express_route_connections: Optional[list["_models.ExpressRouteConnectionInformation"]] = None, + workload_express_route_connections: Optional[list["_models.ExpressRouteConnectionInformation"]] = None, + managed_resource_group_configuration: Optional["_models.ManagedResourceGroupConfiguration"] = None, + is_workload_management_network_enabled: Optional[ + Union[str, "_models.IsWorkloadManagementNetworkEnabled"] + ] = None, + ipv4_address_space: Optional[str] = None, + ipv6_address_space: Optional[str] = None, + nfc_sku: Optional[Union[str, "_models.NfcSku"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkFabricLockRequest(_Model): + """Network Fabric Lock Request. + + :ivar lock_type: Type of lock to be applied. Known values are: "Administrative" and + "Configuration". + :vartype lock_type: str or ~azure.mgmt.managednetworkfabric.models.NetworkFabricLockType + :ivar action: Action to be performed on the lock. Known values are: "Lock" and "Unlock". + :vartype action: str or ~azure.mgmt.managednetworkfabric.models.NetworkFabricLockAction + """ + + lock_type: Optional[Union[str, "_models.NetworkFabricLockType"]] = rest_field( + name="lockType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of lock to be applied. Known values are: \"Administrative\" and \"Configuration\".""" + action: Optional[Union[str, "_models.NetworkFabricLockAction"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Action to be performed on the lock. Known values are: \"Lock\" and \"Unlock\".""" + + @overload + def __init__( + self, + *, + lock_type: Optional[Union[str, "_models.NetworkFabricLockType"]] = None, + action: Optional[Union[str, "_models.NetworkFabricLockAction"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkFabricPatch(TagsUpdate): + """The Network Fabric resource definition. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: Network Fabric Patch properties. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.NetworkFabricPatchProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.managednetworkfabric.models.ManagedServiceIdentityPatch + """ + + properties: Optional["_models.NetworkFabricPatchProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Network Fabric Patch properties.""" + identity: Optional["_models.ManagedServiceIdentityPatch"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + __flattened_items = [ + "annotation", + "rack_count", + "server_count_per_rack", + "ipv4_prefix", + "ipv6_prefix", + "fabric_asn", + "terminal_server_configuration", + "management_network_configuration", + "storage_account_configuration", + "hardware_alert_threshold", + "control_plane_acls", + "trusted_ip_prefixes", + "unique_rd_configuration", + "qos_configuration", + "feature_flags", + "authorized_transceiver", + ] + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.NetworkFabricPatchProperties"] = None, + identity: Optional["_models.ManagedServiceIdentityPatch"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class NetworkFabricPatchProperties(_Model): + """Network Fabric Patch properties. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar rack_count: Number of compute racks associated to Network Fabric. + :vartype rack_count: int + :ivar server_count_per_rack: Number of servers.Possible values are from 1-16. + :vartype server_count_per_rack: int + :ivar ipv4_prefix: IPv4Prefix for Management Network. Example: 10.1.0.0/19. + :vartype ipv4_prefix: str + :ivar ipv6_prefix: IPv6Prefix for Management Network. Example: 3FFE:FFFF:0:CD40::/59. + :vartype ipv6_prefix: str + :ivar fabric_asn: ASN of CE devices for CE/PE connectivity. + :vartype fabric_asn: int + :ivar terminal_server_configuration: Network and credentials configuration already applied to + terminal server. + :vartype terminal_server_configuration: + ~azure.mgmt.managednetworkfabric.models.TerminalServerPatchConfiguration + :ivar management_network_configuration: Configuration to be used to setup the management + network. + :vartype management_network_configuration: + ~azure.mgmt.managednetworkfabric.models.ManagementNetworkPatchConfiguration + :ivar storage_account_configuration: Bring your own storage account configurations for Network + Fabric. + :vartype storage_account_configuration: + ~azure.mgmt.managednetworkfabric.models.StorageAccountPatchConfiguration + :ivar hardware_alert_threshold: Hardware alert threshold percentage. Possible values are from + 20 to 100. + :vartype hardware_alert_threshold: int + :ivar control_plane_acls: Control Plane Access Control List ARM resource IDs. + :vartype control_plane_acls: list[str] + :ivar trusted_ip_prefixes: Trusted IP Prefix ARM resource IDs. + :vartype trusted_ip_prefixes: list[str] + :ivar unique_rd_configuration: Unique Route Distinguisher configuration. + :vartype unique_rd_configuration: + ~azure.mgmt.managednetworkfabric.models.UniqueRouteDistinguisherPatchProperties + :ivar qos_configuration: NetworkFabric QoS Configuration. + :vartype qos_configuration: ~azure.mgmt.managednetworkfabric.models.QosPatchProperties + :ivar feature_flags: NetworkFabric feature flag configuration information. + :vartype feature_flags: list[~azure.mgmt.managednetworkfabric.models.FeatureFlagProperties] + :ivar authorized_transceiver: Authorized transciever configuration for NetworkFabric. + :vartype authorized_transceiver: + ~azure.mgmt.managednetworkfabric.models.AuthorizedTransceiverPatchProperties + """ + + annotation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Switch configuration description.""" + rack_count: Optional[int] = rest_field(name="rackCount", visibility=["read", "create", "update", "delete", "query"]) + """Number of compute racks associated to Network Fabric.""" + server_count_per_rack: Optional[int] = rest_field( + name="serverCountPerRack", visibility=["read", "create", "update", "delete", "query"] + ) + """Number of servers.Possible values are from 1-16.""" + ipv4_prefix: Optional[str] = rest_field( + name="ipv4Prefix", visibility=["read", "create", "update", "delete", "query"] + ) + """IPv4Prefix for Management Network. Example: 10.1.0.0/19.""" + ipv6_prefix: Optional[str] = rest_field( + name="ipv6Prefix", visibility=["read", "create", "update", "delete", "query"] + ) + """IPv6Prefix for Management Network. Example: 3FFE:FFFF:0:CD40::/59.""" + fabric_asn: Optional[int] = rest_field(name="fabricASN", visibility=["read", "create", "update", "delete", "query"]) + """ASN of CE devices for CE/PE connectivity.""" + terminal_server_configuration: Optional["_models.TerminalServerPatchConfiguration"] = rest_field( + name="terminalServerConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Network and credentials configuration already applied to terminal server.""" + management_network_configuration: Optional["_models.ManagementNetworkPatchConfiguration"] = rest_field( + name="managementNetworkConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Configuration to be used to setup the management network.""" + storage_account_configuration: Optional["_models.StorageAccountPatchConfiguration"] = rest_field( + name="storageAccountConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Bring your own storage account configurations for Network Fabric.""" + hardware_alert_threshold: Optional[int] = rest_field( + name="hardwareAlertThreshold", visibility=["read", "create", "update", "delete", "query"] + ) + """Hardware alert threshold percentage. Possible values are from 20 to 100.""" + control_plane_acls: Optional[list[str]] = rest_field( + name="controlPlaneAcls", visibility=["read", "create", "update", "delete", "query"] + ) + """Control Plane Access Control List ARM resource IDs.""" + trusted_ip_prefixes: Optional[list[str]] = rest_field( + name="trustedIpPrefixes", visibility=["read", "create", "update", "delete", "query"] + ) + """Trusted IP Prefix ARM resource IDs.""" + unique_rd_configuration: Optional["_models.UniqueRouteDistinguisherPatchProperties"] = rest_field( + name="uniqueRdConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Unique Route Distinguisher configuration.""" + qos_configuration: Optional["_models.QosPatchProperties"] = rest_field( + name="qosConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """NetworkFabric QoS Configuration.""" + feature_flags: Optional[list["_models.FeatureFlagProperties"]] = rest_field( + name="featureFlags", visibility=["read", "create", "update", "delete", "query"] + ) + """NetworkFabric feature flag configuration information.""" + authorized_transceiver: Optional["_models.AuthorizedTransceiverPatchProperties"] = rest_field( + name="authorizedTransceiver", visibility=["read", "create", "update", "delete", "query"] + ) + """Authorized transciever configuration for NetworkFabric.""" + + @overload + def __init__( + self, + *, + annotation: Optional[str] = None, + rack_count: Optional[int] = None, + server_count_per_rack: Optional[int] = None, + ipv4_prefix: Optional[str] = None, + ipv6_prefix: Optional[str] = None, + fabric_asn: Optional[int] = None, + terminal_server_configuration: Optional["_models.TerminalServerPatchConfiguration"] = None, + management_network_configuration: Optional["_models.ManagementNetworkPatchConfiguration"] = None, + storage_account_configuration: Optional["_models.StorageAccountPatchConfiguration"] = None, + hardware_alert_threshold: Optional[int] = None, + control_plane_acls: Optional[list[str]] = None, + trusted_ip_prefixes: Optional[list[str]] = None, + unique_rd_configuration: Optional["_models.UniqueRouteDistinguisherPatchProperties"] = None, + qos_configuration: Optional["_models.QosPatchProperties"] = None, + feature_flags: Optional[list["_models.FeatureFlagProperties"]] = None, + authorized_transceiver: Optional["_models.AuthorizedTransceiverPatchProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkFabricProperties(AnnotationResource): + """Network Fabric Properties defines the properties of the resource. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar network_fabric_sku: Supported Network Fabric SKU.Example: Compute / Aggregate racks. Once + the user chooses a particular SKU, only supported racks can be added to the Network Fabric. The + SKU determines whether it is a single / multi rack Network Fabric. Required. + :vartype network_fabric_sku: str + :ivar fabric_version: The version of Network Fabric. + :vartype fabric_version: str + :ivar router_ids: Array of router IDs. + :vartype router_ids: list[str] + :ivar storage_account_configuration: Bring your own storage account configurations for Network + Fabric. + :vartype storage_account_configuration: + ~azure.mgmt.managednetworkfabric.models.StorageAccountConfiguration + :ivar fabric_locks: Network Fabric Lock details. + :vartype fabric_locks: list[~azure.mgmt.managednetworkfabric.models.FabricLockProperties] + :ivar network_fabric_controller_id: Azure resource ID for the NetworkFabricController the + NetworkFabric belongs. Required. + :vartype network_fabric_controller_id: str + :ivar rack_count: Number of compute racks associated to Network Fabric. + :vartype rack_count: int + :ivar server_count_per_rack: Number of servers.Possible values are from 1-16. Required. + :vartype server_count_per_rack: int + :ivar ipv4_prefix: IPv4Prefix for Management Network. Example: 10.1.0.0/19. Required. + :vartype ipv4_prefix: str + :ivar ipv6_prefix: IPv6Prefix for Management Network. Example: 3FFE:FFFF:0:CD40::/59. + :vartype ipv6_prefix: str + :ivar fabric_asn: ASN of CE devices for CE/PE connectivity. Required. + :vartype fabric_asn: int + :ivar terminal_server_configuration: Network and credentials configuration currently applied to + terminal server. Required. + :vartype terminal_server_configuration: + ~azure.mgmt.managednetworkfabric.models.TerminalServerConfiguration + :ivar management_network_configuration: Configuration to be used to setup the management + network. Required. + :vartype management_network_configuration: + ~azure.mgmt.managednetworkfabric.models.ManagementNetworkConfigurationProperties + :ivar racks: List of NetworkRack resource IDs under the Network Fabric. The number of racks + allowed depends on the Network Fabric SKU. + :vartype racks: list[str] + :ivar l2_isolation_domains: List of L2 Isolation Domain resource IDs under the Network Fabric. + :vartype l2_isolation_domains: list[str] + :ivar l3_isolation_domains: List of L3 Isolation Domain resource IDs under the Network Fabric. + :vartype l3_isolation_domains: list[str] + :ivar hardware_alert_threshold: Hardware alert threshold percentage. Possible values are from + 20 to 100. + :vartype hardware_alert_threshold: int + :ivar control_plane_acls: Control Plane Access Control List ARM resource IDs. + :vartype control_plane_acls: list[str] + :ivar feature_flags: NetworkFabric feature flag configuration information. + :vartype feature_flags: list[~azure.mgmt.managednetworkfabric.models.FeatureFlagProperties] + :ivar trusted_ip_prefixes: Trusted IP Prefixes ARM resource IDs. + :vartype trusted_ip_prefixes: list[str] + :ivar unique_rd_configuration: Unique Route Distinguisher configuration. + :vartype unique_rd_configuration: + ~azure.mgmt.managednetworkfabric.models.UniqueRouteDistinguisherProperties + :ivar storage_array_count: Number of Storage arrays associated with the Network Fabric. + :vartype storage_array_count: int + :ivar active_commit_batches: Active commit batch identifiers. + :vartype active_commit_batches: list[str] + :ivar secret_rotation_summary: Overview of secret rotation for the Network Fabric. + :vartype secret_rotation_summary: ~azure.mgmt.managednetworkfabric.models.SecretRotationSummary + :ivar last_operation: Details of the last operation performed on the resource. + :vartype last_operation: ~azure.mgmt.managednetworkfabric.models.LastOperationProperties + :ivar authorized_transceiver: Authorized transciever configuration for NetworkFabric. + :vartype authorized_transceiver: + ~azure.mgmt.managednetworkfabric.models.AuthorizedTransceiverProperties + :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", + "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", + "Deprovisioned", "ErrorDeprovisioning", "DeferredControl", "Provisioning", "PendingCommit", and + "PendingAdministrativeUpdate". + :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState + :ivar provisioning_state: Provides you the latest status of the NFC service, whether it is + Accepted, updating, Succeeded or Failed. During this process, the states keep changing based on + the status of NFC provisioning. Known values are: "Accepted", "Succeeded", "Updating", + "Deleting", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState + :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", + "Disabled", "MAT", "RMA", "UnderMaintenance", and "EnabledDegraded". + :vartype administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.AdministrativeState + :ivar qos_configuration: NetworkFabric QoS Configuration. + :vartype qos_configuration: ~azure.mgmt.managednetworkfabric.models.QosProperties + """ + + network_fabric_sku: str = rest_field(name="networkFabricSku", visibility=["read", "create"]) + """Supported Network Fabric SKU.Example: Compute / Aggregate racks. Once the user chooses a + particular SKU, only supported racks can be added to the Network Fabric. The SKU determines + whether it is a single / multi rack Network Fabric. Required.""" + fabric_version: Optional[str] = rest_field( + name="fabricVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """The version of Network Fabric.""" + router_ids: Optional[list[str]] = rest_field(name="routerIds", visibility=["read"]) + """Array of router IDs.""" + storage_account_configuration: Optional["_models.StorageAccountConfiguration"] = rest_field( + name="storageAccountConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Bring your own storage account configurations for Network Fabric.""" + fabric_locks: Optional[list["_models.FabricLockProperties"]] = rest_field(name="fabricLocks", visibility=["read"]) + """Network Fabric Lock details.""" + network_fabric_controller_id: str = rest_field(name="networkFabricControllerId", visibility=["read", "create"]) + """Azure resource ID for the NetworkFabricController the NetworkFabric belongs. Required.""" + rack_count: Optional[int] = rest_field(name="rackCount", visibility=["read", "create", "update", "delete", "query"]) + """Number of compute racks associated to Network Fabric.""" + server_count_per_rack: int = rest_field( + name="serverCountPerRack", visibility=["read", "create", "update", "delete", "query"] + ) + """Number of servers.Possible values are from 1-16. Required.""" + ipv4_prefix: str = rest_field(name="ipv4Prefix", visibility=["read", "create", "update", "delete", "query"]) + """IPv4Prefix for Management Network. Example: 10.1.0.0/19. Required.""" + ipv6_prefix: Optional[str] = rest_field( + name="ipv6Prefix", visibility=["read", "create", "update", "delete", "query"] + ) + """IPv6Prefix for Management Network. Example: 3FFE:FFFF:0:CD40::/59.""" + fabric_asn: int = rest_field(name="fabricASN", visibility=["read", "create", "update", "delete", "query"]) + """ASN of CE devices for CE/PE connectivity. Required.""" + terminal_server_configuration: "_models.TerminalServerConfiguration" = rest_field( + name="terminalServerConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Network and credentials configuration currently applied to terminal server. Required.""" + management_network_configuration: "_models.ManagementNetworkConfigurationProperties" = rest_field( + name="managementNetworkConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Configuration to be used to setup the management network. Required.""" + racks: Optional[list[str]] = rest_field(visibility=["read"]) + """List of NetworkRack resource IDs under the Network Fabric. The number of racks allowed depends + on the Network Fabric SKU.""" + l2_isolation_domains: Optional[list[str]] = rest_field(name="l2IsolationDomains", visibility=["read"]) + """List of L2 Isolation Domain resource IDs under the Network Fabric.""" + l3_isolation_domains: Optional[list[str]] = rest_field(name="l3IsolationDomains", visibility=["read"]) + """List of L3 Isolation Domain resource IDs under the Network Fabric.""" + hardware_alert_threshold: Optional[int] = rest_field( + name="hardwareAlertThreshold", visibility=["read", "create", "update", "delete", "query"] + ) + """Hardware alert threshold percentage. Possible values are from 20 to 100.""" + control_plane_acls: Optional[list[str]] = rest_field( + name="controlPlaneAcls", visibility=["read", "create", "update", "delete", "query"] + ) + """Control Plane Access Control List ARM resource IDs.""" + feature_flags: Optional[list["_models.FeatureFlagProperties"]] = rest_field( + name="featureFlags", visibility=["read", "create", "update", "delete", "query"] + ) + """NetworkFabric feature flag configuration information.""" + trusted_ip_prefixes: Optional[list[str]] = rest_field( + name="trustedIpPrefixes", visibility=["read", "create", "update", "delete", "query"] + ) + """Trusted IP Prefixes ARM resource IDs.""" + unique_rd_configuration: Optional["_models.UniqueRouteDistinguisherProperties"] = rest_field( + name="uniqueRdConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Unique Route Distinguisher configuration.""" + storage_array_count: Optional[int] = rest_field( + name="storageArrayCount", visibility=["read", "create", "update", "delete", "query"] + ) + """Number of Storage arrays associated with the Network Fabric.""" + active_commit_batches: Optional[list[str]] = rest_field(name="activeCommitBatches", visibility=["read"]) + """Active commit batch identifiers.""" + secret_rotation_summary: Optional["_models.SecretRotationSummary"] = rest_field( + name="secretRotationSummary", visibility=["read"] + ) + """Overview of secret rotation for the Network Fabric.""" + last_operation: Optional["_models.LastOperationProperties"] = rest_field(name="lastOperation", visibility=["read"]) + """Details of the last operation performed on the resource.""" + authorized_transceiver: Optional["_models.AuthorizedTransceiverProperties"] = rest_field( + name="authorizedTransceiver", visibility=["read", "create", "update", "delete", "query"] + ) + """Authorized transciever configuration for NetworkFabric.""" + configuration_state: Optional[Union[str, "_models.ConfigurationState"]] = rest_field( + name="configurationState", visibility=["read"] + ) + """Configuration state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Rejected\", + \"Accepted\", \"Provisioned\", \"ErrorProvisioning\", \"Deprovisioning\", \"Deprovisioned\", + \"ErrorDeprovisioning\", \"DeferredControl\", \"Provisioning\", \"PendingCommit\", and + \"PendingAdministrativeUpdate\".""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provides you the latest status of the NFC service, whether it is Accepted, updating, Succeeded + or Failed. During this process, the states keep changing based on the status of NFC + provisioning. Known values are: \"Accepted\", \"Succeeded\", \"Updating\", \"Deleting\", + \"Failed\", and \"Canceled\".""" + administrative_state: Optional[Union[str, "_models.AdministrativeState"]] = rest_field( + name="administrativeState", visibility=["read"] + ) + """Administrative state of the resource. Known values are: \"Enabled\", \"Disabled\", \"MAT\", + \"RMA\", \"UnderMaintenance\", and \"EnabledDegraded\".""" + qos_configuration: Optional["_models.QosProperties"] = rest_field( + name="qosConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """NetworkFabric QoS Configuration.""" + + @overload + def __init__( # pylint: disable=too-many-locals + self, + *, + network_fabric_sku: str, + network_fabric_controller_id: str, + server_count_per_rack: int, + ipv4_prefix: str, + fabric_asn: int, + terminal_server_configuration: "_models.TerminalServerConfiguration", + management_network_configuration: "_models.ManagementNetworkConfigurationProperties", + annotation: Optional[str] = None, + fabric_version: Optional[str] = None, + storage_account_configuration: Optional["_models.StorageAccountConfiguration"] = None, + rack_count: Optional[int] = None, + ipv6_prefix: Optional[str] = None, + hardware_alert_threshold: Optional[int] = None, + control_plane_acls: Optional[list[str]] = None, + feature_flags: Optional[list["_models.FeatureFlagProperties"]] = None, + trusted_ip_prefixes: Optional[list[str]] = None, + unique_rd_configuration: Optional["_models.UniqueRouteDistinguisherProperties"] = None, + storage_array_count: Optional[int] = None, + authorized_transceiver: Optional["_models.AuthorizedTransceiverProperties"] = None, + qos_configuration: Optional["_models.QosProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkFabricResyncCertificatesResponse(_Model): + """Response body for a ResyncCertificates request on a Network Fabric. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the async operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + percent_complete: Optional[float] = rest_field( + name="percentComplete", visibility=["read", "create", "update", "delete", "query"] + ) + """Percent of the operation that is complete.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the operation.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the operation.""" + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operations list.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If present, details of the operation error.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + + @overload + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkFabricResyncPasswordsResponse(_Model): + """Response body for a ResyncPasswords request on a Network Fabric. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the async operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + percent_complete: Optional[float] = rest_field( + name="percentComplete", visibility=["read", "create", "update", "delete", "query"] + ) + """Percent of the operation that is complete.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the operation.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the operation.""" + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operations list.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If present, details of the operation error.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + + @overload + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkFabricRotateCertificatesResponse(_Model): + """Response body for a RotateCertificates request on a Network Fabric. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the async operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + percent_complete: Optional[float] = rest_field( + name="percentComplete", visibility=["read", "create", "update", "delete", "query"] + ) + """Percent of the operation that is complete.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the operation.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the operation.""" + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operations list.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If present, details of the operation error.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + + @overload + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkFabricRotatePasswordsResponse(_Model): + """Response body for a RotatePasswords request on a Network Fabric. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the async operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + percent_complete: Optional[float] = rest_field( + name="percentComplete", visibility=["read", "create", "update", "delete", "query"] + ) + """Percent of the operation that is complete.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the operation.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the operation.""" + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operations list.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If present, details of the operation error.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + + @overload + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkFabricSku(ProxyResource): + """The Network Fabric SKU resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + :ivar properties: The Network Fabric SKU properties. Required. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.NetworkFabricSkuProperties + """ + + properties: "_models.NetworkFabricSkuProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The Network Fabric SKU properties. Required.""" + + __flattened_items = [ + "type", + "max_compute_racks", + "maximum_server_count", + "supported_versions", + "details", + "provisioning_state", + ] + + @overload + def __init__( + self, + *, + properties: "_models.NetworkFabricSkuProperties", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class NetworkFabricSkuProperties(_Model): + """Network Fabric SKU Properties define properties of the resource. + + :ivar type: Type of Network Fabric SKU. Known values are: "SingleRack" and "MultiRack". + :vartype type: str or ~azure.mgmt.managednetworkfabric.models.FabricSkuType + :ivar max_compute_racks: Maximum number of compute racks available for this Network Fabric SKU. + The value of max count racks is 4 for 4 rack SKU and 8 for 8 rack SKU. + :vartype max_compute_racks: int + :ivar maximum_server_count: Maximum number of servers available for this Network Fabric SKU. + :vartype maximum_server_count: int + :ivar supported_versions: List of supported Network Fabric SKU versions. + :vartype supported_versions: list[str] + :ivar details: URL providing detailed configuration of the fabric SKU. + :vartype details: str + :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", + "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState + """ + + type: Optional[Union[str, "_models.FabricSkuType"]] = rest_field(visibility=["read"]) + """Type of Network Fabric SKU. Known values are: \"SingleRack\" and \"MultiRack\".""" + max_compute_racks: Optional[int] = rest_field( + name="maxComputeRacks", visibility=["read", "create", "update", "delete", "query"] + ) + """Maximum number of compute racks available for this Network Fabric SKU. The value of max count + racks is 4 for 4 rack SKU and 8 for 8 rack SKU.""" + maximum_server_count: Optional[int] = rest_field( + name="maximumServerCount", visibility=["read", "create", "update", "delete", "query"] + ) + """Maximum number of servers available for this Network Fabric SKU.""" + supported_versions: Optional[list[str]] = rest_field(name="supportedVersions", visibility=["read"]) + """List of supported Network Fabric SKU versions.""" + details: Optional[str] = rest_field(visibility=["read"]) + """URL providing detailed configuration of the fabric SKU.""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the resource. Known values are: \"Accepted\", \"Succeeded\", + \"Updating\", \"Deleting\", \"Failed\", and \"Canceled\".""" + + @overload + def __init__( + self, + *, + max_compute_racks: Optional[int] = None, + maximum_server_count: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkInterface(ProxyResource): + """Defines the NetworkInterface resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + :ivar properties: The NetworkInterface properties. Required. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.NetworkInterfaceProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.managednetworkfabric.models.ManagedServiceIdentity + """ + + properties: "_models.NetworkInterfaceProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The NetworkInterface properties. Required.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + __flattened_items = [ + "annotation", + "physical_identifier", + "connected_to", + "interface_type", + "ipv4_address", + "ipv6_address", + "description", + "additional_description", + "last_operation", + "network_fabric_id", + "provisioning_state", + "administrative_state", + "configuration_state", + ] + + @overload + def __init__( + self, + *, + properties: "_models.NetworkInterfaceProperties", + identity: Optional["_models.ManagedServiceIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class NetworkInterfacePatch(_Model): + """The NetworkInterfacePatch resource definition. + + :ivar properties: Network Interface Patch properties. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.NetworkInterfacePatchProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.managednetworkfabric.models.ManagedServiceIdentityPatch + """ + + properties: Optional["_models.NetworkInterfacePatchProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Network Interface Patch properties.""" + identity: Optional["_models.ManagedServiceIdentityPatch"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + __flattened_items = ["annotation", "additional_description"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.NetworkInterfacePatchProperties"] = None, + identity: Optional["_models.ManagedServiceIdentityPatch"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class NetworkInterfacePatchProperties(AnnotationResource): + """Network Interface Patch properties. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar additional_description: Additional description of the interface. + :vartype additional_description: str + """ + + additional_description: Optional[str] = rest_field( + name="additionalDescription", visibility=["read", "create", "update", "delete", "query"] + ) + """Additional description of the interface.""" + + @overload + def __init__( + self, + *, + annotation: Optional[str] = None, + additional_description: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkInterfaceProperties(AnnotationResource): + """Network Interface Properties defines the properties of the resource. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar physical_identifier: Physical Identifier of the network interface. + :vartype physical_identifier: str + :ivar connected_to: The ARM resource id of the interface or compute server its connected to. + :vartype connected_to: str + :ivar interface_type: The Interface Type. Example: Management/Data. Known values are: + "Management" and "Data". + :vartype interface_type: str or ~azure.mgmt.managednetworkfabric.models.InterfaceType + :ivar ipv4_address: IPv4Address of the interface. + :vartype ipv4_address: str + :ivar ipv6_address: IPv6Address of the interface. + :vartype ipv6_address: str + :ivar description: Description of the interface. + :vartype description: str + :ivar additional_description: Additional description of the interface. + :vartype additional_description: str + :ivar last_operation: Details of the last operation performed on the resource. + :vartype last_operation: ~azure.mgmt.managednetworkfabric.models.LastOperationProperties + :ivar network_fabric_id: Associated Network Fabric Resource ID. + :vartype network_fabric_id: str + :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", + "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState + :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", + "Disabled", "MAT", "RMA", "UnderMaintenance", and "EnabledDegraded". + :vartype administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.AdministrativeState + :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", + "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", + "Deprovisioned", "ErrorDeprovisioning", "DeferredControl", "Provisioning", "PendingCommit", and + "PendingAdministrativeUpdate". + :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState + """ + + physical_identifier: Optional[str] = rest_field(name="physicalIdentifier", visibility=["read"]) + """Physical Identifier of the network interface.""" + connected_to: Optional[str] = rest_field(name="connectedTo", visibility=["read"]) + """The ARM resource id of the interface or compute server its connected to.""" + interface_type: Optional[Union[str, "_models.InterfaceType"]] = rest_field( + name="interfaceType", visibility=["read"] + ) + """The Interface Type. Example: Management/Data. Known values are: \"Management\" and \"Data\".""" + ipv4_address: Optional[str] = rest_field(name="ipv4Address", visibility=["read"]) + """IPv4Address of the interface.""" + ipv6_address: Optional[str] = rest_field(name="ipv6Address", visibility=["read"]) + """IPv6Address of the interface.""" + description: Optional[str] = rest_field(visibility=["read"]) + """Description of the interface.""" + additional_description: Optional[str] = rest_field( + name="additionalDescription", visibility=["read", "create", "update", "delete", "query"] + ) + """Additional description of the interface.""" + last_operation: Optional["_models.LastOperationProperties"] = rest_field(name="lastOperation", visibility=["read"]) + """Details of the last operation performed on the resource.""" + network_fabric_id: Optional[str] = rest_field(name="networkFabricId", visibility=["read"]) + """Associated Network Fabric Resource ID.""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the resource. Known values are: \"Accepted\", \"Succeeded\", + \"Updating\", \"Deleting\", \"Failed\", and \"Canceled\".""" + administrative_state: Optional[Union[str, "_models.AdministrativeState"]] = rest_field( + name="administrativeState", visibility=["read"] + ) + """Administrative state of the resource. Known values are: \"Enabled\", \"Disabled\", \"MAT\", + \"RMA\", \"UnderMaintenance\", and \"EnabledDegraded\".""" + configuration_state: Optional[Union[str, "_models.ConfigurationState"]] = rest_field( + name="configurationState", visibility=["read"] + ) + """Configuration state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Rejected\", + \"Accepted\", \"Provisioned\", \"ErrorProvisioning\", \"Deprovisioning\", \"Deprovisioned\", + \"ErrorDeprovisioning\", \"DeferredControl\", \"Provisioning\", \"PendingCommit\", and + \"PendingAdministrativeUpdate\".""" + + @overload + def __init__( + self, + *, + annotation: Optional[str] = None, + additional_description: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkMonitor(TrackedResource): + """The NetworkMonitor resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The NetworkMonitor properties. Required. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.NetworkMonitorProperties + """ + + properties: "_models.NetworkMonitorProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The NetworkMonitor properties. Required.""" + + __flattened_items = [ + "annotation", + "bmp_configuration", + "last_operation", + "configuration_state", + "provisioning_state", + "administrative_state", + ] + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.NetworkMonitorProperties", + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class NetworkMonitorPatch(TagsUpdate): + """The Network Monitor Patch resource definition. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: Network Monitor Patch properties. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.NetworkMonitorPatchProperties + """ + + properties: Optional["_models.NetworkMonitorPatchProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Network Monitor Patch properties.""" + + __flattened_items = ["bmp_configuration"] + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.NetworkMonitorPatchProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class NetworkMonitorPatchProperties(_Model): + """The Network Monitor Patch Properties. + + :ivar bmp_configuration: BGP Monitoring Protocol (BMP) Configurations for the Network Monitor. + :vartype bmp_configuration: + ~azure.mgmt.managednetworkfabric.models.BmpConfigurationPatchProperties + """ + + bmp_configuration: Optional["_models.BmpConfigurationPatchProperties"] = rest_field( + name="bmpConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """BGP Monitoring Protocol (BMP) Configurations for the Network Monitor.""" + + @overload + def __init__( + self, + *, + bmp_configuration: Optional["_models.BmpConfigurationPatchProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkMonitorProperties(AnnotationResource): + """Network Monitor Properties defines the properties of the resource. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar bmp_configuration: BMP Configurations for the Network Fabric. + :vartype bmp_configuration: ~azure.mgmt.managednetworkfabric.models.BmpConfigurationProperties + :ivar last_operation: Details of the last operation performed on the resource. + :vartype last_operation: ~azure.mgmt.managednetworkfabric.models.LastOperationProperties + :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", + "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", + "Deprovisioned", "ErrorDeprovisioning", "DeferredControl", "Provisioning", "PendingCommit", and + "PendingAdministrativeUpdate". + :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState + :ivar provisioning_state: Provides you the latest status of the NetworkMonitor resource. Known + values are: "Accepted", "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState + :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", + "Disabled", "MAT", "RMA", "UnderMaintenance", and "EnabledDegraded". + :vartype administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.AdministrativeState + """ + + bmp_configuration: Optional["_models.BmpConfigurationProperties"] = rest_field( + name="bmpConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """BMP Configurations for the Network Fabric.""" + last_operation: Optional["_models.LastOperationProperties"] = rest_field(name="lastOperation", visibility=["read"]) + """Details of the last operation performed on the resource.""" + configuration_state: Optional[Union[str, "_models.ConfigurationState"]] = rest_field( + name="configurationState", visibility=["read"] + ) + """Configuration state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Rejected\", + \"Accepted\", \"Provisioned\", \"ErrorProvisioning\", \"Deprovisioning\", \"Deprovisioned\", + \"ErrorDeprovisioning\", \"DeferredControl\", \"Provisioning\", \"PendingCommit\", and + \"PendingAdministrativeUpdate\".""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provides you the latest status of the NetworkMonitor resource. Known values are: \"Accepted\", + \"Succeeded\", \"Updating\", \"Deleting\", \"Failed\", and \"Canceled\".""" + administrative_state: Optional[Union[str, "_models.AdministrativeState"]] = rest_field( + name="administrativeState", visibility=["read"] + ) + """Administrative state of the resource. Known values are: \"Enabled\", \"Disabled\", \"MAT\", + \"RMA\", \"UnderMaintenance\", and \"EnabledDegraded\".""" + + @overload + def __init__( + self, + *, + annotation: Optional[str] = None, + bmp_configuration: Optional["_models.BmpConfigurationProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkPacketBroker(TrackedResource): + """The NetworkPacketBroker resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The NetworkPacketBroker properties. Required. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.NetworkPacketBrokerProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.managednetworkfabric.models.ManagedServiceIdentity + """ + + properties: "_models.NetworkPacketBrokerProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The NetworkPacketBroker properties. Required.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + __flattened_items = [ + "network_fabric_id", + "network_device_ids", + "source_interface_ids", + "network_tap_ids", + "neighbor_group_ids", + "last_operation", + "provisioning_state", + "configuration_state", + ] + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.NetworkPacketBrokerProperties", + tags: Optional[dict[str, str]] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class NetworkPacketBrokerPatch(TagsUpdate): + """The NetworkPacketBroker patch resource definition. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.managednetworkfabric.models.ManagedServiceIdentityPatch + """ + + identity: Optional["_models.ManagedServiceIdentityPatch"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + identity: Optional["_models.ManagedServiceIdentityPatch"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkPacketBrokerProperties(_Model): + """Network Packet Broker Properties defines the properties of the resource. + + :ivar network_fabric_id: ARM resource ID of the Network Fabric. Required. + :vartype network_fabric_id: str + :ivar network_device_ids: List of ARM resource IDs of Network Devices [NPB]. + :vartype network_device_ids: list[str] + :ivar source_interface_ids: List of network interfaces across NPB devices that are used to + mirror source traffic. + :vartype source_interface_ids: list[str] + :ivar network_tap_ids: List of network Tap IDs configured on NPB. + :vartype network_tap_ids: list[str] + :ivar neighbor_group_ids: List of neighbor group IDs configured on NPB. + :vartype neighbor_group_ids: list[str] + :ivar last_operation: Details of the last operation performed on the resource. + :vartype last_operation: ~azure.mgmt.managednetworkfabric.models.LastOperationProperties + :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", + "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState + :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", + "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", + "Deprovisioned", "ErrorDeprovisioning", "DeferredControl", "Provisioning", "PendingCommit", and + "PendingAdministrativeUpdate". + :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState + """ + + network_fabric_id: str = rest_field(name="networkFabricId", visibility=["read", "create"]) + """ARM resource ID of the Network Fabric. Required.""" + network_device_ids: Optional[list[str]] = rest_field(name="networkDeviceIds", visibility=["read"]) + """List of ARM resource IDs of Network Devices [NPB].""" + source_interface_ids: Optional[list[str]] = rest_field(name="sourceInterfaceIds", visibility=["read"]) + """List of network interfaces across NPB devices that are used to mirror source traffic.""" + network_tap_ids: Optional[list[str]] = rest_field(name="networkTapIds", visibility=["read"]) + """List of network Tap IDs configured on NPB.""" + neighbor_group_ids: Optional[list[str]] = rest_field(name="neighborGroupIds", visibility=["read"]) + """List of neighbor group IDs configured on NPB.""" + last_operation: Optional["_models.LastOperationProperties"] = rest_field(name="lastOperation", visibility=["read"]) + """Details of the last operation performed on the resource.""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the resource. Known values are: \"Accepted\", \"Succeeded\", + \"Updating\", \"Deleting\", \"Failed\", and \"Canceled\".""" + configuration_state: Optional[Union[str, "_models.ConfigurationState"]] = rest_field( + name="configurationState", visibility=["read"] + ) + """Configuration state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Rejected\", + \"Accepted\", \"Provisioned\", \"ErrorProvisioning\", \"Deprovisioning\", \"Deprovisioned\", + \"ErrorDeprovisioning\", \"DeferredControl\", \"Provisioning\", \"PendingCommit\", and + \"PendingAdministrativeUpdate\".""" + + @overload + def __init__( + self, + *, + network_fabric_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkRack(TrackedResource): + """The Network Rack resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: Network Rack Properties. Required. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.NetworkRackProperties + """ + + properties: "_models.NetworkRackProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Network Rack Properties. Required.""" + + __flattened_items = [ + "annotation", + "network_rack_type", + "network_fabric_id", + "network_devices", + "last_operation", + "provisioning_state", + "configuration_state", + ] + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.NetworkRackProperties", + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class NetworkRackPatch(_Model): + """Network Rack patch resource definition. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkRackProperties(AnnotationResource): + """Network Rack Properties defines the properties of the resource. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar network_rack_type: Network Rack SKU name. Known values are: "Aggregate", "Compute", and + "Combined". + :vartype network_rack_type: str or ~azure.mgmt.managednetworkfabric.models.NetworkRackType + :ivar network_fabric_id: ARM resource ID of the Network Fabric. Required. + :vartype network_fabric_id: str + :ivar network_devices: List of network device ARM resource IDs. + :vartype network_devices: list[str] + :ivar last_operation: Details of the last operation performed on the resource. + :vartype last_operation: ~azure.mgmt.managednetworkfabric.models.LastOperationProperties + :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", + "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState + :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", + "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", + "Deprovisioned", "ErrorDeprovisioning", "DeferredControl", "Provisioning", "PendingCommit", and + "PendingAdministrativeUpdate". + :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState + """ + + network_rack_type: Optional[Union[str, "_models.NetworkRackType"]] = rest_field( + name="networkRackType", visibility=["read", "create", "update", "delete", "query"] + ) + """Network Rack SKU name. Known values are: \"Aggregate\", \"Compute\", and \"Combined\".""" + network_fabric_id: str = rest_field( + name="networkFabricId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM resource ID of the Network Fabric. Required.""" + network_devices: Optional[list[str]] = rest_field(name="networkDevices", visibility=["read"]) + """List of network device ARM resource IDs.""" + last_operation: Optional["_models.LastOperationProperties"] = rest_field(name="lastOperation", visibility=["read"]) + """Details of the last operation performed on the resource.""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the resource. Known values are: \"Accepted\", \"Succeeded\", + \"Updating\", \"Deleting\", \"Failed\", and \"Canceled\".""" + configuration_state: Optional[Union[str, "_models.ConfigurationState"]] = rest_field( + name="configurationState", visibility=["read"] + ) + """Configuration state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Rejected\", + \"Accepted\", \"Provisioned\", \"ErrorProvisioning\", \"Deprovisioning\", \"Deprovisioned\", + \"ErrorDeprovisioning\", \"DeferredControl\", \"Provisioning\", \"PendingCommit\", and + \"PendingAdministrativeUpdate\".""" + + @overload + def __init__( + self, + *, + network_fabric_id: str, + annotation: Optional[str] = None, + network_rack_type: Optional[Union[str, "_models.NetworkRackType"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkTap(TrackedResource): + """The Network Tap resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The NetworkTap Properties. Required. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.NetworkTapProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.managednetworkfabric.models.ManagedServiceIdentity + """ + + properties: "_models.NetworkTapProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The NetworkTap Properties. Required.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + __flattened_items = [ + "annotation", + "network_packet_broker_id", + "source_tap_rule_id", + "network_fabric_ids", + "destinations", + "polling_type", + "last_operation", + "configuration_state", + "provisioning_state", + "administrative_state", + ] + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.NetworkTapProperties", + tags: Optional[dict[str, str]] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class NetworkTapPatch(TagsUpdate): + """The NetworkFabric resource definition. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: NetworkTap resource patch properties. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.NetworkTapPatchProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.managednetworkfabric.models.ManagedServiceIdentityPatch + """ + + properties: Optional["_models.NetworkTapPatchProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """NetworkTap resource patch properties.""" + identity: Optional["_models.ManagedServiceIdentityPatch"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + __flattened_items = ["annotation", "polling_type", "destinations"] + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.NetworkTapPatchProperties"] = None, + identity: Optional["_models.ManagedServiceIdentityPatch"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class NetworkTapPatchProperties(AnnotationResource): + """The Network Tap resource patch definition. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar polling_type: Polling type. Known values are: "Pull" and "Push". + :vartype polling_type: str or ~azure.mgmt.managednetworkfabric.models.PollingType + :ivar destinations: List of destination properties to send the filter traffic. + :vartype destinations: list[~azure.mgmt.managednetworkfabric.models.DestinationPatchProperties] + """ + + polling_type: Optional[Union[str, "_models.PollingType"]] = rest_field( + name="pollingType", visibility=["read", "create", "update", "delete", "query"] + ) + """Polling type. Known values are: \"Pull\" and \"Push\".""" + destinations: Optional[list["_models.DestinationPatchProperties"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of destination properties to send the filter traffic.""" + + @overload + def __init__( + self, + *, + annotation: Optional[str] = None, + polling_type: Optional[Union[str, "_models.PollingType"]] = None, + destinations: Optional[list["_models.DestinationPatchProperties"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkTapProperties(AnnotationResource): + """Network Tap Properties defines the properties of the resource. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar network_packet_broker_id: ARM resource ID of the Network Packet Broker. Required. + :vartype network_packet_broker_id: str + :ivar source_tap_rule_id: Source Tap Rule Id. ARM Resource ID of the Network Tap Rule. + :vartype source_tap_rule_id: str + :ivar network_fabric_ids: Associated Network Fabric Resource IDs. + :vartype network_fabric_ids: list[str] + :ivar destinations: List of destinations to send the filter traffic. Required. + :vartype destinations: list[~azure.mgmt.managednetworkfabric.models.DestinationProperties] + :ivar polling_type: Polling type. Known values are: "Pull" and "Push". + :vartype polling_type: str or ~azure.mgmt.managednetworkfabric.models.PollingType + :ivar last_operation: Details of the last operation performed on the resource. + :vartype last_operation: ~azure.mgmt.managednetworkfabric.models.LastOperationProperties + :ivar configuration_state: Gets the configurations state of the resource. Known values are: + "Succeeded", "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", + "Deprovisioning", "Deprovisioned", "ErrorDeprovisioning", "DeferredControl", "Provisioning", + "PendingCommit", and "PendingAdministrativeUpdate". + :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState + :ivar provisioning_state: Provides you the latest status of the NFC service, whether it is + Accepted, updating, Succeeded or Failed. During this process, the states keep changing based on + the status of Network Tap provisioning. Known values are: "Accepted", "Succeeded", "Updating", + "Deleting", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState + :ivar administrative_state: Administrative state of the resource. Example -Enabled/Disabled. + Known values are: "Enabled", "Disabled", "MAT", "RMA", "UnderMaintenance", and + "EnabledDegraded". + :vartype administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.AdministrativeState + """ + + network_packet_broker_id: str = rest_field(name="networkPacketBrokerId", visibility=["read", "create"]) + """ARM resource ID of the Network Packet Broker. Required.""" + source_tap_rule_id: Optional[str] = rest_field(name="sourceTapRuleId", visibility=["read"]) + """Source Tap Rule Id. ARM Resource ID of the Network Tap Rule.""" + network_fabric_ids: Optional[list[str]] = rest_field(name="networkFabricIds", visibility=["read"]) + """Associated Network Fabric Resource IDs.""" + destinations: list["_models.DestinationProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of destinations to send the filter traffic. Required.""" + polling_type: Optional[Union[str, "_models.PollingType"]] = rest_field( + name="pollingType", visibility=["read", "create", "update", "delete", "query"] + ) + """Polling type. Known values are: \"Pull\" and \"Push\".""" + last_operation: Optional["_models.LastOperationProperties"] = rest_field(name="lastOperation", visibility=["read"]) + """Details of the last operation performed on the resource.""" + configuration_state: Optional[Union[str, "_models.ConfigurationState"]] = rest_field( + name="configurationState", visibility=["read"] + ) + """Gets the configurations state of the resource. Known values are: \"Succeeded\", \"Failed\", + \"Rejected\", \"Accepted\", \"Provisioned\", \"ErrorProvisioning\", \"Deprovisioning\", + \"Deprovisioned\", \"ErrorDeprovisioning\", \"DeferredControl\", \"Provisioning\", + \"PendingCommit\", and \"PendingAdministrativeUpdate\".""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provides you the latest status of the NFC service, whether it is Accepted, updating, Succeeded + or Failed. During this process, the states keep changing based on the status of Network Tap + provisioning. Known values are: \"Accepted\", \"Succeeded\", \"Updating\", \"Deleting\", + \"Failed\", and \"Canceled\".""" + administrative_state: Optional[Union[str, "_models.AdministrativeState"]] = rest_field( + name="administrativeState", visibility=["read"] + ) + """Administrative state of the resource. Example -Enabled/Disabled. Known values are: \"Enabled\", + \"Disabled\", \"MAT\", \"RMA\", \"UnderMaintenance\", and \"EnabledDegraded\".""" + + @overload + def __init__( + self, + *, + network_packet_broker_id: str, + destinations: list["_models.DestinationProperties"], + annotation: Optional[str] = None, + polling_type: Optional[Union[str, "_models.PollingType"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkTapResyncResponse(_Model): + """Response for NetworkTap Resync operation. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the async operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + percent_complete: Optional[float] = rest_field( + name="percentComplete", visibility=["read", "create", "update", "delete", "query"] + ) + """Percent of the operation that is complete.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the operation.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the operation.""" + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operations list.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If present, details of the operation error.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + + @overload + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkTapRule(TrackedResource): + """The NetworkTapRule resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The NetworkTapRule Properties. Required. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.NetworkTapRuleProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.managednetworkfabric.models.ManagedServiceIdentity + """ + + properties: "_models.NetworkTapRuleProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The NetworkTapRule Properties. Required.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + __flattened_items = [ + "annotation", + "configuration_type", + "tap_rules_url", + "identity_selector", + "match_configurations", + "dynamic_match_configurations", + "network_tap_id", + "network_tap_ids", + "polling_interval_in_seconds", + "last_synced_time", + "global_network_tap_rule_actions", + "last_operation", + "network_fabric_ids", + "configuration_state", + "provisioning_state", + "administrative_state", + ] + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.NetworkTapRuleProperties", + tags: Optional[dict[str, str]] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class NetworkTapRuleAction(_Model): + """Action that need to performed. + + :ivar type: Type of actions that can be performed. Known values are: "Drop", "Count", "Log", + "Replicate", "Goto", "Redirect", and "Mirror". + :vartype type: str or ~azure.mgmt.managednetworkfabric.models.TapRuleActionType + :ivar truncate: Truncate. 0 indicates do not truncate. + :vartype truncate: str + :ivar is_timestamp_enabled: The parameter to enable or disable the timestamp. Known values are: + "True" and "False". + :vartype is_timestamp_enabled: str or + ~azure.mgmt.managednetworkfabric.models.BooleanEnumProperty + :ivar destination_id: Destination Id. The ARM resource Id may be either Network To Network + Interconnect or NeighborGroup. + :vartype destination_id: str + :ivar match_configuration_name: The name of the match configuration. This is used when Goto + type is provided. + :vartype match_configuration_name: str + """ + + type: Optional[Union[str, "_models.TapRuleActionType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Type of actions that can be performed. Known values are: \"Drop\", \"Count\", \"Log\", + \"Replicate\", \"Goto\", \"Redirect\", and \"Mirror\".""" + truncate: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Truncate. 0 indicates do not truncate.""" + is_timestamp_enabled: Optional[Union[str, "_models.BooleanEnumProperty"]] = rest_field( + name="isTimestampEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """The parameter to enable or disable the timestamp. Known values are: \"True\" and \"False\".""" + destination_id: Optional[str] = rest_field( + name="destinationId", visibility=["read", "create", "update", "delete", "query"] + ) + """Destination Id. The ARM resource Id may be either Network To Network Interconnect or + NeighborGroup.""" + match_configuration_name: Optional[str] = rest_field( + name="matchConfigurationName", visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the match configuration. This is used when Goto type is provided.""" + + @overload + def __init__( + self, + *, + type: Optional[Union[str, "_models.TapRuleActionType"]] = None, + truncate: Optional[str] = None, + is_timestamp_enabled: Optional[Union[str, "_models.BooleanEnumProperty"]] = None, + destination_id: Optional[str] = None, + match_configuration_name: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkTapRuleActionPatch(_Model): + """Action that need to performed. + + :ivar type: Type of actions that can be performed. Known values are: "Drop", "Count", "Log", + "Replicate", "Goto", "Redirect", and "Mirror". + :vartype type: str or ~azure.mgmt.managednetworkfabric.models.TapRuleActionType + :ivar truncate: Truncate. 0 indicates do not truncate. + :vartype truncate: str + :ivar is_timestamp_enabled: The parameter to enable or disable the timestamp. Known values are: + "True" and "False". + :vartype is_timestamp_enabled: str or + ~azure.mgmt.managednetworkfabric.models.BooleanEnumProperty + :ivar destination_id: Destination Id. The ARM resource Id may be either Network To Network + Interconnect or NeighborGroup. + :vartype destination_id: str + :ivar match_configuration_name: The name of the match configuration. This is used when Goto + type is provided. + :vartype match_configuration_name: str + """ + + type: Optional[Union[str, "_models.TapRuleActionType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Type of actions that can be performed. Known values are: \"Drop\", \"Count\", \"Log\", + \"Replicate\", \"Goto\", \"Redirect\", and \"Mirror\".""" + truncate: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Truncate. 0 indicates do not truncate.""" + is_timestamp_enabled: Optional[Union[str, "_models.BooleanEnumProperty"]] = rest_field( + name="isTimestampEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """The parameter to enable or disable the timestamp. Known values are: \"True\" and \"False\".""" + destination_id: Optional[str] = rest_field( + name="destinationId", visibility=["read", "create", "update", "delete", "query"] + ) + """Destination Id. The ARM resource Id may be either Network To Network Interconnect or + NeighborGroup.""" + match_configuration_name: Optional[str] = rest_field( + name="matchConfigurationName", visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the match configuration. This is used when Goto type is provided.""" + + @overload + def __init__( + self, + *, + type: Optional[Union[str, "_models.TapRuleActionType"]] = None, + truncate: Optional[str] = None, + is_timestamp_enabled: Optional[Union[str, "_models.BooleanEnumProperty"]] = None, + destination_id: Optional[str] = None, + match_configuration_name: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkTapRuleMatchCondition(CommonMatchConditions): + """Defines the match condition that is supported to filter the traffic. + + :ivar protocol_types: List of the protocols that need to be matched. + :vartype protocol_types: list[str] + :ivar vlan_match_condition: Vlan match condition that needs to be matched. + :vartype vlan_match_condition: ~azure.mgmt.managednetworkfabric.models.VlanMatchCondition + :ivar ip_condition: IP condition that needs to be matched. + :vartype ip_condition: ~azure.mgmt.managednetworkfabric.models.IpMatchCondition + :ivar encapsulation_type: Encapsulation Type that needs to be matched. Known values are: "None" + and "GTPv1". + :vartype encapsulation_type: str or ~azure.mgmt.managednetworkfabric.models.EncapsulationType + :ivar port_condition: Defines the port condition that needs to be matched. + :vartype port_condition: ~azure.mgmt.managednetworkfabric.models.PortCondition + """ + + encapsulation_type: Optional[Union[str, "_models.EncapsulationType"]] = rest_field( + name="encapsulationType", visibility=["read", "create", "update", "delete", "query"] + ) + """Encapsulation Type that needs to be matched. Known values are: \"None\" and \"GTPv1\".""" + port_condition: Optional["_models.PortCondition"] = rest_field( + name="portCondition", visibility=["read", "create", "update", "delete", "query"] + ) + """Defines the port condition that needs to be matched.""" + + @overload + def __init__( + self, + *, + protocol_types: Optional[list[str]] = None, + vlan_match_condition: Optional["_models.VlanMatchCondition"] = None, + ip_condition: Optional["_models.IpMatchCondition"] = None, + encapsulation_type: Optional[Union[str, "_models.EncapsulationType"]] = None, + port_condition: Optional["_models.PortCondition"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkTapRuleMatchConditionPatch(CommonMatchConditionsPatch): + """Defines the match condition that is supported to filter the traffic. + + :ivar protocol_types: List of the protocols that need to be matched. + :vartype protocol_types: list[str] + :ivar vlan_match_condition: Vlan match condition that needs to be matched. + :vartype vlan_match_condition: ~azure.mgmt.managednetworkfabric.models.VlanMatchConditionPatch + :ivar ip_condition: IP condition that needs to be matched. + :vartype ip_condition: ~azure.mgmt.managednetworkfabric.models.IpMatchConditionPatch + :ivar encapsulation_type: Encapsulation Type that needs to be matched. Known values are: "None" + and "GTPv1". + :vartype encapsulation_type: str or ~azure.mgmt.managednetworkfabric.models.EncapsulationType + :ivar port_condition: Defines the port condition that needs to be matched. + :vartype port_condition: ~azure.mgmt.managednetworkfabric.models.PortConditionPatch + """ + + encapsulation_type: Optional[Union[str, "_models.EncapsulationType"]] = rest_field( + name="encapsulationType", visibility=["read", "create", "update", "delete", "query"] + ) + """Encapsulation Type that needs to be matched. Known values are: \"None\" and \"GTPv1\".""" + port_condition: Optional["_models.PortConditionPatch"] = rest_field( + name="portCondition", visibility=["read", "create", "update", "delete", "query"] + ) + """Defines the port condition that needs to be matched.""" + + @overload + def __init__( + self, + *, + protocol_types: Optional[list[str]] = None, + vlan_match_condition: Optional["_models.VlanMatchConditionPatch"] = None, + ip_condition: Optional["_models.IpMatchConditionPatch"] = None, + encapsulation_type: Optional[Union[str, "_models.EncapsulationType"]] = None, + port_condition: Optional["_models.PortConditionPatch"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkTapRuleMatchConfiguration(_Model): + """Defines the match configuration that are supported to filter the traffic. + + :ivar match_configuration_name: The name of the match configuration. + :vartype match_configuration_name: str + :ivar sequence_number: Sequence Number of the match configuration.. + :vartype sequence_number: int + :ivar ip_address_type: Type of IP Address. IPv4 or IPv6. Known values are: "IPv4" and "IPv6". + :vartype ip_address_type: str or ~azure.mgmt.managednetworkfabric.models.IPAddressType + :ivar match_conditions: List of the match conditions. + :vartype match_conditions: + list[~azure.mgmt.managednetworkfabric.models.NetworkTapRuleMatchCondition] + :ivar actions: List of actions that need to be performed for the matched conditions. + :vartype actions: list[~azure.mgmt.managednetworkfabric.models.NetworkTapRuleAction] + """ + + match_configuration_name: Optional[str] = rest_field( + name="matchConfigurationName", visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the match configuration.""" + sequence_number: Optional[int] = rest_field( + name="sequenceNumber", visibility=["read", "create", "update", "delete", "query"] + ) + """Sequence Number of the match configuration..""" + ip_address_type: Optional[Union[str, "_models.IPAddressType"]] = rest_field( + name="ipAddressType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of IP Address. IPv4 or IPv6. Known values are: \"IPv4\" and \"IPv6\".""" + match_conditions: Optional[list["_models.NetworkTapRuleMatchCondition"]] = rest_field( + name="matchConditions", visibility=["read", "create", "update", "delete", "query"] + ) + """List of the match conditions.""" + actions: Optional[list["_models.NetworkTapRuleAction"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of actions that need to be performed for the matched conditions.""" + + @overload + def __init__( + self, + *, + match_configuration_name: Optional[str] = None, + sequence_number: Optional[int] = None, + ip_address_type: Optional[Union[str, "_models.IPAddressType"]] = None, + match_conditions: Optional[list["_models.NetworkTapRuleMatchCondition"]] = None, + actions: Optional[list["_models.NetworkTapRuleAction"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkTapRuleMatchConfigurationPatch(_Model): + """Defines the match configuration that are supported to filter the traffic. + + :ivar match_configuration_name: The name of the match configuration. + :vartype match_configuration_name: str + :ivar sequence_number: Sequence Number of the match configuration.. + :vartype sequence_number: int + :ivar ip_address_type: Type of IP Address. IPv4 or IPv6. Known values are: "IPv4" and "IPv6". + :vartype ip_address_type: str or ~azure.mgmt.managednetworkfabric.models.IPAddressType + :ivar match_conditions: List of the match conditions. + :vartype match_conditions: + list[~azure.mgmt.managednetworkfabric.models.NetworkTapRuleMatchConditionPatch] + :ivar actions: List of actions that need to be performed for the matched conditions. + :vartype actions: list[~azure.mgmt.managednetworkfabric.models.NetworkTapRuleActionPatch] + """ + + match_configuration_name: Optional[str] = rest_field( + name="matchConfigurationName", visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the match configuration.""" + sequence_number: Optional[int] = rest_field( + name="sequenceNumber", visibility=["read", "create", "update", "delete", "query"] + ) + """Sequence Number of the match configuration..""" + ip_address_type: Optional[Union[str, "_models.IPAddressType"]] = rest_field( + name="ipAddressType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of IP Address. IPv4 or IPv6. Known values are: \"IPv4\" and \"IPv6\".""" + match_conditions: Optional[list["_models.NetworkTapRuleMatchConditionPatch"]] = rest_field( + name="matchConditions", visibility=["read", "create", "update", "delete", "query"] + ) + """List of the match conditions.""" + actions: Optional[list["_models.NetworkTapRuleActionPatch"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of actions that need to be performed for the matched conditions.""" + + @overload + def __init__( + self, + *, + match_configuration_name: Optional[str] = None, + sequence_number: Optional[int] = None, + ip_address_type: Optional[Union[str, "_models.IPAddressType"]] = None, + match_conditions: Optional[list["_models.NetworkTapRuleMatchConditionPatch"]] = None, + actions: Optional[list["_models.NetworkTapRuleActionPatch"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkTapRulePatch(TagsUpdate): + """The NetworkTapRule resource definition. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: Network Tap Rule Patch properties. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.NetworkTapRulePatchProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.managednetworkfabric.models.ManagedServiceIdentityPatch + """ + + properties: Optional["_models.NetworkTapRulePatchProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Network Tap Rule Patch properties.""" + identity: Optional["_models.ManagedServiceIdentityPatch"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + __flattened_items = [ + "annotation", + "configuration_type", + "tap_rules_url", + "match_configurations", + "dynamic_match_configurations", + "identity_selector", + "global_network_tap_rule_actions", + ] + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.NetworkTapRulePatchProperties"] = None, + identity: Optional["_models.ManagedServiceIdentityPatch"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class NetworkTapRulePatchProperties(_Model): + """Network Tap Rule Patch properties. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar configuration_type: Input method to configure Network Tap Rule. Known values are: "File" + and "Inline". + :vartype configuration_type: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationType + :ivar tap_rules_url: Network Tap Rules file URL. + :vartype tap_rules_url: str + :ivar match_configurations: List of match configurations. + :vartype match_configurations: + list[~azure.mgmt.managednetworkfabric.models.NetworkTapRuleMatchConfigurationPatch] + :ivar dynamic_match_configurations: List of dynamic match configurations. + :vartype dynamic_match_configurations: + list[~azure.mgmt.managednetworkfabric.models.CommonDynamicMatchConfigurationPatch] + :ivar identity_selector: The selection of the managed identity to use with this storage + account. The identity type must be either system assigned or user assigned. + :vartype identity_selector: ~azure.mgmt.managednetworkfabric.models.IdentitySelectorPatch + :ivar global_network_tap_rule_actions: Global network tap rule actions. + :vartype global_network_tap_rule_actions: + ~azure.mgmt.managednetworkfabric.models.GlobalNetworkTapRuleActionPatchProperties + """ + + annotation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Switch configuration description.""" + configuration_type: Optional[Union[str, "_models.ConfigurationType"]] = rest_field( + name="configurationType", visibility=["read", "create", "update", "delete", "query"] + ) + """Input method to configure Network Tap Rule. Known values are: \"File\" and \"Inline\".""" + tap_rules_url: Optional[str] = rest_field( + name="tapRulesUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """Network Tap Rules file URL.""" + match_configurations: Optional[list["_models.NetworkTapRuleMatchConfigurationPatch"]] = rest_field( + name="matchConfigurations", visibility=["read", "create", "update", "delete", "query"] + ) + """List of match configurations.""" + dynamic_match_configurations: Optional[list["_models.CommonDynamicMatchConfigurationPatch"]] = rest_field( + name="dynamicMatchConfigurations", visibility=["read", "create", "update", "delete", "query"] + ) + """List of dynamic match configurations.""" + identity_selector: Optional["_models.IdentitySelectorPatch"] = rest_field( + name="identitySelector", visibility=["read", "create", "update", "delete", "query"] + ) + """The selection of the managed identity to use with this storage account. The identity type must + be either system assigned or user assigned.""" + global_network_tap_rule_actions: Optional["_models.GlobalNetworkTapRuleActionPatchProperties"] = rest_field( + name="globalNetworkTapRuleActions", visibility=["read", "create", "update", "delete", "query"] + ) + """Global network tap rule actions.""" + + @overload + def __init__( + self, + *, + annotation: Optional[str] = None, + configuration_type: Optional[Union[str, "_models.ConfigurationType"]] = None, + tap_rules_url: Optional[str] = None, + match_configurations: Optional[list["_models.NetworkTapRuleMatchConfigurationPatch"]] = None, + dynamic_match_configurations: Optional[list["_models.CommonDynamicMatchConfigurationPatch"]] = None, + identity_selector: Optional["_models.IdentitySelectorPatch"] = None, + global_network_tap_rule_actions: Optional["_models.GlobalNetworkTapRuleActionPatchProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkTapRuleProperties(_Model): + """Network Tap Rule Properties defines the resource properties. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar configuration_type: Input method to configure Network Tap Rule. Required. Known values + are: "File" and "Inline". + :vartype configuration_type: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationType + :ivar tap_rules_url: Network Tap Rules file URL. + :vartype tap_rules_url: str + :ivar identity_selector: The selection of the managed identity to use with this storage + account. The identity type must be either system assigned or user assigned. + :vartype identity_selector: ~azure.mgmt.managednetworkfabric.models.IdentitySelector + :ivar match_configurations: List of match configurations. + :vartype match_configurations: + list[~azure.mgmt.managednetworkfabric.models.NetworkTapRuleMatchConfiguration] + :ivar dynamic_match_configurations: List of dynamic match configurations. + :vartype dynamic_match_configurations: + list[~azure.mgmt.managednetworkfabric.models.CommonDynamicMatchConfiguration] + :ivar network_tap_id: The ARM resource Id of the NetworkTap. + :vartype network_tap_id: str + :ivar network_tap_ids: The ARM resource Id of the NetworkTap Rules. + :vartype network_tap_ids: list[str] + :ivar polling_interval_in_seconds: Polling interval in seconds. + :vartype polling_interval_in_seconds: int + :ivar last_synced_time: The last sync timestamp. + :vartype last_synced_time: ~datetime.datetime + :ivar global_network_tap_rule_actions: Global network tap rule actions. + :vartype global_network_tap_rule_actions: + ~azure.mgmt.managednetworkfabric.models.GlobalNetworkTapRuleActionProperties + :ivar last_operation: Details of the last operation performed on the resource. + :vartype last_operation: ~azure.mgmt.managednetworkfabric.models.LastOperationProperties + :ivar network_fabric_ids: Associated Network Fabric Resource IDs. + :vartype network_fabric_ids: list[str] + :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", + "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", + "Deprovisioned", "ErrorDeprovisioning", "DeferredControl", "Provisioning", "PendingCommit", and + "PendingAdministrativeUpdate". + :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState + :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", + "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState + :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", + "Disabled", "MAT", "RMA", "UnderMaintenance", and "EnabledDegraded". + :vartype administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.AdministrativeState + """ + + annotation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Switch configuration description.""" + configuration_type: Union[str, "_models.ConfigurationType"] = rest_field( + name="configurationType", visibility=["read", "create", "update", "delete", "query"] + ) + """Input method to configure Network Tap Rule. Required. Known values are: \"File\" and + \"Inline\".""" + tap_rules_url: Optional[str] = rest_field( + name="tapRulesUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """Network Tap Rules file URL.""" + identity_selector: Optional["_models.IdentitySelector"] = rest_field( + name="identitySelector", visibility=["read", "create", "update", "delete", "query"] + ) + """The selection of the managed identity to use with this storage account. The identity type must + be either system assigned or user assigned.""" + match_configurations: Optional[list["_models.NetworkTapRuleMatchConfiguration"]] = rest_field( + name="matchConfigurations", visibility=["read", "create", "update", "delete", "query"] + ) + """List of match configurations.""" + dynamic_match_configurations: Optional[list["_models.CommonDynamicMatchConfiguration"]] = rest_field( + name="dynamicMatchConfigurations", visibility=["read", "create", "update", "delete", "query"] + ) + """List of dynamic match configurations.""" + network_tap_id: Optional[str] = rest_field(name="networkTapId", visibility=["read"]) + """The ARM resource Id of the NetworkTap.""" + network_tap_ids: Optional[list[str]] = rest_field(name="networkTapIds", visibility=["read"]) + """The ARM resource Id of the NetworkTap Rules.""" + polling_interval_in_seconds: Optional[int] = rest_field( + name="pollingIntervalInSeconds", visibility=["read", "create", "update", "delete", "query"] + ) + """Polling interval in seconds.""" + last_synced_time: Optional[datetime.datetime] = rest_field( + name="lastSyncedTime", visibility=["read"], format="rfc3339" + ) + """The last sync timestamp.""" + global_network_tap_rule_actions: Optional["_models.GlobalNetworkTapRuleActionProperties"] = rest_field( + name="globalNetworkTapRuleActions", visibility=["read", "create", "update", "delete", "query"] + ) + """Global network tap rule actions.""" + last_operation: Optional["_models.LastOperationProperties"] = rest_field(name="lastOperation", visibility=["read"]) + """Details of the last operation performed on the resource.""" + network_fabric_ids: Optional[list[str]] = rest_field(name="networkFabricIds", visibility=["read"]) + """Associated Network Fabric Resource IDs.""" + configuration_state: Optional[Union[str, "_models.ConfigurationState"]] = rest_field( + name="configurationState", visibility=["read"] + ) + """Configuration state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Rejected\", + \"Accepted\", \"Provisioned\", \"ErrorProvisioning\", \"Deprovisioning\", \"Deprovisioned\", + \"ErrorDeprovisioning\", \"DeferredControl\", \"Provisioning\", \"PendingCommit\", and + \"PendingAdministrativeUpdate\".""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the resource. Known values are: \"Accepted\", \"Succeeded\", + \"Updating\", \"Deleting\", \"Failed\", and \"Canceled\".""" + administrative_state: Optional[Union[str, "_models.AdministrativeState"]] = rest_field( + name="administrativeState", visibility=["read"] + ) + """Administrative state of the resource. Known values are: \"Enabled\", \"Disabled\", \"MAT\", + \"RMA\", \"UnderMaintenance\", and \"EnabledDegraded\".""" + + @overload + def __init__( + self, + *, + configuration_type: Union[str, "_models.ConfigurationType"], + annotation: Optional[str] = None, + tap_rules_url: Optional[str] = None, + identity_selector: Optional["_models.IdentitySelector"] = None, + match_configurations: Optional[list["_models.NetworkTapRuleMatchConfiguration"]] = None, + dynamic_match_configurations: Optional[list["_models.CommonDynamicMatchConfiguration"]] = None, + polling_interval_in_seconds: Optional[int] = None, + global_network_tap_rule_actions: Optional["_models.GlobalNetworkTapRuleActionProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkTapRuleResyncResponse(_Model): + """Response for Network Tap Rule resync operation. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the async operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + percent_complete: Optional[float] = rest_field( + name="percentComplete", visibility=["read", "create", "update", "delete", "query"] + ) + """Percent of the operation that is complete.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the operation.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the operation.""" + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operations list.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If present, details of the operation error.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + + @overload + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkToNetworkInterconnect(ProxyResource): + """The Network To Network Interconnect resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + :ivar properties: The NetworkToNetworkInterconnect Properties. Required. + :vartype properties: + ~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnectProperties + """ + + properties: "_models.NetworkToNetworkInterconnectProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The NetworkToNetworkInterconnect Properties. Required.""" + + __flattened_items = [ + "nni_type", + "is_management_type", + "use_option_b", + "layer2_configuration", + "option_b_layer3_configuration", + "npb_static_route_configuration", + "static_route_configuration", + "import_route_policy", + "export_route_policy", + "egress_acl_id", + "ingress_acl_id", + "micro_bfd_state", + "conditional_default_route_configuration", + "last_operation", + "configuration_state", + "provisioning_state", + "administrative_state", + ] + + @overload + def __init__( + self, + *, + properties: "_models.NetworkToNetworkInterconnectProperties", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ProxyResourceBase(_Model): + """ProxyResourceBase with no property bag. + + :ivar id: Fully qualified resource ID for the resource. E.g. + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'. + :vartype id: str + :ivar type: The type of the resource. E.g. 'Microsoft.Compute/virtualMachines' or + 'Microsoft.Storage/storageAccounts'. + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """Fully qualified resource ID for the resource. E.g. + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'.""" + type: Optional[str] = rest_field(visibility=["read"]) + """The type of the resource. E.g. 'Microsoft.Compute/virtualMachines' or + 'Microsoft.Storage/storageAccounts'.""" + system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"]) + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class NetworkToNetworkInterconnectPatch(ProxyResourceBase): + """The Network To Network Interconnect resource patch definition. + + :ivar id: Fully qualified resource ID for the resource. E.g. + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'. + :vartype id: str + :ivar type: The type of the resource. E.g. 'Microsoft.Compute/virtualMachines' or + 'Microsoft.Storage/storageAccounts'. + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + :ivar properties: Resource properties. + :vartype properties: + ~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnectPatchProperties + """ + + properties: Optional["_models.NetworkToNetworkInterconnectPatchProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "layer2_configuration", + "option_b_layer3_configuration", + "npb_static_route_configuration", + "static_route_configuration", + "import_route_policy", + "export_route_policy", + "egress_acl_id", + "ingress_acl_id", + "micro_bfd_state", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.NetworkToNetworkInterconnectPatchProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class NetworkToNetworkInterconnectPatchProperties(_Model): # pylint: disable=name-too-long + """Network Tap Rule Patch properties. + + :ivar layer2_configuration: Common properties for Layer2Configuration. + :vartype layer2_configuration: ~azure.mgmt.managednetworkfabric.models.Layer2ConfigurationPatch + :ivar option_b_layer3_configuration: Common properties for Layer3Configuration. + :vartype option_b_layer3_configuration: + ~azure.mgmt.managednetworkfabric.models.OptionBLayer3ConfigurationPatchProperties + :ivar npb_static_route_configuration: NPB Static Route Configuration properties. + :vartype npb_static_route_configuration: + ~azure.mgmt.managednetworkfabric.models.NpbStaticRouteConfigurationPatch + :ivar static_route_configuration: Static Route Configuration. + :vartype static_route_configuration: + ~azure.mgmt.managednetworkfabric.models.NniStaticRoutePatchConfiguration + :ivar import_route_policy: Import Route Policy information. + :vartype import_route_policy: + ~azure.mgmt.managednetworkfabric.models.ImportRoutePolicyInformationPatch + :ivar export_route_policy: Export Route Policy information. + :vartype export_route_policy: + ~azure.mgmt.managednetworkfabric.models.ExportRoutePolicyInformationPatch + :ivar egress_acl_id: Egress Acl. ARM resource ID of Access Control Lists. + :vartype egress_acl_id: str + :ivar ingress_acl_id: Ingress Acl. ARM resource ID of Access Control Lists. + :vartype ingress_acl_id: str + :ivar micro_bfd_state: Micro BFD enabled/disabled state. Known values are: "Enabled" and + "Disabled". + :vartype micro_bfd_state: str or ~azure.mgmt.managednetworkfabric.models.MicroBfdState + """ + + layer2_configuration: Optional["_models.Layer2ConfigurationPatch"] = rest_field( + name="layer2Configuration", visibility=["read", "create", "update", "delete", "query"] + ) + """Common properties for Layer2Configuration.""" + option_b_layer3_configuration: Optional["_models.OptionBLayer3ConfigurationPatchProperties"] = rest_field( + name="optionBLayer3Configuration", visibility=["read", "create", "update", "delete", "query"] + ) + """Common properties for Layer3Configuration.""" + npb_static_route_configuration: Optional["_models.NpbStaticRouteConfigurationPatch"] = rest_field( + name="npbStaticRouteConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """NPB Static Route Configuration properties.""" + static_route_configuration: Optional["_models.NniStaticRoutePatchConfiguration"] = rest_field( + name="staticRouteConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Static Route Configuration.""" + import_route_policy: Optional["_models.ImportRoutePolicyInformationPatch"] = rest_field( + name="importRoutePolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Import Route Policy information.""" + export_route_policy: Optional["_models.ExportRoutePolicyInformationPatch"] = rest_field( + name="exportRoutePolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Export Route Policy information.""" + egress_acl_id: Optional[str] = rest_field( + name="egressAclId", visibility=["read", "create", "update", "delete", "query"] + ) + """Egress Acl. ARM resource ID of Access Control Lists.""" + ingress_acl_id: Optional[str] = rest_field( + name="ingressAclId", visibility=["read", "create", "update", "delete", "query"] + ) + """Ingress Acl. ARM resource ID of Access Control Lists.""" + micro_bfd_state: Optional[Union[str, "_models.MicroBfdState"]] = rest_field( + name="microBfdState", visibility=["read", "create", "update", "delete", "query"] + ) + """Micro BFD enabled/disabled state. Known values are: \"Enabled\" and \"Disabled\".""" + + @overload + def __init__( + self, + *, + layer2_configuration: Optional["_models.Layer2ConfigurationPatch"] = None, + option_b_layer3_configuration: Optional["_models.OptionBLayer3ConfigurationPatchProperties"] = None, + npb_static_route_configuration: Optional["_models.NpbStaticRouteConfigurationPatch"] = None, + static_route_configuration: Optional["_models.NniStaticRoutePatchConfiguration"] = None, + import_route_policy: Optional["_models.ImportRoutePolicyInformationPatch"] = None, + export_route_policy: Optional["_models.ExportRoutePolicyInformationPatch"] = None, + egress_acl_id: Optional[str] = None, + ingress_acl_id: Optional[str] = None, + micro_bfd_state: Optional[Union[str, "_models.MicroBfdState"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkToNetworkInterconnectProperties(_Model): + """Configuration used to setup CE-PE connectivity. + + :ivar nni_type: Type of NNI used. Example: CE | NPB. Known values are: "CE" and "NPB". + :vartype nni_type: str or ~azure.mgmt.managednetworkfabric.models.NniType + :ivar is_management_type: Configuration to use NNI for Infrastructure Management. Example: + True/False. Known values are: "True" and "False". + :vartype is_management_type: str or ~azure.mgmt.managednetworkfabric.models.IsManagementType + :ivar use_option_b: Based on this option layer3 parameters are mandatory. Example: True/False. + Required. Known values are: "True" and "False". + :vartype use_option_b: str or ~azure.mgmt.managednetworkfabric.models.BooleanEnumProperty + :ivar layer2_configuration: Common properties for Layer2 Configuration. + :vartype layer2_configuration: ~azure.mgmt.managednetworkfabric.models.Layer2Configuration + :ivar option_b_layer3_configuration: Common properties for Layer3Configuration. + :vartype option_b_layer3_configuration: + ~azure.mgmt.managednetworkfabric.models.OptionBLayer3Configuration + :ivar npb_static_route_configuration: NPB Static Route Configuration properties. + :vartype npb_static_route_configuration: + ~azure.mgmt.managednetworkfabric.models.NpbStaticRouteConfiguration + :ivar static_route_configuration: Static Route Configuration. + :vartype static_route_configuration: + ~azure.mgmt.managednetworkfabric.models.NniStaticRouteConfiguration + :ivar import_route_policy: Import Route Policy information. + :vartype import_route_policy: + ~azure.mgmt.managednetworkfabric.models.ImportRoutePolicyInformation + :ivar export_route_policy: Export Route Policy information. + :vartype export_route_policy: + ~azure.mgmt.managednetworkfabric.models.ExportRoutePolicyInformation + :ivar egress_acl_id: Egress Acl. ARM resource ID of Access Control Lists. + :vartype egress_acl_id: str + :ivar ingress_acl_id: Ingress Acl. ARM resource ID of Access Control Lists. + :vartype ingress_acl_id: str + :ivar micro_bfd_state: Micro Bidirectional Forwarding Detection (BFD) enabled/disabled state. + Known values are: "Enabled" and "Disabled". + :vartype micro_bfd_state: str or ~azure.mgmt.managednetworkfabric.models.MicroBfdState + :ivar conditional_default_route_configuration: Conditional Default Route Configuration + properties. + :vartype conditional_default_route_configuration: + ~azure.mgmt.managednetworkfabric.models.ConditionalDefaultRouteProperties + :ivar last_operation: Details of the last operation performed on the resource. + :vartype last_operation: ~azure.mgmt.managednetworkfabric.models.LastOperationProperties + :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", + "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", + "Deprovisioned", "ErrorDeprovisioning", "DeferredControl", "Provisioning", "PendingCommit", and + "PendingAdministrativeUpdate". + :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState + :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", + "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState + :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", + "Disabled", "MAT", "RMA", "UnderMaintenance", and "EnabledDegraded". + :vartype administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.AdministrativeState + """ + + nni_type: Optional[Union[str, "_models.NniType"]] = rest_field( + name="nniType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of NNI used. Example: CE | NPB. Known values are: \"CE\" and \"NPB\".""" + is_management_type: Optional[Union[str, "_models.IsManagementType"]] = rest_field( + name="isManagementType", visibility=["read", "create", "update", "delete", "query"] + ) + """Configuration to use NNI for Infrastructure Management. Example: True/False. Known values are: + \"True\" and \"False\".""" + use_option_b: Union[str, "_models.BooleanEnumProperty"] = rest_field( + name="useOptionB", visibility=["read", "create", "update", "delete", "query"] + ) + """Based on this option layer3 parameters are mandatory. Example: True/False. Required. Known + values are: \"True\" and \"False\".""" + layer2_configuration: Optional["_models.Layer2Configuration"] = rest_field( + name="layer2Configuration", visibility=["read", "create", "update", "delete", "query"] + ) + """Common properties for Layer2 Configuration.""" + option_b_layer3_configuration: Optional["_models.OptionBLayer3Configuration"] = rest_field( + name="optionBLayer3Configuration", visibility=["read", "create", "update", "delete", "query"] + ) + """Common properties for Layer3Configuration.""" + npb_static_route_configuration: Optional["_models.NpbStaticRouteConfiguration"] = rest_field( + name="npbStaticRouteConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """NPB Static Route Configuration properties.""" + static_route_configuration: Optional["_models.NniStaticRouteConfiguration"] = rest_field( + name="staticRouteConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Static Route Configuration.""" + import_route_policy: Optional["_models.ImportRoutePolicyInformation"] = rest_field( + name="importRoutePolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Import Route Policy information.""" + export_route_policy: Optional["_models.ExportRoutePolicyInformation"] = rest_field( + name="exportRoutePolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Export Route Policy information.""" + egress_acl_id: Optional[str] = rest_field( + name="egressAclId", visibility=["read", "create", "update", "delete", "query"] + ) + """Egress Acl. ARM resource ID of Access Control Lists.""" + ingress_acl_id: Optional[str] = rest_field( + name="ingressAclId", visibility=["read", "create", "update", "delete", "query"] + ) + """Ingress Acl. ARM resource ID of Access Control Lists.""" + micro_bfd_state: Optional[Union[str, "_models.MicroBfdState"]] = rest_field( + name="microBfdState", visibility=["read", "create", "update", "delete", "query"] + ) + """Micro Bidirectional Forwarding Detection (BFD) enabled/disabled state. Known values are: + \"Enabled\" and \"Disabled\".""" + conditional_default_route_configuration: Optional["_models.ConditionalDefaultRouteProperties"] = rest_field( + name="conditionalDefaultRouteConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Conditional Default Route Configuration properties.""" + last_operation: Optional["_models.LastOperationProperties"] = rest_field(name="lastOperation", visibility=["read"]) + """Details of the last operation performed on the resource.""" + configuration_state: Optional[Union[str, "_models.ConfigurationState"]] = rest_field( + name="configurationState", visibility=["read"] + ) + """Configuration state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Rejected\", + \"Accepted\", \"Provisioned\", \"ErrorProvisioning\", \"Deprovisioning\", \"Deprovisioned\", + \"ErrorDeprovisioning\", \"DeferredControl\", \"Provisioning\", \"PendingCommit\", and + \"PendingAdministrativeUpdate\".""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the resource. Known values are: \"Accepted\", \"Succeeded\", + \"Updating\", \"Deleting\", \"Failed\", and \"Canceled\".""" + administrative_state: Optional[Union[str, "_models.AdministrativeState"]] = rest_field( + name="administrativeState", visibility=["read"] + ) + """Administrative state of the resource. Known values are: \"Enabled\", \"Disabled\", \"MAT\", + \"RMA\", \"UnderMaintenance\", and \"EnabledDegraded\".""" + + @overload + def __init__( + self, + *, + use_option_b: Union[str, "_models.BooleanEnumProperty"], + nni_type: Optional[Union[str, "_models.NniType"]] = None, + is_management_type: Optional[Union[str, "_models.IsManagementType"]] = None, + layer2_configuration: Optional["_models.Layer2Configuration"] = None, + option_b_layer3_configuration: Optional["_models.OptionBLayer3Configuration"] = None, + npb_static_route_configuration: Optional["_models.NpbStaticRouteConfiguration"] = None, + static_route_configuration: Optional["_models.NniStaticRouteConfiguration"] = None, + import_route_policy: Optional["_models.ImportRoutePolicyInformation"] = None, + export_route_policy: Optional["_models.ExportRoutePolicyInformation"] = None, + egress_acl_id: Optional[str] = None, + ingress_acl_id: Optional[str] = None, + micro_bfd_state: Optional[Union[str, "_models.MicroBfdState"]] = None, + conditional_default_route_configuration: Optional["_models.ConditionalDefaultRouteProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NniBmpPatchProperties(_Model): + """BGP Monitoring Protocol (BMP) patch properties. + + :ivar configuration_state: (BGP Monitoring Protocol (BMP) configuration state. Known values + are: "Enabled" and "Disabled". + :vartype configuration_state: str or + ~azure.mgmt.managednetworkfabric.models.BmpConfigurationState + """ + + configuration_state: Optional[Union[str, "_models.BmpConfigurationState"]] = rest_field( + name="configurationState", visibility=["read", "create", "update", "delete", "query"] + ) + """(BGP Monitoring Protocol (BMP) configuration state. Known values are: \"Enabled\" and + \"Disabled\".""" + + @overload + def __init__( + self, + *, + configuration_state: Optional[Union[str, "_models.BmpConfigurationState"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NniBmpProperties(_Model): + """BGP Monitoring Protocol (BMP) properties. + + :ivar configuration_state: BGP Monitoring Protocol (BMP) Configuration State. Required. Known + values are: "Enabled" and "Disabled". + :vartype configuration_state: str or + ~azure.mgmt.managednetworkfabric.models.BmpConfigurationState + """ + + configuration_state: Union[str, "_models.BmpConfigurationState"] = rest_field( + name="configurationState", visibility=["read", "create", "update", "delete", "query"] + ) + """BGP Monitoring Protocol (BMP) Configuration State. Required. Known values are: \"Enabled\" and + \"Disabled\".""" + + @overload + def __init__( + self, + *, + configuration_state: Union[str, "_models.BmpConfigurationState"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NniStaticRouteConfiguration(_Model): + """Static Route Configuration properties for NNI. + + :ivar bfd_configuration: BFD configuration properties. + :vartype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdConfiguration + :ivar ipv4_routes: List of IPv4 Routes. + :vartype ipv4_routes: list[~azure.mgmt.managednetworkfabric.models.StaticRouteProperties] + :ivar ipv6_routes: List of IPv6 Routes. + :vartype ipv6_routes: list[~azure.mgmt.managednetworkfabric.models.StaticRouteProperties] + """ + + bfd_configuration: Optional["_models.BfdConfiguration"] = rest_field( + name="bfdConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """BFD configuration properties.""" + ipv4_routes: Optional[list["_models.StaticRouteProperties"]] = rest_field( + name="ipv4Routes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IPv4 Routes.""" + ipv6_routes: Optional[list["_models.StaticRouteProperties"]] = rest_field( + name="ipv6Routes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IPv6 Routes.""" + + @overload + def __init__( + self, + *, + bfd_configuration: Optional["_models.BfdConfiguration"] = None, + ipv4_routes: Optional[list["_models.StaticRouteProperties"]] = None, + ipv6_routes: Optional[list["_models.StaticRouteProperties"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NniStaticRoutePatchConfiguration(_Model): + """Static Route Configuration properties for NNI. + + :ivar bfd_configuration: Bidirectional Forwarding Detection (BFD) configuration properties. + :vartype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdPatchConfiguration + :ivar ipv4_routes: List of IPv4 Routes. + :vartype ipv4_routes: list[~azure.mgmt.managednetworkfabric.models.StaticRoutePatchProperties] + :ivar ipv6_routes: List of IPv6 Routes. + :vartype ipv6_routes: list[~azure.mgmt.managednetworkfabric.models.StaticRoutePatchProperties] + """ + + bfd_configuration: Optional["_models.BfdPatchConfiguration"] = rest_field( + name="bfdConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Bidirectional Forwarding Detection (BFD) configuration properties.""" + ipv4_routes: Optional[list["_models.StaticRoutePatchProperties"]] = rest_field( + name="ipv4Routes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IPv4 Routes.""" + ipv6_routes: Optional[list["_models.StaticRoutePatchProperties"]] = rest_field( + name="ipv6Routes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IPv6 Routes.""" + + @overload + def __init__( + self, + *, + bfd_configuration: Optional["_models.BfdPatchConfiguration"] = None, + ipv4_routes: Optional[list["_models.StaticRoutePatchProperties"]] = None, + ipv6_routes: Optional[list["_models.StaticRoutePatchProperties"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NniUpdateBfdAdministrativeStateRequest(_Model): + """NNI Bidirectional Forwarding Detection (BFD) Administrative State request. + + :ivar route_type: Route Type. Choose either Static or OptionA. Known values are: "Static" and + "OptionA". + :vartype route_type: str or ~azure.mgmt.managednetworkfabric.models.RouteType + :ivar administrative_state: State. Select either enable or disable. Known values are: + "Enabled", "Disabled", "MAT", and "RMA". + :vartype administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.BfdAdministrativeState + """ + + route_type: Optional[Union[str, "_models.RouteType"]] = rest_field( + name="routeType", visibility=["read", "create", "update", "delete", "query"] + ) + """Route Type. Choose either Static or OptionA. Known values are: \"Static\" and \"OptionA\".""" + administrative_state: Optional[Union[str, "_models.BfdAdministrativeState"]] = rest_field( + name="administrativeState", visibility=["read", "create", "update", "delete", "query"] + ) + """State. Select either enable or disable. Known values are: \"Enabled\", \"Disabled\", \"MAT\", + and \"RMA\".""" + + @overload + def __init__( + self, + *, + route_type: Optional[Union[str, "_models.RouteType"]] = None, + administrative_state: Optional[Union[str, "_models.BfdAdministrativeState"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NniUpdateBfdAdministrativeStateResponse(_Model): + """NNI Bidirectional Forwarding Detection (BFD) Administrative State response. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + :ivar properties: Properties of the NNI BFD Administrative State response. + :vartype properties: + ~azure.mgmt.managednetworkfabric.models.NniUpdateBfdAdministrativeStateResponseProperties + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the async operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + percent_complete: Optional[float] = rest_field( + name="percentComplete", visibility=["read", "create", "update", "delete", "query"] + ) + """Percent of the operation that is complete.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the operation.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the operation.""" + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operations list.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If present, details of the operation error.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + properties: Optional["_models.NniUpdateBfdAdministrativeStateResponseProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Properties of the NNI BFD Administrative State response.""" + + @overload + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + properties: Optional["_models.NniUpdateBfdAdministrativeStateResponseProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NniUpdateBfdAdministrativeStateResponseProperties(_Model): # pylint: disable=name-too-long + """NNI Bidirectional Forwarding Detection (BFD) Update Administrative State response. + + :ivar route_type: Route Type. Choose either Static or OptionA. Known values are: "Static" and + "OptionA". + :vartype route_type: str or ~azure.mgmt.managednetworkfabric.models.RouteType + :ivar administrative_state: State. Select either enable or disable. Known values are: + "Enabled", "Disabled", "MAT", and "RMA". + :vartype administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.BfdAdministrativeState + """ + + route_type: Optional[Union[str, "_models.RouteType"]] = rest_field( + name="routeType", visibility=["read", "create", "update", "delete", "query"] + ) + """Route Type. Choose either Static or OptionA. Known values are: \"Static\" and \"OptionA\".""" + administrative_state: Optional[Union[str, "_models.BfdAdministrativeState"]] = rest_field( + name="administrativeState", visibility=["read", "create", "update", "delete", "query"] + ) + """State. Select either enable or disable. Known values are: \"Enabled\", \"Disabled\", \"MAT\", + and \"RMA\".""" + + @overload + def __init__( + self, + *, + route_type: Optional[Union[str, "_models.RouteType"]] = None, + administrative_state: Optional[Union[str, "_models.BfdAdministrativeState"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NpbStaticRouteConfiguration(_Model): + """NPB Static Route Configuration properties. + + :ivar bfd_configuration: BFD Configuration properties. + :vartype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdConfiguration + :ivar ipv4_routes: List of IPv4 Routes. + :vartype ipv4_routes: list[~azure.mgmt.managednetworkfabric.models.StaticRouteProperties] + :ivar ipv6_routes: List of IPv6 Routes. + :vartype ipv6_routes: list[~azure.mgmt.managednetworkfabric.models.StaticRouteProperties] + """ + + bfd_configuration: Optional["_models.BfdConfiguration"] = rest_field( + name="bfdConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """BFD Configuration properties.""" + ipv4_routes: Optional[list["_models.StaticRouteProperties"]] = rest_field( + name="ipv4Routes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IPv4 Routes.""" + ipv6_routes: Optional[list["_models.StaticRouteProperties"]] = rest_field( + name="ipv6Routes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IPv6 Routes.""" + + @overload + def __init__( + self, + *, + bfd_configuration: Optional["_models.BfdConfiguration"] = None, + ipv4_routes: Optional[list["_models.StaticRouteProperties"]] = None, + ipv6_routes: Optional[list["_models.StaticRouteProperties"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NpbStaticRouteConfigurationPatch(_Model): + """NPB Static Route Configuration properties. + + :ivar bfd_configuration: BFD Configuration properties. + :vartype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdPatchConfiguration + :ivar ipv4_routes: List of IPv4 Routes. + :vartype ipv4_routes: list[~azure.mgmt.managednetworkfabric.models.StaticRoutePatchProperties] + :ivar ipv6_routes: List of IPv6 Routes. + :vartype ipv6_routes: list[~azure.mgmt.managednetworkfabric.models.StaticRoutePatchProperties] + """ + + bfd_configuration: Optional["_models.BfdPatchConfiguration"] = rest_field( + name="bfdConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """BFD Configuration properties.""" + ipv4_routes: Optional[list["_models.StaticRoutePatchProperties"]] = rest_field( + name="ipv4Routes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IPv4 Routes.""" + ipv6_routes: Optional[list["_models.StaticRoutePatchProperties"]] = rest_field( + name="ipv6Routes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IPv6 Routes.""" + + @overload + def __init__( + self, + *, + bfd_configuration: Optional["_models.BfdPatchConfiguration"] = None, + ipv4_routes: Optional[list["_models.StaticRoutePatchProperties"]] = None, + ipv6_routes: Optional[list["_models.StaticRoutePatchProperties"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Operation(_Model): + """REST API Operation. + + :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + :vartype name: str + :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for + data-plane operations and "false" for Azure Resource Manager/control-plane operations. + :vartype is_data_action: bool + :ivar display: Localized display information for this particular operation. + :vartype display: ~azure.mgmt.managednetworkfabric.models.OperationDisplay + :ivar origin: The intended executor of the operation; as in Resource Based Access Control + (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", + and "user,system". + :vartype origin: str or ~azure.mgmt.managednetworkfabric.models.Origin + :ivar action_type: Extensible enum. Indicates the action type. "Internal" refers to actions + that are for internal only APIs. "Internal" + :vartype action_type: str or ~azure.mgmt.managednetworkfabric.models.ActionType + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + \"Microsoft.Compute/virtualMachines/write\", + \"Microsoft.Compute/virtualMachines/capture/action\".""" + is_data_action: Optional[bool] = rest_field(name="isDataAction", visibility=["read"]) + """Whether the operation applies to data-plane. This is \"true\" for data-plane operations and + \"false\" for Azure Resource Manager/control-plane operations.""" + display: Optional["_models.OperationDisplay"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Localized display information for this particular operation.""" + origin: Optional[Union[str, "_models.Origin"]] = rest_field(visibility=["read"]) + """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit + logs UX. Default value is \"user,system\". Known values are: \"user\", \"system\", and + \"user,system\".""" + action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType", visibility=["read"]) + """Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for + internal only APIs. \"Internal\"""" + + @overload + def __init__( + self, + *, + display: Optional["_models.OperationDisplay"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OperationDisplay(_Model): + """Localized display information for an operation. + + :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft + Monitoring Insights" or "Microsoft Compute". + :vartype provider: str + :ivar resource: The localized friendly name of the resource type related to this operation. + E.g. "Virtual Machines" or "Job Schedule Collections". + :vartype resource: str + :ivar operation: The concise, localized friendly name for the operation; suitable for + dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + :vartype operation: str + :ivar description: The short, localized friendly description of the operation; suitable for + tool tips and detailed views. + :vartype description: str + """ + + provider: Optional[str] = rest_field(visibility=["read"]) + """The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring + Insights\" or \"Microsoft Compute\".""" + resource: Optional[str] = rest_field(visibility=["read"]) + """The localized friendly name of the resource type related to this operation. E.g. \"Virtual + Machines\" or \"Job Schedule Collections\".""" + operation: Optional[str] = rest_field(visibility=["read"]) + """The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create + or Update Virtual Machine\", \"Restart Virtual Machine\".""" + description: Optional[str] = rest_field(visibility=["read"]) + """The short, localized friendly description of the operation; suitable for tool tips and detailed + views.""" + + +class OperationStatusResult(_Model): + """The current status of an async operation. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the async operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + percent_complete: Optional[float] = rest_field( + name="percentComplete", visibility=["read", "create", "update", "delete", "query"] + ) + """Percent of the operation that is complete.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the operation.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the operation.""" + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operations list.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If present, details of the operation error.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + + @overload + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OptionBLayer3Configuration(Layer3IpPrefixProperties): + """OptionB Layer3 Configuration properties. + + :ivar primary_ipv4_prefix: IPv4 Address Prefix. + :vartype primary_ipv4_prefix: str + :ivar primary_ipv6_prefix: IPv6 Address Prefix. + :vartype primary_ipv6_prefix: str + :ivar secondary_ipv4_prefix: Secondary IPv4 Address Prefix. + :vartype secondary_ipv4_prefix: str + :ivar secondary_ipv6_prefix: Secondary IPv6 Address Prefix. + :vartype secondary_ipv6_prefix: str + :ivar peer_asn: ASN of PE devices for CE/PE connectivity.Example : 28. Required. + :vartype peer_asn: int + :ivar vlan_id: VLAN for CE/PE Layer 3 connectivity.Example : 501. Required. + :vartype vlan_id: int + :ivar fabric_asn: ASN of CE devices for CE/PE connectivity. + :vartype fabric_asn: int + :ivar pe_loopback_ip_address: Provider Edge (PE) Loopback IP Address. + :vartype pe_loopback_ip_address: list[str] + :ivar bmp_configuration: BGP Monitoring Protocol (BMP) Configuration. + :vartype bmp_configuration: ~azure.mgmt.managednetworkfabric.models.NniBmpProperties + :ivar prefix_limits: OptionB Layer3 prefix limit configuration. + :vartype prefix_limits: + list[~azure.mgmt.managednetworkfabric.models.OptionBLayer3PrefixLimitProperties] + """ + + peer_asn: int = rest_field(name="peerASN", visibility=["read", "create", "update", "delete", "query"]) + """ASN of PE devices for CE/PE connectivity.Example : 28. Required.""" + vlan_id: int = rest_field(name="vlanId", visibility=["read", "create", "update", "delete", "query"]) + """VLAN for CE/PE Layer 3 connectivity.Example : 501. Required.""" + fabric_asn: Optional[int] = rest_field(name="fabricASN", visibility=["read"]) + """ASN of CE devices for CE/PE connectivity.""" + pe_loopback_ip_address: Optional[list[str]] = rest_field( + name="peLoopbackIpAddress", visibility=["read", "create", "update", "delete", "query"] + ) + """Provider Edge (PE) Loopback IP Address.""" + bmp_configuration: Optional["_models.NniBmpProperties"] = rest_field( + name="bmpConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """BGP Monitoring Protocol (BMP) Configuration.""" + prefix_limits: Optional[list["_models.OptionBLayer3PrefixLimitProperties"]] = rest_field( + name="prefixLimits", visibility=["read", "create", "update", "delete", "query"] + ) + """OptionB Layer3 prefix limit configuration.""" + + @overload + def __init__( + self, + *, + peer_asn: int, + vlan_id: int, + primary_ipv4_prefix: Optional[str] = None, + primary_ipv6_prefix: Optional[str] = None, + secondary_ipv4_prefix: Optional[str] = None, + secondary_ipv6_prefix: Optional[str] = None, + pe_loopback_ip_address: Optional[list[str]] = None, + bmp_configuration: Optional["_models.NniBmpProperties"] = None, + prefix_limits: Optional[list["_models.OptionBLayer3PrefixLimitProperties"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OptionBLayer3ConfigurationPatchProperties(Layer3IpPrefixPatchProperties): # pylint: disable=name-too-long + """Common properties for Layer3Configuration. + + :ivar primary_ipv4_prefix: IPv4 Address Prefix. + :vartype primary_ipv4_prefix: str + :ivar primary_ipv6_prefix: IPv6 Address Prefix. + :vartype primary_ipv6_prefix: str + :ivar secondary_ipv4_prefix: Secondary IPv4 Address Prefix. + :vartype secondary_ipv4_prefix: str + :ivar secondary_ipv6_prefix: Secondary IPv6 Address Prefix. + :vartype secondary_ipv6_prefix: str + :ivar peer_asn: ASN of PE devices for CE/PE connectivity.Example : 28. + :vartype peer_asn: int + :ivar vlan_id: VLAN for CE/PE Layer 3 connectivity.Example : 501. + :vartype vlan_id: int + :ivar fabric_asn: ASN of CE devices for CE/PE connectivity. + :vartype fabric_asn: int + :ivar pe_loopback_ip_address: Provider Edge (PE) Loopback IP Address. + :vartype pe_loopback_ip_address: list[str] + :ivar bmp_configuration: BGP Monitoring Protocol (BMP) Configuration. + :vartype bmp_configuration: ~azure.mgmt.managednetworkfabric.models.NniBmpPatchProperties + :ivar prefix_limits: OptionB Layer3 prefix limit configuration. + :vartype prefix_limits: + list[~azure.mgmt.managednetworkfabric.models.OptionBLayer3PrefixLimitPatchProperties] + """ + + peer_asn: Optional[int] = rest_field(name="peerASN", visibility=["read", "create", "update", "delete", "query"]) + """ASN of PE devices for CE/PE connectivity.Example : 28.""" + vlan_id: Optional[int] = rest_field(name="vlanId", visibility=["read", "create", "update", "delete", "query"]) + """VLAN for CE/PE Layer 3 connectivity.Example : 501.""" + fabric_asn: Optional[int] = rest_field(name="fabricASN", visibility=["read"]) + """ASN of CE devices for CE/PE connectivity.""" + pe_loopback_ip_address: Optional[list[str]] = rest_field( + name="peLoopbackIpAddress", visibility=["read", "create", "update", "delete", "query"] + ) + """Provider Edge (PE) Loopback IP Address.""" + bmp_configuration: Optional["_models.NniBmpPatchProperties"] = rest_field( + name="bmpConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """BGP Monitoring Protocol (BMP) Configuration.""" + prefix_limits: Optional[list["_models.OptionBLayer3PrefixLimitPatchProperties"]] = rest_field( + name="prefixLimits", visibility=["read", "create", "update", "delete", "query"] + ) + """OptionB Layer3 prefix limit configuration.""" + + @overload + def __init__( + self, + *, + primary_ipv4_prefix: Optional[str] = None, + primary_ipv6_prefix: Optional[str] = None, + secondary_ipv4_prefix: Optional[str] = None, + secondary_ipv6_prefix: Optional[str] = None, + peer_asn: Optional[int] = None, + vlan_id: Optional[int] = None, + pe_loopback_ip_address: Optional[list[str]] = None, + bmp_configuration: Optional["_models.NniBmpPatchProperties"] = None, + prefix_limits: Optional[list["_models.OptionBLayer3PrefixLimitPatchProperties"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OptionBLayer3PrefixLimitPatchProperties(_Model): + """OptionB Layer3 prefix limit patch properties. + + :ivar maximum_routes: Maximum number of routes allowed. + :vartype maximum_routes: int + """ + + maximum_routes: Optional[int] = rest_field( + name="maximumRoutes", visibility=["read", "create", "update", "delete", "query"] + ) + """Maximum number of routes allowed.""" + + @overload + def __init__( + self, + *, + maximum_routes: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OptionBLayer3PrefixLimitProperties(_Model): + """OptionB Layer3 prefix limit properties. + + :ivar maximum_routes: Maximum number of routes allowed. + :vartype maximum_routes: int + """ + + maximum_routes: Optional[int] = rest_field( + name="maximumRoutes", visibility=["read", "create", "update", "delete", "query"] + ) + """Maximum number of routes allowed.""" + + @overload + def __init__( + self, + *, + maximum_routes: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PoliceRateConfigurationProperties(_Model): + """Police rate configuration properties. + + :ivar bit_rate: Rate limit in bits per second. + :vartype bit_rate: ~azure.mgmt.managednetworkfabric.models.BitRate + :ivar burst_size: Burst size in packets. + :vartype burst_size: ~azure.mgmt.managednetworkfabric.models.BurstSize + """ + + bit_rate: Optional["_models.BitRate"] = rest_field( + name="bitRate", visibility=["read", "create", "update", "delete", "query"] + ) + """Rate limit in bits per second.""" + burst_size: Optional["_models.BurstSize"] = rest_field( + name="burstSize", visibility=["read", "create", "update", "delete", "query"] + ) + """Burst size in packets.""" + + @overload + def __init__( + self, + *, + bit_rate: Optional["_models.BitRate"] = None, + burst_size: Optional["_models.BurstSize"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PortGroupPatchProperties(_Model): + """Port Group Properties. + + :ivar name: The name of the port group. + :vartype name: str + :ivar ports: List of the ports that need to be matched. + :vartype ports: list[str] + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the port group.""" + ports: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of the ports that need to be matched.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + ports: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PortGroupProperties(_Model): + """Port Group properties. + + :ivar name: The name of the port group. + :vartype name: str + :ivar ports: List of the ports that need to be matched. + :vartype ports: list[str] + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the port group.""" + ports: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of the ports that need to be matched.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + ports: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PrefixLimitPatchProperties(_Model): + """Prefix Limit Patch properties. + + :ivar maximum_routes: Maximum routes allowed. + :vartype maximum_routes: int + :ivar threshold: Limit at which route prefixes a warning is generate. + :vartype threshold: int + :ivar idle_time_expiry: Idle time expiry in seconds. + :vartype idle_time_expiry: int + """ + + maximum_routes: Optional[int] = rest_field( + name="maximumRoutes", visibility=["read", "create", "update", "delete", "query"] + ) + """Maximum routes allowed.""" + threshold: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Limit at which route prefixes a warning is generate.""" + idle_time_expiry: Optional[int] = rest_field( + name="idleTimeExpiry", visibility=["read", "create", "update", "delete", "query"] + ) + """Idle time expiry in seconds.""" + + @overload + def __init__( + self, + *, + maximum_routes: Optional[int] = None, + threshold: Optional[int] = None, + idle_time_expiry: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PrefixLimitProperties(_Model): + """Prefix Limit properties. + + :ivar maximum_routes: Maximum routes allowed. + :vartype maximum_routes: int + :ivar threshold: Limit at which route prefixes a warning is generate. + :vartype threshold: int + :ivar idle_time_expiry: Idle Time Expiry in seconds, default is 60. + :vartype idle_time_expiry: int + """ + + maximum_routes: Optional[int] = rest_field( + name="maximumRoutes", visibility=["read", "create", "update", "delete", "query"] + ) + """Maximum routes allowed.""" + threshold: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Limit at which route prefixes a warning is generate.""" + idle_time_expiry: Optional[int] = rest_field( + name="idleTimeExpiry", visibility=["read", "create", "update", "delete", "query"] + ) + """Idle Time Expiry in seconds, default is 60.""" + + @overload + def __init__( + self, + *, + maximum_routes: Optional[int] = None, + threshold: Optional[int] = None, + idle_time_expiry: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class QosPatchProperties(_Model): + """NetworkFabric QoS Patch Properties. + + :ivar qos_configuration_state: QoS configuration state. Default is Disabled. Known values are: + "Disabled" and "Enabled". + :vartype qos_configuration_state: str or + ~azure.mgmt.managednetworkfabric.models.QosConfigurationState + """ + + qos_configuration_state: Optional[Union[str, "_models.QosConfigurationState"]] = rest_field( + name="qosConfigurationState", visibility=["read", "create", "update", "delete", "query"] + ) + """QoS configuration state. Default is Disabled. Known values are: \"Disabled\" and \"Enabled\".""" + + @overload + def __init__( + self, + *, + qos_configuration_state: Optional[Union[str, "_models.QosConfigurationState"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class QosProperties(_Model): + """NetworkFabric QoS Properties. + + :ivar qos_configuration_state: QoS configuration state. Default is Disabled. Known values are: + "Disabled" and "Enabled". + :vartype qos_configuration_state: str or + ~azure.mgmt.managednetworkfabric.models.QosConfigurationState + """ + + qos_configuration_state: Optional[Union[str, "_models.QosConfigurationState"]] = rest_field( + name="qosConfigurationState", visibility=["read", "create", "update", "delete", "query"] + ) + """QoS configuration state. Default is Disabled. Known values are: \"Disabled\" and \"Enabled\".""" + + @overload + def __init__( + self, + *, + qos_configuration_state: Optional[Union[str, "_models.QosConfigurationState"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RebootProperties(_Model): + """Reboot properties. + + :ivar reboot_type: Type of reboot to be performed. Example: GracefulRebootWithZTP. Known values + are: "GracefulRebootWithZTP", "GracefulRebootWithoutZTP", "UngracefulRebootWithZTP", and + "UngracefulRebootWithoutZTP". + :vartype reboot_type: str or ~azure.mgmt.managednetworkfabric.models.RebootType + """ + + reboot_type: Optional[Union[str, "_models.RebootType"]] = rest_field( + name="rebootType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of reboot to be performed. Example: GracefulRebootWithZTP. Known values are: + \"GracefulRebootWithZTP\", \"GracefulRebootWithoutZTP\", \"UngracefulRebootWithZTP\", and + \"UngracefulRebootWithoutZTP\".""" + + @overload + def __init__( + self, + *, + reboot_type: Optional[Union[str, "_models.RebootType"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RoutePolicy(TrackedResource): + """The RoutePolicy resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The RoutePolicy properties. Required. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.RoutePolicyProperties + """ + + properties: "_models.RoutePolicyProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The RoutePolicy properties. Required.""" + + __flattened_items = [ + "annotation", + "default_action", + "statements", + "network_fabric_id", + "address_family_type", + "last_operation", + "configuration_state", + "provisioning_state", + "administrative_state", + ] + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.RoutePolicyProperties", + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class RoutePolicyPatch(TagsUpdate): + """The Route Policy patch resource definition. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The RoutePolicy patchable properties. + :vartype properties: ~azure.mgmt.managednetworkfabric.models.RoutePolicyPatchableProperties + """ + + properties: Optional["_models.RoutePolicyPatchableProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The RoutePolicy patchable properties.""" + + __flattened_items = ["default_action", "statements"] + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.RoutePolicyPatchableProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class RoutePolicyPatchableProperties(_Model): + """Route Policy patchable properties. + + :ivar default_action: Default action that needs to be applied when no condition is matched. + Example: Permit | Deny. Known values are: "Permit" and "Deny". + :vartype default_action: str or ~azure.mgmt.managednetworkfabric.models.CommunityActionTypes + :ivar statements: Route Policy statements. + :vartype statements: + list[~azure.mgmt.managednetworkfabric.models.RoutePolicyStatementPatchProperties] + """ + + default_action: Optional[Union[str, "_models.CommunityActionTypes"]] = rest_field( + name="defaultAction", visibility=["read", "create", "update", "delete", "query"] + ) + """Default action that needs to be applied when no condition is matched. Example: Permit | Deny. + Known values are: \"Permit\" and \"Deny\".""" + statements: Optional[list["_models.RoutePolicyStatementPatchProperties"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Route Policy statements.""" + + @overload + def __init__( + self, + *, + default_action: Optional[Union[str, "_models.CommunityActionTypes"]] = None, + statements: Optional[list["_models.RoutePolicyStatementPatchProperties"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RoutePolicyProperties(_Model): + """RoutePolicyProperties defines the resource properties. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar default_action: Default action that needs to be applied when no condition is matched. + Example: Permit | Deny. Known values are: "Permit" and "Deny". + :vartype default_action: str or ~azure.mgmt.managednetworkfabric.models.CommunityActionTypes + :ivar statements: Route Policy statements. Required. + :vartype statements: + list[~azure.mgmt.managednetworkfabric.models.RoutePolicyStatementProperties] + :ivar network_fabric_id: Arm Resource ID of Network Fabric. Required. + :vartype network_fabric_id: str + :ivar address_family_type: AddressFamilyType. This parameter decides whether the given ipv4 or + ipv6 route policy. Known values are: "IPv4" and "IPv6". + :vartype address_family_type: str or ~azure.mgmt.managednetworkfabric.models.AddressFamilyType + :ivar last_operation: Details of the last operation performed on the resource. + :vartype last_operation: ~azure.mgmt.managednetworkfabric.models.LastOperationProperties + :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", + "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", + "Deprovisioned", "ErrorDeprovisioning", "DeferredControl", "Provisioning", "PendingCommit", and + "PendingAdministrativeUpdate". + :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState + :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", + "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState + :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", + "Disabled", "MAT", "RMA", "UnderMaintenance", and "EnabledDegraded". + :vartype administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.AdministrativeState + """ + + annotation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Switch configuration description.""" + default_action: Optional[Union[str, "_models.CommunityActionTypes"]] = rest_field( + name="defaultAction", visibility=["read", "create", "update", "delete", "query"] + ) + """Default action that needs to be applied when no condition is matched. Example: Permit | Deny. + Known values are: \"Permit\" and \"Deny\".""" + statements: list["_models.RoutePolicyStatementProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Route Policy statements. Required.""" + network_fabric_id: str = rest_field( + name="networkFabricId", visibility=["read", "create", "update", "delete", "query"] + ) + """Arm Resource ID of Network Fabric. Required.""" + address_family_type: Optional[Union[str, "_models.AddressFamilyType"]] = rest_field( + name="addressFamilyType", visibility=["read", "create", "update", "delete", "query"] + ) + """AddressFamilyType. This parameter decides whether the given ipv4 or ipv6 route policy. Known + values are: \"IPv4\" and \"IPv6\".""" + last_operation: Optional["_models.LastOperationProperties"] = rest_field(name="lastOperation", visibility=["read"]) + """Details of the last operation performed on the resource.""" + configuration_state: Optional[Union[str, "_models.ConfigurationState"]] = rest_field( + name="configurationState", visibility=["read"] + ) + """Configuration state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Rejected\", + \"Accepted\", \"Provisioned\", \"ErrorProvisioning\", \"Deprovisioning\", \"Deprovisioned\", + \"ErrorDeprovisioning\", \"DeferredControl\", \"Provisioning\", \"PendingCommit\", and + \"PendingAdministrativeUpdate\".""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the resource. Known values are: \"Accepted\", \"Succeeded\", + \"Updating\", \"Deleting\", \"Failed\", and \"Canceled\".""" + administrative_state: Optional[Union[str, "_models.AdministrativeState"]] = rest_field( + name="administrativeState", visibility=["read"] + ) + """Administrative state of the resource. Known values are: \"Enabled\", \"Disabled\", \"MAT\", + \"RMA\", \"UnderMaintenance\", and \"EnabledDegraded\".""" + + @overload + def __init__( + self, + *, + statements: list["_models.RoutePolicyStatementProperties"], + network_fabric_id: str, + annotation: Optional[str] = None, + default_action: Optional[Union[str, "_models.CommunityActionTypes"]] = None, + address_family_type: Optional[Union[str, "_models.AddressFamilyType"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RoutePolicyStatementPatchProperties(AnnotationResource): + """Route Policy Statement properties. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar sequence_number: Sequence to insert to/delete from existing route. Required. + :vartype sequence_number: int + :ivar condition: Route policy condition properties. Required. + :vartype condition: ~azure.mgmt.managednetworkfabric.models.StatementConditionPatchProperties + :ivar action: Route policy action properties. Required. + :vartype action: ~azure.mgmt.managednetworkfabric.models.StatementActionPatchProperties + """ + + sequence_number: int = rest_field(name="sequenceNumber", visibility=["read", "create", "update", "delete", "query"]) + """Sequence to insert to/delete from existing route. Required.""" + condition: "_models.StatementConditionPatchProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Route policy condition properties. Required.""" + action: "_models.StatementActionPatchProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Route policy action properties. Required.""" + + @overload + def __init__( + self, + *, + sequence_number: int, + condition: "_models.StatementConditionPatchProperties", + action: "_models.StatementActionPatchProperties", + annotation: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RoutePolicyStatementProperties(AnnotationResource): + """Route Policy Statement properties. + + :ivar annotation: Switch configuration description. + :vartype annotation: str + :ivar sequence_number: Sequence to insert to/delete from existing route. Required. + :vartype sequence_number: int + :ivar condition: Route policy condition properties. Required. + :vartype condition: ~azure.mgmt.managednetworkfabric.models.StatementConditionProperties + :ivar action: Route policy action properties. Required. + :vartype action: ~azure.mgmt.managednetworkfabric.models.StatementActionProperties + """ + + sequence_number: int = rest_field(name="sequenceNumber", visibility=["read", "create", "update", "delete", "query"]) + """Sequence to insert to/delete from existing route. Required.""" + condition: "_models.StatementConditionProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Route policy condition properties. Required.""" + action: "_models.StatementActionProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Route policy action properties. Required.""" + + @overload + def __init__( + self, + *, + sequence_number: int, + condition: "_models.StatementConditionProperties", + action: "_models.StatementActionProperties", + annotation: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RoutePrefixLimitPatchProperties(_Model): + """VRP Limit patch configuration. + + :ivar hard_limit: Hard limit for the routes. + :vartype hard_limit: int + :ivar threshold: Threshold for the routes. + :vartype threshold: int + """ + + hard_limit: Optional[int] = rest_field(name="hardLimit", visibility=["read", "create", "update", "delete", "query"]) + """Hard limit for the routes.""" + threshold: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Threshold for the routes.""" + + @overload + def __init__( + self, + *, + hard_limit: Optional[int] = None, + threshold: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RoutePrefixLimitProperties(_Model): + """Layer3 Route prefix limit configuration. + + :ivar hard_limit: Hard limit for the routes. + :vartype hard_limit: int + :ivar threshold: Threshold for the routes. + :vartype threshold: int + """ + + hard_limit: Optional[int] = rest_field(name="hardLimit", visibility=["read", "create", "update", "delete", "query"]) + """Hard limit for the routes.""" + threshold: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Threshold for the routes.""" + + @overload + def __init__( + self, + *, + hard_limit: Optional[int] = None, + threshold: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RouteTargetInformation(_Model): + """Route Target Configuration. + + :ivar import_ipv4_route_targets: Route Targets to be applied for incoming routes into CE. + :vartype import_ipv4_route_targets: list[str] + :ivar import_ipv6_route_targets: Route Targets to be applied for incoming routes from CE. + :vartype import_ipv6_route_targets: list[str] + :ivar export_ipv4_route_targets: Route Targets to be applied for outgoing routes into CE. + :vartype export_ipv4_route_targets: list[str] + :ivar export_ipv6_route_targets: Route Targets to be applied for outgoing routes from CE. + :vartype export_ipv6_route_targets: list[str] + """ + + import_ipv4_route_targets: Optional[list[str]] = rest_field( + name="importIpv4RouteTargets", visibility=["read", "create", "update", "delete", "query"] + ) + """Route Targets to be applied for incoming routes into CE.""" + import_ipv6_route_targets: Optional[list[str]] = rest_field( + name="importIpv6RouteTargets", visibility=["read", "create", "update", "delete", "query"] + ) + """Route Targets to be applied for incoming routes from CE.""" + export_ipv4_route_targets: Optional[list[str]] = rest_field( + name="exportIpv4RouteTargets", visibility=["read", "create", "update", "delete", "query"] + ) + """Route Targets to be applied for outgoing routes into CE.""" + export_ipv6_route_targets: Optional[list[str]] = rest_field( + name="exportIpv6RouteTargets", visibility=["read", "create", "update", "delete", "query"] + ) + """Route Targets to be applied for outgoing routes from CE.""" + + @overload + def __init__( + self, + *, + import_ipv4_route_targets: Optional[list[str]] = None, + import_ipv6_route_targets: Optional[list[str]] = None, + export_ipv4_route_targets: Optional[list[str]] = None, + export_ipv6_route_targets: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RouteTargetPatchInformation(_Model): + """Route Target Configuration. + + :ivar import_ipv4_route_targets: Route Targets to be applied for incoming routes into CE. + :vartype import_ipv4_route_targets: list[str] + :ivar import_ipv6_route_targets: Route Targets to be applied for incoming routes from CE. + :vartype import_ipv6_route_targets: list[str] + :ivar export_ipv4_route_targets: Route Targets to be applied for outgoing routes into CE. + :vartype export_ipv4_route_targets: list[str] + :ivar export_ipv6_route_targets: Route Targets to be applied for outgoing routes from CE. + :vartype export_ipv6_route_targets: list[str] + """ + + import_ipv4_route_targets: Optional[list[str]] = rest_field( + name="importIpv4RouteTargets", visibility=["read", "create", "update", "delete", "query"] + ) + """Route Targets to be applied for incoming routes into CE.""" + import_ipv6_route_targets: Optional[list[str]] = rest_field( + name="importIpv6RouteTargets", visibility=["read", "create", "update", "delete", "query"] + ) + """Route Targets to be applied for incoming routes from CE.""" + export_ipv4_route_targets: Optional[list[str]] = rest_field( + name="exportIpv4RouteTargets", visibility=["read", "create", "update", "delete", "query"] + ) + """Route Targets to be applied for outgoing routes into CE.""" + export_ipv6_route_targets: Optional[list[str]] = rest_field( + name="exportIpv6RouteTargets", visibility=["read", "create", "update", "delete", "query"] + ) + """Route Targets to be applied for outgoing routes from CE.""" + + @overload + def __init__( + self, + *, + import_ipv4_route_targets: Optional[list[str]] = None, + import_ipv6_route_targets: Optional[list[str]] = None, + export_ipv4_route_targets: Optional[list[str]] = None, + export_ipv6_route_targets: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RuleProperties(_Model): + """Rules for the InternetGateways. + + :ivar action: Specify action. Required. Known values are: "Allow" and "Deny". + :vartype action: str or ~azure.mgmt.managednetworkfabric.models.Action + :ivar address_list: List of Addresses to be allowed or denied. + :vartype address_list: list[str] + :ivar condition: Specify rule condition. Known values are: "And" and "Or". + :vartype condition: str or ~azure.mgmt.managednetworkfabric.models.RuleCondition + :ivar destination_address_list: List of Addresses to be allowed or denied. + :vartype destination_address_list: list[str] + :ivar source_address_list: List of source IPv4 and IPv6 address to be allowed or denied. + :vartype source_address_list: list[str] + :ivar header_address_list: List of header Name and source addresses associated with the header. + :vartype header_address_list: + list[~azure.mgmt.managednetworkfabric.models.HeaderAddressProperties] + """ + + action: Union[str, "_models.Action"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Specify action. Required. Known values are: \"Allow\" and \"Deny\".""" + address_list: Optional[list[str]] = rest_field( + name="addressList", visibility=["read", "create", "update", "delete", "query"] + ) + """List of Addresses to be allowed or denied.""" + condition: Optional[Union[str, "_models.RuleCondition"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Specify rule condition. Known values are: \"And\" and \"Or\".""" + destination_address_list: Optional[list[str]] = rest_field( + name="destinationAddressList", visibility=["read", "create", "update", "delete", "query"] + ) + """List of Addresses to be allowed or denied.""" + source_address_list: Optional[list[str]] = rest_field( + name="sourceAddressList", visibility=["read", "create", "update", "delete", "query"] + ) + """List of source IPv4 and IPv6 address to be allowed or denied.""" + header_address_list: Optional[list["_models.HeaderAddressProperties"]] = rest_field( + name="headerAddressList", visibility=["read", "create", "update", "delete", "query"] + ) + """List of header Name and source addresses associated with the header.""" + + @overload + def __init__( + self, + *, + action: Union[str, "_models.Action"], + address_list: Optional[list[str]] = None, + condition: Optional[Union[str, "_models.RuleCondition"]] = None, + destination_address_list: Optional[list[str]] = None, + source_address_list: Optional[list[str]] = None, + header_address_list: Optional[list["_models.HeaderAddressProperties"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SecretArchiveReference(_Model): + """A reference to a version of a secret in a key vault. + + :ivar key_vault_uri: A Uniform Resource Identifier (URI) for the secret in the key vault. + :vartype key_vault_uri: str + :ivar key_vault_id: The resource ID of the key vault containing the secret. + :vartype key_vault_id: str + :ivar secret_name: The name of the secret in the key vault. + :vartype secret_name: str + :ivar secret_version: The version of the secret in the key vault. + :vartype secret_version: str + """ + + key_vault_uri: Optional[str] = rest_field(name="keyVaultUri", visibility=["read"]) + """A Uniform Resource Identifier (URI) for the secret in the key vault.""" + key_vault_id: Optional[str] = rest_field(name="keyVaultId", visibility=["read"]) + """The resource ID of the key vault containing the secret.""" + secret_name: Optional[str] = rest_field(name="secretName", visibility=["read"]) + """The name of the secret in the key vault.""" + secret_version: Optional[str] = rest_field(name="secretVersion", visibility=["read"]) + """The version of the secret in the key vault.""" + + +class SecretRotationStatus(_Model): + """Status of a secret rotation for a device (Network Device or Terminal Server). + + :ivar last_rotation_time: The date and time when the secret was last changed. + :vartype last_rotation_time: ~datetime.datetime + :ivar synchronization_status: Whether the device has been configured with the latest version of + the secret. Known values are: "InSync", "Synchronizing", and "OutOfSync". + :vartype synchronization_status: str or + ~azure.mgmt.managednetworkfabric.models.SynchronizationStatus + :ivar secret_archive_reference: Reference to the currently configured version of the secret in + a key vault. + :vartype secret_archive_reference: + ~azure.mgmt.managednetworkfabric.models.SecretArchiveReference + :ivar secret_type: Identifies the secret according to its purpose. + :vartype secret_type: str + """ + + last_rotation_time: Optional[datetime.datetime] = rest_field( + name="lastRotationTime", visibility=["read"], format="rfc3339" + ) + """The date and time when the secret was last changed.""" + synchronization_status: Optional[Union[str, "_models.SynchronizationStatus"]] = rest_field( + name="synchronizationStatus", visibility=["read"] + ) + """Whether the device has been configured with the latest version of the secret. Known values are: + \"InSync\", \"Synchronizing\", and \"OutOfSync\".""" + secret_archive_reference: Optional["_models.SecretArchiveReference"] = rest_field( + name="secretArchiveReference", visibility=["read"] + ) + """Reference to the currently configured version of the secret in a key vault.""" + secret_type: Optional[str] = rest_field(name="secretType", visibility=["read"]) + """Identifies the secret according to its purpose.""" + + +class SecretRotationSummary(_Model): + """Overview of secret rotation for the Network Fabric. + + :ivar active_password_set_count: The number of active password sets configured on the devices. + :vartype active_password_set_count: int + """ + + active_password_set_count: Optional[int] = rest_field(name="activePasswordSetCount", visibility=["read"]) + """The number of active password sets configured on the devices.""" + + +class StatementActionPatchProperties(_Model): + """Route policy action properties. + + :ivar local_preference: Local Preference of the route policy. + :vartype local_preference: int + :ivar action_type: Action type. Example: Permit | Deny | Continue. Required. Known values are: + "Permit", "Deny", and "Continue". + :vartype action_type: str or ~azure.mgmt.managednetworkfabric.models.RoutePolicyActionType + :ivar ip_community_properties: IP Community Properties. + :vartype ip_community_properties: + ~azure.mgmt.managednetworkfabric.models.ActionIpCommunityPatchProperties + :ivar ip_extended_community_properties: IP Extended Community Properties. + :vartype ip_extended_community_properties: + ~azure.mgmt.managednetworkfabric.models.ActionIpExtendedCommunityPatchProperties + """ + + local_preference: Optional[int] = rest_field( + name="localPreference", visibility=["read", "create", "update", "delete", "query"] + ) + """Local Preference of the route policy.""" + action_type: Union[str, "_models.RoutePolicyActionType"] = rest_field( + name="actionType", visibility=["read", "create", "update", "delete", "query"] + ) + """Action type. Example: Permit | Deny | Continue. Required. Known values are: \"Permit\", + \"Deny\", and \"Continue\".""" + ip_community_properties: Optional["_models.ActionIpCommunityPatchProperties"] = rest_field( + name="ipCommunityProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """IP Community Properties.""" + ip_extended_community_properties: Optional["_models.ActionIpExtendedCommunityPatchProperties"] = rest_field( + name="ipExtendedCommunityProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """IP Extended Community Properties.""" + + @overload + def __init__( + self, + *, + action_type: Union[str, "_models.RoutePolicyActionType"], + local_preference: Optional[int] = None, + ip_community_properties: Optional["_models.ActionIpCommunityPatchProperties"] = None, + ip_extended_community_properties: Optional["_models.ActionIpExtendedCommunityPatchProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class StatementActionProperties(_Model): + """Route policy action properties. + + :ivar local_preference: Local Preference of the route policy. + :vartype local_preference: int + :ivar action_type: Action type. Example: Permit | Deny | Continue. Required. Known values are: + "Permit", "Deny", and "Continue". + :vartype action_type: str or ~azure.mgmt.managednetworkfabric.models.RoutePolicyActionType + :ivar ip_community_properties: IP Community Properties. + :vartype ip_community_properties: + ~azure.mgmt.managednetworkfabric.models.ActionIpCommunityProperties + :ivar ip_extended_community_properties: IP Extended Community Properties. + :vartype ip_extended_community_properties: + ~azure.mgmt.managednetworkfabric.models.ActionIpExtendedCommunityProperties + """ + + local_preference: Optional[int] = rest_field( + name="localPreference", visibility=["read", "create", "update", "delete", "query"] + ) + """Local Preference of the route policy.""" + action_type: Union[str, "_models.RoutePolicyActionType"] = rest_field( + name="actionType", visibility=["read", "create", "update", "delete", "query"] + ) + """Action type. Example: Permit | Deny | Continue. Required. Known values are: \"Permit\", + \"Deny\", and \"Continue\".""" + ip_community_properties: Optional["_models.ActionIpCommunityProperties"] = rest_field( + name="ipCommunityProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """IP Community Properties.""" + ip_extended_community_properties: Optional["_models.ActionIpExtendedCommunityProperties"] = rest_field( + name="ipExtendedCommunityProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """IP Extended Community Properties.""" + + @overload + def __init__( + self, + *, + action_type: Union[str, "_models.RoutePolicyActionType"], + local_preference: Optional[int] = None, + ip_community_properties: Optional["_models.ActionIpCommunityProperties"] = None, + ip_extended_community_properties: Optional["_models.ActionIpExtendedCommunityProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class StatementConditionPatchProperties(_Model): + """Route policy statement condition properties. + + :ivar ip_community_ids: List of IP Community resource IDs. + :vartype ip_community_ids: list[str] + :ivar ip_extended_community_ids: List of IP Extended Community resource IDs. + :vartype ip_extended_community_ids: list[str] + :ivar type: Type of the condition used. Known values are: "Or" and "And". + :vartype type: str or ~azure.mgmt.managednetworkfabric.models.RoutePolicyConditionType + :ivar ip_prefix_id: Arm Resource Id of IpPrefix. + :vartype ip_prefix_id: str + """ + + ip_community_ids: Optional[list[str]] = rest_field( + name="ipCommunityIds", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IP Community resource IDs.""" + ip_extended_community_ids: Optional[list[str]] = rest_field( + name="ipExtendedCommunityIds", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IP Extended Community resource IDs.""" + type: Optional[Union[str, "_models.RoutePolicyConditionType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Type of the condition used. Known values are: \"Or\" and \"And\".""" + ip_prefix_id: Optional[str] = rest_field( + name="ipPrefixId", visibility=["read", "create", "update", "delete", "query"] + ) + """Arm Resource Id of IpPrefix.""" + + @overload + def __init__( + self, + *, + ip_community_ids: Optional[list[str]] = None, + ip_extended_community_ids: Optional[list[str]] = None, + type: Optional[Union[str, "_models.RoutePolicyConditionType"]] = None, + ip_prefix_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class StatementConditionProperties(_Model): + """Route policy statement condition properties. + + :ivar ip_community_ids: List of IP Community resource IDs. + :vartype ip_community_ids: list[str] + :ivar ip_extended_community_ids: List of IP Extended Community resource IDs. + :vartype ip_extended_community_ids: list[str] + :ivar type: Type of the condition used. Known values are: "Or" and "And". + :vartype type: str or ~azure.mgmt.managednetworkfabric.models.RoutePolicyConditionType + :ivar ip_prefix_id: Arm Resource Id of IpPrefix. + :vartype ip_prefix_id: str + """ + + ip_community_ids: Optional[list[str]] = rest_field( + name="ipCommunityIds", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IP Community resource IDs.""" + ip_extended_community_ids: Optional[list[str]] = rest_field( + name="ipExtendedCommunityIds", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IP Extended Community resource IDs.""" + type: Optional[Union[str, "_models.RoutePolicyConditionType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Type of the condition used. Known values are: \"Or\" and \"And\".""" + ip_prefix_id: Optional[str] = rest_field( + name="ipPrefixId", visibility=["read", "create", "update", "delete", "query"] + ) + """Arm Resource Id of IpPrefix.""" + + @overload + def __init__( + self, + *, + ip_community_ids: Optional[list[str]] = None, + ip_extended_community_ids: Optional[list[str]] = None, + type: Optional[Union[str, "_models.RoutePolicyConditionType"]] = None, + ip_prefix_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class StaticRouteConfiguration(_Model): + """Static Route Configuration properties. + + :ivar bfd_configuration: BFD configuration properties. + :vartype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdConfiguration + :ivar ipv4_routes: List of IPv4 Routes. + :vartype ipv4_routes: list[~azure.mgmt.managednetworkfabric.models.StaticRouteProperties] + :ivar ipv6_routes: List of IPv6 Routes. + :vartype ipv6_routes: list[~azure.mgmt.managednetworkfabric.models.StaticRouteProperties] + :ivar extension: Extension. Example: NoExtension | NPB. Known values are: "NoExtension" and + "NPB". + :vartype extension: str or ~azure.mgmt.managednetworkfabric.models.Extension + """ + + bfd_configuration: Optional["_models.BfdConfiguration"] = rest_field( + name="bfdConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """BFD configuration properties.""" + ipv4_routes: Optional[list["_models.StaticRouteProperties"]] = rest_field( + name="ipv4Routes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IPv4 Routes.""" + ipv6_routes: Optional[list["_models.StaticRouteProperties"]] = rest_field( + name="ipv6Routes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IPv6 Routes.""" + extension: Optional[Union[str, "_models.Extension"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Extension. Example: NoExtension | NPB. Known values are: \"NoExtension\" and \"NPB\".""" + + @overload + def __init__( + self, + *, + bfd_configuration: Optional["_models.BfdConfiguration"] = None, + ipv4_routes: Optional[list["_models.StaticRouteProperties"]] = None, + ipv6_routes: Optional[list["_models.StaticRouteProperties"]] = None, + extension: Optional[Union[str, "_models.Extension"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class StaticRoutePatchConfiguration(_Model): + """Static Route Configuration properties. + + :ivar bfd_configuration: BFD configuration properties. + :vartype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdPatchConfiguration + :ivar ipv4_routes: List of IPv4 Routes. + :vartype ipv4_routes: list[~azure.mgmt.managednetworkfabric.models.StaticRoutePatchProperties] + :ivar ipv6_routes: List of IPv6 Routes. + :vartype ipv6_routes: list[~azure.mgmt.managednetworkfabric.models.StaticRoutePatchProperties] + """ + + bfd_configuration: Optional["_models.BfdPatchConfiguration"] = rest_field( + name="bfdConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """BFD configuration properties.""" + ipv4_routes: Optional[list["_models.StaticRoutePatchProperties"]] = rest_field( + name="ipv4Routes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IPv4 Routes.""" + ipv6_routes: Optional[list["_models.StaticRoutePatchProperties"]] = rest_field( + name="ipv6Routes", visibility=["read", "create", "update", "delete", "query"] + ) + """List of IPv6 Routes.""" + + @overload + def __init__( + self, + *, + bfd_configuration: Optional["_models.BfdPatchConfiguration"] = None, + ipv4_routes: Optional[list["_models.StaticRoutePatchProperties"]] = None, + ipv6_routes: Optional[list["_models.StaticRoutePatchProperties"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class StaticRoutePatchProperties(_Model): + """Route Properties. + + :ivar prefix: Prefix of the route. Required. + :vartype prefix: str + :ivar next_hop: List of next hop addresses. Required. + :vartype next_hop: list[str] + """ + + prefix: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Prefix of the route. Required.""" + next_hop: list[str] = rest_field(name="nextHop", visibility=["read", "create", "update", "delete", "query"]) + """List of next hop addresses. Required.""" + + @overload + def __init__( + self, + *, + prefix: str, + next_hop: list[str], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class StaticRouteProperties(_Model): + """Route Properties. + + :ivar prefix: Prefix of the route. Required. + :vartype prefix: str + :ivar next_hop: List of next hop addresses. Required. + :vartype next_hop: list[str] + """ + + prefix: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Prefix of the route. Required.""" + next_hop: list[str] = rest_field(name="nextHop", visibility=["read", "create", "update", "delete", "query"]) + """List of next hop addresses. Required.""" + + @overload + def __init__( + self, + *, + prefix: str, + next_hop: list[str], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class StaticRouteRoutePolicy(_Model): + """Static Route - route policy properties. + + :ivar export_route_policy: Array of ARM Resource ID of the RoutePolicies. + :vartype export_route_policy: ~azure.mgmt.managednetworkfabric.models.L3ExportRoutePolicy + """ + + export_route_policy: Optional["_models.L3ExportRoutePolicy"] = rest_field( + name="exportRoutePolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Array of ARM Resource ID of the RoutePolicies.""" + + @overload + def __init__( + self, + *, + export_route_policy: Optional["_models.L3ExportRoutePolicy"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class StaticRouteRoutePolicyPatch(_Model): + """Static Route - route policy properties. + + :ivar export_route_policy: Array of ARM Resource ID of the RoutePolicies. + :vartype export_route_policy: ~azure.mgmt.managednetworkfabric.models.L3ExportRoutePolicyPatch + """ + + export_route_policy: Optional["_models.L3ExportRoutePolicyPatch"] = rest_field( + name="exportRoutePolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Array of ARM Resource ID of the RoutePolicies.""" + + @overload + def __init__( + self, + *, + export_route_policy: Optional["_models.L3ExportRoutePolicyPatch"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class StationConnectionPatchProperties(_Model): + """Station Connection PATCH Properties. + + :ivar keepalive_idle_time: Connection keepalive idle time in seconds. + :vartype keepalive_idle_time: int + :ivar probe_interval: Probe interval in seconds, default value is 60. + :vartype probe_interval: int + :ivar probe_count: Probe count, default value is 10. + :vartype probe_count: int + """ + + keepalive_idle_time: Optional[int] = rest_field( + name="keepaliveIdleTime", visibility=["read", "create", "update", "delete", "query"] + ) + """Connection keepalive idle time in seconds.""" + probe_interval: Optional[int] = rest_field( + name="probeInterval", visibility=["read", "create", "update", "delete", "query"] + ) + """Probe interval in seconds, default value is 60.""" + probe_count: Optional[int] = rest_field( + name="probeCount", visibility=["read", "create", "update", "delete", "query"] + ) + """Probe count, default value is 10.""" + + @overload + def __init__( + self, + *, + keepalive_idle_time: Optional[int] = None, + probe_interval: Optional[int] = None, + probe_count: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class StationConnectionProperties(_Model): + """Station Connection Properties. + + :ivar keepalive_idle_time: Connection keepalive idle time in seconds. + :vartype keepalive_idle_time: int + :ivar probe_interval: Probe interval in seconds, default value is 60. + :vartype probe_interval: int + :ivar probe_count: Probe count, default value is 10. + :vartype probe_count: int + """ + + keepalive_idle_time: Optional[int] = rest_field( + name="keepaliveIdleTime", visibility=["read", "create", "update", "delete", "query"] + ) + """Connection keepalive idle time in seconds.""" + probe_interval: Optional[int] = rest_field( + name="probeInterval", visibility=["read", "create", "update", "delete", "query"] + ) + """Probe interval in seconds, default value is 60.""" + probe_count: Optional[int] = rest_field( + name="probeCount", visibility=["read", "create", "update", "delete", "query"] + ) + """Probe count, default value is 10.""" + + @overload + def __init__( + self, + *, + keepalive_idle_time: Optional[int] = None, + probe_interval: Optional[int] = None, + probe_count: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class StorageAccountConfiguration(_Model): + """Storage account configuration. + + :ivar storage_account_id: Network Fabric storage account resource identifier. + :vartype storage_account_id: str + :ivar storage_account_identity: The selection of the managed identity to use with this storage + account. The identity type must be either system assigned or user assigned. + :vartype storage_account_identity: ~azure.mgmt.managednetworkfabric.models.IdentitySelector + """ + + storage_account_id: Optional[str] = rest_field( + name="storageAccountId", visibility=["read", "create", "update", "delete", "query"] + ) + """Network Fabric storage account resource identifier.""" + storage_account_identity: Optional["_models.IdentitySelector"] = rest_field( + name="storageAccountIdentity", visibility=["read", "create", "update", "delete", "query"] + ) + """The selection of the managed identity to use with this storage account. The identity type must + be either system assigned or user assigned.""" + + @overload + def __init__( + self, + *, + storage_account_id: Optional[str] = None, + storage_account_identity: Optional["_models.IdentitySelector"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class StorageAccountPatchConfiguration(_Model): + """Storage account configuration. + + :ivar storage_account_id: Network Fabric storage account resource identifier. + :vartype storage_account_id: str + :ivar storage_account_identity: The selection of the managed identity to use with this storage + account. The identity type must be either system assigned or user assigned. + :vartype storage_account_identity: + ~azure.mgmt.managednetworkfabric.models.IdentitySelectorPatch + """ + + storage_account_id: Optional[str] = rest_field( + name="storageAccountId", visibility=["read", "create", "update", "delete", "query"] + ) + """Network Fabric storage account resource identifier.""" + storage_account_identity: Optional["_models.IdentitySelectorPatch"] = rest_field( + name="storageAccountIdentity", visibility=["read", "create", "update", "delete", "query"] + ) + """The selection of the managed identity to use with this storage account. The identity type must + be either system assigned or user assigned.""" + + @overload + def __init__( + self, + *, + storage_account_id: Optional[str] = None, + storage_account_identity: Optional["_models.IdentitySelectorPatch"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SupportedConnectorProperties(_Model): + """Supported connector properties. + + :ivar connector_type: Type of connector used. Example: Optical. + :vartype connector_type: str + :ivar max_speed_in_mbps: Maximum speed of the connector in Mbps. + :vartype max_speed_in_mbps: int + """ + + connector_type: Optional[str] = rest_field( + name="connectorType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of connector used. Example: Optical.""" + max_speed_in_mbps: Optional[int] = rest_field( + name="maxSpeedInMbps", visibility=["read", "create", "update", "delete", "query"] + ) + """Maximum speed of the connector in Mbps.""" + + @overload + def __init__( + self, + *, + connector_type: Optional[str] = None, + max_speed_in_mbps: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SupportedVersionProperties(_Model): + """Supported version details of the network device. + + :ivar version: Operating system and firmware combined versions. + :vartype version: str + :ivar vendor_os_version: Operating system version. + :vartype vendor_os_version: str + :ivar vendor_firmware_version: Firmware version. + :vartype vendor_firmware_version: str + :ivar is_default: If true newly provisioned Fabric will use this device version by default to + bootstrap the network devices for the first time. Known values are: "True" and "False". + :vartype is_default: str or ~azure.mgmt.managednetworkfabric.models.BooleanEnumProperty + """ + + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operating system and firmware combined versions.""" + vendor_os_version: Optional[str] = rest_field( + name="vendorOsVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """Operating system version.""" + vendor_firmware_version: Optional[str] = rest_field( + name="vendorFirmwareVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """Firmware version.""" + is_default: Optional[Union[str, "_models.BooleanEnumProperty"]] = rest_field( + name="isDefault", visibility=["read", "create", "update", "delete", "query"] + ) + """If true newly provisioned Fabric will use this device version by default to bootstrap the + network devices for the first time. Known values are: \"True\" and \"False\".""" + + @overload + def __init__( + self, + *, + version: Optional[str] = None, + vendor_os_version: Optional[str] = None, + vendor_firmware_version: Optional[str] = None, + is_default: Optional[Union[str, "_models.BooleanEnumProperty"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SystemData(_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.managednetworkfabric.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.managednetworkfabric.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + created_by: Optional[str] = rest_field(name="createdBy", visibility=["read", "create", "update", "delete", "query"]) + """The identity that created the resource.""" + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="createdByType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + created_at: Optional[datetime.datetime] = rest_field( + name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp of resource creation (UTC).""" + last_modified_by: Optional[str] = rest_field( + name="lastModifiedBy", visibility=["read", "create", "update", "delete", "query"] + ) + """The identity that last modified the resource.""" + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="lastModifiedByType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + last_modified_at: Optional[datetime.datetime] = rest_field( + name="lastModifiedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp of resource last modification (UTC).""" + + @overload + 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, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TerminalServerConfiguration(_Model): + """Network and credentials configuration currently applied to terminal server. + + :ivar username: Username for the terminal server connection. Required. + :vartype username: str + :ivar password: Password for the terminal server connection. Required. + :vartype password: str + :ivar serial_number: Serial Number of Terminal server. + :vartype serial_number: str + :ivar primary_ipv4_prefix: IPv4 Address Prefix. Required. + :vartype primary_ipv4_prefix: str + :ivar primary_ipv6_prefix: IPv6 Address Prefix. + :vartype primary_ipv6_prefix: str + :ivar secondary_ipv4_prefix: Secondary IPv4 Address Prefix. Required. + :vartype secondary_ipv4_prefix: str + :ivar secondary_ipv6_prefix: Secondary IPv6 Address Prefix. + :vartype secondary_ipv6_prefix: str + :ivar network_device_id: ARM Resource ID used for the NetworkDevice. + :vartype network_device_id: str + :ivar secret_rotation_status: Secret rotation status for the terminal server's secrets. + :vartype secret_rotation_status: + list[~azure.mgmt.managednetworkfabric.models.SecretRotationStatus] + """ + + username: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Username for the terminal server connection. Required.""" + password: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Password for the terminal server connection. Required.""" + serial_number: Optional[str] = rest_field( + name="serialNumber", visibility=["read", "create", "update", "delete", "query"] + ) + """Serial Number of Terminal server.""" + primary_ipv4_prefix: str = rest_field( + name="primaryIpv4Prefix", visibility=["read", "create", "update", "delete", "query"] + ) + """IPv4 Address Prefix. Required.""" + primary_ipv6_prefix: Optional[str] = rest_field( + name="primaryIpv6Prefix", visibility=["read", "create", "update", "delete", "query"] + ) + """IPv6 Address Prefix.""" + secondary_ipv4_prefix: str = rest_field( + name="secondaryIpv4Prefix", visibility=["read", "create", "update", "delete", "query"] + ) + """Secondary IPv4 Address Prefix. Required.""" + secondary_ipv6_prefix: Optional[str] = rest_field( + name="secondaryIpv6Prefix", visibility=["read", "create", "update", "delete", "query"] + ) + """Secondary IPv6 Address Prefix.""" + network_device_id: Optional[str] = rest_field(name="networkDeviceId", visibility=["read"]) + """ARM Resource ID used for the NetworkDevice.""" + secret_rotation_status: Optional[list["_models.SecretRotationStatus"]] = rest_field( + name="secretRotationStatus", visibility=["read"] + ) + """Secret rotation status for the terminal server's secrets.""" + + @overload + def __init__( + self, + *, + username: str, + password: str, + primary_ipv4_prefix: str, + secondary_ipv4_prefix: str, + serial_number: Optional[str] = None, + primary_ipv6_prefix: Optional[str] = None, + secondary_ipv6_prefix: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TerminalServerPatchConfiguration(_Model): + """Network and credentials configuration already applied to terminal server. + + :ivar username: Username for the terminal server connection. + :vartype username: str + :ivar password: Password for the terminal server connection. + :vartype password: str + :ivar serial_number: Serial Number of Terminal server. + :vartype serial_number: str + :ivar primary_ipv4_prefix: IPv4 Address Prefix. + :vartype primary_ipv4_prefix: str + :ivar primary_ipv6_prefix: IPv6 Address Prefix. + :vartype primary_ipv6_prefix: str + :ivar secondary_ipv4_prefix: Secondary IPv4 Address Prefix. + :vartype secondary_ipv4_prefix: str + :ivar secondary_ipv6_prefix: Secondary IPv6 Address Prefix. + :vartype secondary_ipv6_prefix: str + """ + + username: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Username for the terminal server connection.""" + password: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Password for the terminal server connection.""" + serial_number: Optional[str] = rest_field( + name="serialNumber", visibility=["read", "create", "update", "delete", "query"] + ) + """Serial Number of Terminal server.""" + primary_ipv4_prefix: Optional[str] = rest_field( + name="primaryIpv4Prefix", visibility=["read", "create", "update", "delete", "query"] + ) + """IPv4 Address Prefix.""" + primary_ipv6_prefix: Optional[str] = rest_field( + name="primaryIpv6Prefix", visibility=["read", "create", "update", "delete", "query"] + ) + """IPv6 Address Prefix.""" + secondary_ipv4_prefix: Optional[str] = rest_field( + name="secondaryIpv4Prefix", visibility=["read", "create", "update", "delete", "query"] + ) + """Secondary IPv4 Address Prefix.""" + secondary_ipv6_prefix: Optional[str] = rest_field( + name="secondaryIpv6Prefix", visibility=["read", "create", "update", "delete", "query"] + ) + """Secondary IPv6 Address Prefix.""" + + @overload + def __init__( + self, + *, + username: Optional[str] = None, + password: Optional[str] = None, + serial_number: Optional[str] = None, + primary_ipv4_prefix: Optional[str] = None, + primary_ipv6_prefix: Optional[str] = None, + secondary_ipv4_prefix: Optional[str] = None, + secondary_ipv6_prefix: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class UniqueRouteDistinguisherPatchProperties(_Model): + """Unique Route Distinguisher configuration properties. + + :ivar unique_rd_configuration_state: Unique Route Distinguisher configuration state. Default is + Enabled. Known values are: "Enabled" and "Disabled". + :vartype unique_rd_configuration_state: str or + ~azure.mgmt.managednetworkfabric.models.UniqueRouteDistinguisherConfigurationState + :ivar nni_derived_unique_rd_configuration_state: NNI derived unique Route Distinguisher state. + Default is Disabled. Known values are: "Enabled" and "Disabled". + :vartype nni_derived_unique_rd_configuration_state: str or + ~azure.mgmt.managednetworkfabric.models.NNIDerivedUniqueRouteDistinguisherConfigurationState + """ + + unique_rd_configuration_state: Optional[Union[str, "_models.UniqueRouteDistinguisherConfigurationState"]] = ( + rest_field(name="uniqueRdConfigurationState", visibility=["read", "create", "update", "delete", "query"]) + ) + """Unique Route Distinguisher configuration state. Default is Enabled. Known values are: + \"Enabled\" and \"Disabled\".""" + nni_derived_unique_rd_configuration_state: Optional[ + Union[str, "_models.NNIDerivedUniqueRouteDistinguisherConfigurationState"] + ] = rest_field( + name="nniDerivedUniqueRdConfigurationState", visibility=["read", "create", "update", "delete", "query"] + ) + """NNI derived unique Route Distinguisher state. Default is Disabled. Known values are: + \"Enabled\" and \"Disabled\".""" + + @overload + def __init__( + self, + *, + unique_rd_configuration_state: Optional[ + Union[str, "_models.UniqueRouteDistinguisherConfigurationState"] + ] = None, + nni_derived_unique_rd_configuration_state: Optional[ + Union[str, "_models.NNIDerivedUniqueRouteDistinguisherConfigurationState"] + ] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class UniqueRouteDistinguisherProperties(_Model): + """Unique Route Distinguisher properties. + + :ivar unique_rd_configuration_state: Unique Route Distinguisher configuration state. Default is + Enabled. Known values are: "Enabled" and "Disabled". + :vartype unique_rd_configuration_state: str or + ~azure.mgmt.managednetworkfabric.models.UniqueRouteDistinguisherConfigurationState + :ivar unique_rds: List of Unique Route Distinguisher addresses. + :vartype unique_rds: list[str] + :ivar nni_derived_unique_rd_configuration_state: NNI derived unique Route Distinguisher state. + Default is Disabled. Known values are: "Enabled" and "Disabled". + :vartype nni_derived_unique_rd_configuration_state: str or + ~azure.mgmt.managednetworkfabric.models.NNIDerivedUniqueRouteDistinguisherConfigurationState + """ + + unique_rd_configuration_state: Optional[Union[str, "_models.UniqueRouteDistinguisherConfigurationState"]] = ( + rest_field(name="uniqueRdConfigurationState", visibility=["read", "create", "update", "delete", "query"]) + ) + """Unique Route Distinguisher configuration state. Default is Enabled. Known values are: + \"Enabled\" and \"Disabled\".""" + unique_rds: Optional[list[str]] = rest_field(name="uniqueRds", visibility=["read"]) + """List of Unique Route Distinguisher addresses.""" + nni_derived_unique_rd_configuration_state: Optional[ + Union[str, "_models.NNIDerivedUniqueRouteDistinguisherConfigurationState"] + ] = rest_field( + name="nniDerivedUniqueRdConfigurationState", visibility=["read", "create", "update", "delete", "query"] + ) + """NNI derived unique Route Distinguisher state. Default is Disabled. Known values are: + \"Enabled\" and \"Disabled\".""" + + @overload + def __init__( + self, + *, + unique_rd_configuration_state: Optional[ + Union[str, "_models.UniqueRouteDistinguisherConfigurationState"] + ] = None, + nni_derived_unique_rd_configuration_state: Optional[ + Union[str, "_models.NNIDerivedUniqueRouteDistinguisherConfigurationState"] + ] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class UpdateAdministrativeState(EnableDisableOnResources): + """Update administrative state on list of resources. + + :ivar resource_ids: Network Fabrics or Network Rack resource Id. + :vartype resource_ids: list[str] + :ivar state: Administrative state. Known values are: "Enable", "Disable", and + "UnderMaintenance". + :vartype state: str or ~azure.mgmt.managednetworkfabric.models.EnableDisableState + """ + + state: Optional[Union[str, "_models.EnableDisableState"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Administrative state. Known values are: \"Enable\", \"Disable\", and \"UnderMaintenance\".""" + + @overload + def __init__( + self, + *, + resource_ids: Optional[list[str]] = None, + state: Optional[Union[str, "_models.EnableDisableState"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class UpdateAdministrativeStateResponse(_Model): + """Update Administrative State Response. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + :ivar properties: Response properties in case of successful administrative state update. + :vartype properties: + ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponseProperties + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the async operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + percent_complete: Optional[float] = rest_field( + name="percentComplete", visibility=["read", "create", "update", "delete", "query"] + ) + """Percent of the operation that is complete.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the operation.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the operation.""" + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operations list.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If present, details of the operation error.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + properties: Optional["_models.UpdateAdministrativeStateResponseProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Response properties in case of successful administrative state update.""" + + @overload + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + properties: Optional["_models.UpdateAdministrativeStateResponseProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class UpdateAdministrativeStateResponseProperties(_Model): # pylint: disable=name-too-long + """Update Administrative State Response Properties. + + :ivar successful_resources: List of ARM Resource IDs for which the given action applied + successfully. + :vartype successful_resources: list[str] + :ivar failed_resources: List of ARM Resource IDs for which the given action failed to apply. + :vartype failed_resources: list[str] + """ + + successful_resources: Optional[list[str]] = rest_field( + name="successfulResources", visibility=["read", "create", "update", "delete", "query"] + ) + """List of ARM Resource IDs for which the given action applied successfully.""" + failed_resources: Optional[list[str]] = rest_field( + name="failedResources", visibility=["read", "create", "update", "delete", "query"] + ) + """List of ARM Resource IDs for which the given action failed to apply.""" + + @overload + def __init__( + self, + *, + successful_resources: Optional[list[str]] = None, + failed_resources: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class UpdateDeviceAdministrativeState(EnableDisableOnResources): + """Update the administrative state on list of resources. + + :ivar resource_ids: Network Fabrics or Network Rack resource Id. + :vartype resource_ids: list[str] + :ivar state: Administrative state. Known values are: "RMA", "UngracefulRMA", "Resync", + "GracefulQuarantine", "UngracefulQuarantine", "Quarantine", "UnderMaintenance", "Enable", and + "Disable". + :vartype state: str or ~azure.mgmt.managednetworkfabric.models.DeviceAdministrativeState + """ + + state: Optional[Union[str, "_models.DeviceAdministrativeState"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Administrative state. Known values are: \"RMA\", \"UngracefulRMA\", \"Resync\", + \"GracefulQuarantine\", \"UngracefulQuarantine\", \"Quarantine\", \"UnderMaintenance\", + \"Enable\", and \"Disable\".""" + + @overload + def __init__( + self, + *, + resource_ids: Optional[list[str]] = None, + state: Optional[Union[str, "_models.DeviceAdministrativeState"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class UpdateVersion(_Model): + """Update version properties. + + :ivar version: Specify the version. + :vartype version: str + """ + + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Specify the version.""" + + @overload + def __init__( + self, + *, + version: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class UpgradeNetworkFabricProperties(UpdateVersion): + """Model used for Upgrade Network Fabric Properties. + + :ivar version: Specify the version. + :vartype version: str + :ivar action: Action to be performed while upgrading the fabric. Known values are: "Start" and + "Complete". + :vartype action: str or ~azure.mgmt.managednetworkfabric.models.NetworkFabricUpgradeAction + """ + + action: Optional[Union[str, "_models.NetworkFabricUpgradeAction"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Action to be performed while upgrading the fabric. Known values are: \"Start\" and + \"Complete\".""" + + @overload + def __init__( + self, + *, + version: Optional[str] = None, + action: Optional[Union[str, "_models.NetworkFabricUpgradeAction"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class UserAssignedIdentity(_Model): + """User assigned identity properties. + + :ivar principal_id: The principal ID of the assigned identity. + :vartype principal_id: str + :ivar client_id: The client ID of the assigned identity. + :vartype client_id: str + """ + + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The principal ID of the assigned identity.""" + client_id: Optional[str] = rest_field(name="clientId", visibility=["read"]) + """The client ID of the assigned identity.""" + + +class ValidateConfigurationProperties(_Model): + """Validation configuration properties. + + :ivar validate_action: Validate action that to be performed. Known values are: "Cabling", + "Configuration", and "Connectivity". + :vartype validate_action: str or ~azure.mgmt.managednetworkfabric.models.ValidateAction + """ + + validate_action: Optional[Union[str, "_models.ValidateAction"]] = rest_field( + name="validateAction", visibility=["read", "create", "update", "delete", "query"] + ) + """Validate action that to be performed. Known values are: \"Cabling\", \"Configuration\", and + \"Connectivity\".""" + + @overload + def __init__( + self, + *, + validate_action: Optional[Union[str, "_models.ValidateAction"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ValidateConfigurationResponse(CommonErrorResponse): + """The response of the action validate configuration. + + :ivar error: The error object. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar configuration_state: Gets the configuration state. Known values are: "Succeeded", + "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", + "Deprovisioned", "ErrorDeprovisioning", "DeferredControl", "Provisioning", "PendingCommit", and + "PendingAdministrativeUpdate". + :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState + :ivar url: URL for the details of the response. + :vartype url: str + """ + + configuration_state: Optional[Union[str, "_models.ConfigurationState"]] = rest_field( + name="configurationState", visibility=["read"] + ) + """Gets the configuration state. Known values are: \"Succeeded\", \"Failed\", \"Rejected\", + \"Accepted\", \"Provisioned\", \"ErrorProvisioning\", \"Deprovisioning\", \"Deprovisioned\", + \"ErrorDeprovisioning\", \"DeferredControl\", \"Provisioning\", \"PendingCommit\", and + \"PendingAdministrativeUpdate\".""" + url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """URL for the details of the response.""" + + @overload + def __init__( + self, + *, + error: Optional["_models.ErrorDetail"] = None, + url: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ViewDeviceConfigurationOperationResponse(_Model): + """View Device Configuration Response V2. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + :ivar properties: View Device Configuration Response Properties. + :vartype properties: + ~azure.mgmt.managednetworkfabric.models.ViewDeviceConfigurationResponseProperties + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the async operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + percent_complete: Optional[float] = rest_field( + name="percentComplete", visibility=["read", "create", "update", "delete", "query"] + ) + """Percent of the operation that is complete.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the operation.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the operation.""" + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operations list.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If present, details of the operation error.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + properties: Optional["_models.ViewDeviceConfigurationResponseProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """View Device Configuration Response Properties.""" + + @overload + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + properties: Optional["_models.ViewDeviceConfigurationResponseProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ViewDeviceConfigurationResponseProperties(_Model): # pylint: disable=name-too-long + """View Device Configuration Response Properties. + + :ivar device_configuration_url: Storage URL to the device configuration file. + :vartype device_configuration_url: str + """ + + device_configuration_url: Optional[str] = rest_field( + name="deviceConfigurationUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """Storage URL to the device configuration file.""" + + @overload + def __init__( + self, + *, + device_configuration_url: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class VlanGroupPatchProperties(_Model): + """Vlan group properties. + + :ivar name: Vlan group name. + :vartype name: str + :ivar vlans: List of vlans. + :vartype vlans: list[str] + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Vlan group name.""" + vlans: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of vlans.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + vlans: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class VlanGroupProperties(_Model): + """Vlan group properties. + + :ivar name: Vlan group name. + :vartype name: str + :ivar vlans: List of vlans. + :vartype vlans: list[str] + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Vlan group name.""" + vlans: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of vlans.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + vlans: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class VlanMatchCondition(_Model): + """The vlan match conditions that need to be matched. + + :ivar vlans: List of vlans that need to be matched. Inputs can be single vlan or the range of + vlans. + :vartype vlans: list[str] + :ivar inner_vlans: List of inner vlans that need to be matched.Inputs can be single vlan or the + range of vlans. + :vartype inner_vlans: list[str] + :ivar vlan_group_names: List of vlan group names that need to be matched. + :vartype vlan_group_names: list[str] + """ + + vlans: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of vlans that need to be matched. Inputs can be single vlan or the range of vlans.""" + inner_vlans: Optional[list[str]] = rest_field( + name="innerVlans", visibility=["read", "create", "update", "delete", "query"] + ) + """List of inner vlans that need to be matched.Inputs can be single vlan or the range of vlans.""" + vlan_group_names: Optional[list[str]] = rest_field( + name="vlanGroupNames", visibility=["read", "create", "update", "delete", "query"] + ) + """List of vlan group names that need to be matched.""" + + @overload + def __init__( + self, + *, + vlans: Optional[list[str]] = None, + inner_vlans: Optional[list[str]] = None, + vlan_group_names: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class VlanMatchConditionPatch(_Model): + """The vlan match conditions that need to be matched. + + :ivar vlans: List of vlans that need to be matched. Inputs can be single vlan or the range of + vlans. + :vartype vlans: list[str] + :ivar inner_vlans: List of inner vlans that need to be matched.Inputs can be single vlan or the + range of vlans. + :vartype inner_vlans: list[str] + :ivar vlan_group_names: List of vlan group names that need to be matched. + :vartype vlan_group_names: list[str] + """ + + vlans: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of vlans that need to be matched. Inputs can be single vlan or the range of vlans.""" + inner_vlans: Optional[list[str]] = rest_field( + name="innerVlans", visibility=["read", "create", "update", "delete", "query"] + ) + """List of inner vlans that need to be matched.Inputs can be single vlan or the range of vlans.""" + vlan_group_names: Optional[list[str]] = rest_field( + name="vlanGroupNames", visibility=["read", "create", "update", "delete", "query"] + ) + """List of vlan group names that need to be matched.""" + + @overload + def __init__( + self, + *, + vlans: Optional[list[str]] = None, + inner_vlans: Optional[list[str]] = None, + vlan_group_names: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class VpnConfigurationPatchableProperties(_Model): + """Network and credential configuration currently applied on terminal server. + + :ivar network_to_network_interconnect_id: ARM Resource ID of the Network To Network + Interconnect. + :vartype network_to_network_interconnect_id: str + :ivar peering_option: Peering option list. Known values are: "OptionA" and "OptionB". + :vartype peering_option: str or ~azure.mgmt.managednetworkfabric.models.PeeringOption + :ivar option_b_properties: option B properties. + :vartype option_b_properties: ~azure.mgmt.managednetworkfabric.models.VpnOptionBPatchProperties + :ivar option_a_properties: option A properties. + :vartype option_a_properties: ~azure.mgmt.managednetworkfabric.models.VpnOptionAPatchProperties + """ + + network_to_network_interconnect_id: Optional[str] = rest_field( + name="networkToNetworkInterconnectId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM Resource ID of the Network To Network Interconnect.""" + peering_option: Optional[Union[str, "_models.PeeringOption"]] = rest_field( + name="peeringOption", visibility=["read", "create", "update", "delete", "query"] + ) + """Peering option list. Known values are: \"OptionA\" and \"OptionB\".""" + option_b_properties: Optional["_models.VpnOptionBPatchProperties"] = rest_field( + name="optionBProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """option B properties.""" + option_a_properties: Optional["_models.VpnOptionAPatchProperties"] = rest_field( + name="optionAProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """option A properties.""" + + @overload + def __init__( + self, + *, + network_to_network_interconnect_id: Optional[str] = None, + peering_option: Optional[Union[str, "_models.PeeringOption"]] = None, + option_b_properties: Optional["_models.VpnOptionBPatchProperties"] = None, + option_a_properties: Optional["_models.VpnOptionAPatchProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class VpnConfigurationProperties(_Model): + """Network and credential configuration currently applied on terminal server. + + :ivar network_to_network_interconnect_id: ARM Resource ID of the Network To Network + Interconnect. + :vartype network_to_network_interconnect_id: str + :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", + "Disabled", "MAT", "RMA", "UnderMaintenance", and "EnabledDegraded". + :vartype administrative_state: str or + ~azure.mgmt.managednetworkfabric.models.AdministrativeState + :ivar peering_option: Peering option list. Required. Known values are: "OptionA" and "OptionB". + :vartype peering_option: str or ~azure.mgmt.managednetworkfabric.models.PeeringOption + :ivar option_b_properties: option B properties. + :vartype option_b_properties: ~azure.mgmt.managednetworkfabric.models.VpnOptionBProperties + :ivar option_a_properties: option A properties. + :vartype option_a_properties: ~azure.mgmt.managednetworkfabric.models.VpnOptionAProperties + """ + + network_to_network_interconnect_id: Optional[str] = rest_field( + name="networkToNetworkInterconnectId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM Resource ID of the Network To Network Interconnect.""" + administrative_state: Optional[Union[str, "_models.AdministrativeState"]] = rest_field( + name="administrativeState", visibility=["read"] + ) + """Administrative state of the resource. Known values are: \"Enabled\", \"Disabled\", \"MAT\", + \"RMA\", \"UnderMaintenance\", and \"EnabledDegraded\".""" + peering_option: Union[str, "_models.PeeringOption"] = rest_field( + name="peeringOption", visibility=["read", "create", "update", "delete", "query"] + ) + """Peering option list. Required. Known values are: \"OptionA\" and \"OptionB\".""" + option_b_properties: Optional["_models.VpnOptionBProperties"] = rest_field( + name="optionBProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """option B properties.""" + option_a_properties: Optional["_models.VpnOptionAProperties"] = rest_field( + name="optionAProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """option A properties.""" + + @overload + def __init__( + self, + *, + peering_option: Union[str, "_models.PeeringOption"], + network_to_network_interconnect_id: Optional[str] = None, + option_b_properties: Optional["_models.VpnOptionBProperties"] = None, + option_a_properties: Optional["_models.VpnOptionAProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class VpnOptionAPatchProperties(Layer3IpPrefixPatchProperties): + """Peering optionA properties. + + :ivar primary_ipv4_prefix: IPv4 Address Prefix. + :vartype primary_ipv4_prefix: str + :ivar primary_ipv6_prefix: IPv6 Address Prefix. + :vartype primary_ipv6_prefix: str + :ivar secondary_ipv4_prefix: Secondary IPv4 Address Prefix. + :vartype secondary_ipv4_prefix: str + :ivar secondary_ipv6_prefix: Secondary IPv6 Address Prefix. + :vartype secondary_ipv6_prefix: str + :ivar mtu: MTU to use for option A peering. + :vartype mtu: int + :ivar vlan_id: Vlan Id.Example : 501. + :vartype vlan_id: int + :ivar peer_asn: Peer ASN number.Example : 28. + :vartype peer_asn: int + :ivar bfd_configuration: BFD Configuration properties. + :vartype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdPatchConfiguration + """ + + mtu: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """MTU to use for option A peering.""" + vlan_id: Optional[int] = rest_field(name="vlanId", visibility=["read", "create", "update", "delete", "query"]) + """Vlan Id.Example : 501.""" + peer_asn: Optional[int] = rest_field(name="peerASN", visibility=["read", "create", "update", "delete", "query"]) + """Peer ASN number.Example : 28.""" + bfd_configuration: Optional["_models.BfdPatchConfiguration"] = rest_field( + name="bfdConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """BFD Configuration properties.""" + + @overload + def __init__( + self, + *, + primary_ipv4_prefix: Optional[str] = None, + primary_ipv6_prefix: Optional[str] = None, + secondary_ipv4_prefix: Optional[str] = None, + secondary_ipv6_prefix: Optional[str] = None, + mtu: Optional[int] = None, + vlan_id: Optional[int] = None, + peer_asn: Optional[int] = None, + bfd_configuration: Optional["_models.BfdPatchConfiguration"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class VpnOptionAProperties(Layer3IpPrefixProperties): + """option A properties. + + :ivar primary_ipv4_prefix: IPv4 Address Prefix. + :vartype primary_ipv4_prefix: str + :ivar primary_ipv6_prefix: IPv6 Address Prefix. + :vartype primary_ipv6_prefix: str + :ivar secondary_ipv4_prefix: Secondary IPv4 Address Prefix. + :vartype secondary_ipv4_prefix: str + :ivar secondary_ipv6_prefix: Secondary IPv6 Address Prefix. + :vartype secondary_ipv6_prefix: str + :ivar mtu: MTU to use for option A peering. + :vartype mtu: int + :ivar vlan_id: Vlan Id.Example : 501. Required. + :vartype vlan_id: int + :ivar peer_asn: Peer ASN number.Example : 28. Required. + :vartype peer_asn: int + :ivar bfd_configuration: BFD Configuration properties. + :vartype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdConfiguration + """ + + mtu: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """MTU to use for option A peering.""" + vlan_id: int = rest_field(name="vlanId", visibility=["read", "create", "update", "delete", "query"]) + """Vlan Id.Example : 501. Required.""" + peer_asn: int = rest_field(name="peerASN", visibility=["read", "create", "update", "delete", "query"]) + """Peer ASN number.Example : 28. Required.""" + bfd_configuration: Optional["_models.BfdConfiguration"] = rest_field( + name="bfdConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """BFD Configuration properties.""" + + @overload + def __init__( + self, + *, + vlan_id: int, + peer_asn: int, + primary_ipv4_prefix: Optional[str] = None, + primary_ipv6_prefix: Optional[str] = None, + secondary_ipv4_prefix: Optional[str] = None, + secondary_ipv6_prefix: Optional[str] = None, + mtu: Optional[int] = None, + bfd_configuration: Optional["_models.BfdConfiguration"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class VpnOptionBPatchProperties(_Model): + """Option B configuration to be used for Management VPN. + + :ivar import_route_targets: Route Targets to be applied for incoming routes into CE. This is + for backward compatibility. + :vartype import_route_targets: list[str] + :ivar export_route_targets: Route Targets to be applied for outgoing routes from CE. This is + for backward compatibility. + :vartype export_route_targets: list[str] + :ivar route_targets: Route Targets to be applied. + :vartype route_targets: ~azure.mgmt.managednetworkfabric.models.RouteTargetPatchInformation + """ + + import_route_targets: Optional[list[str]] = rest_field( + name="importRouteTargets", visibility=["read", "create", "update", "delete", "query"] + ) + """Route Targets to be applied for incoming routes into CE. This is for backward compatibility.""" + export_route_targets: Optional[list[str]] = rest_field( + name="exportRouteTargets", visibility=["read", "create", "update", "delete", "query"] + ) + """Route Targets to be applied for outgoing routes from CE. This is for backward compatibility.""" + route_targets: Optional["_models.RouteTargetPatchInformation"] = rest_field( + name="routeTargets", visibility=["read", "create", "update", "delete", "query"] + ) + """Route Targets to be applied.""" + + @overload + def __init__( + self, + *, + import_route_targets: Optional[list[str]] = None, + export_route_targets: Optional[list[str]] = None, + route_targets: Optional["_models.RouteTargetPatchInformation"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class VpnOptionBProperties(_Model): + """Option B configuration to be used for Management VPN. + + :ivar import_route_targets: Route Targets to be applied for incoming routes into CE. This is + for backward compatibility. + :vartype import_route_targets: list[str] + :ivar export_route_targets: Route Targets to be applied for outgoing routes from CE. This is + for backward compatibility. + :vartype export_route_targets: list[str] + :ivar route_targets: Route Targets to be applied. + :vartype route_targets: ~azure.mgmt.managednetworkfabric.models.RouteTargetInformation + """ + + import_route_targets: Optional[list[str]] = rest_field( + name="importRouteTargets", visibility=["read", "create", "update", "delete", "query"] + ) + """Route Targets to be applied for incoming routes into CE. This is for backward compatibility.""" + export_route_targets: Optional[list[str]] = rest_field( + name="exportRouteTargets", visibility=["read", "create", "update", "delete", "query"] + ) + """Route Targets to be applied for outgoing routes from CE. This is for backward compatibility.""" + route_targets: Optional["_models.RouteTargetInformation"] = rest_field( + name="routeTargets", visibility=["read", "create", "update", "delete", "query"] + ) + """Route Targets to be applied.""" + + @overload + def __init__( + self, + *, + import_route_targets: Optional[list[str]] = None, + export_route_targets: Optional[list[str]] = None, + route_targets: Optional["_models.RouteTargetInformation"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/models/_models_py3.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/models/_models_py3.py deleted file mode 100644 index 419cf6c9b052..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/models/_models_py3.py +++ /dev/null @@ -1,12550 +0,0 @@ -# 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 Resource(_serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which - has 'tags' and a 'location'. - - 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 Azure. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - } - - def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - """ - super().__init__(**kwargs) - self.tags = tags - self.location = location - - -class AccessControlList(TrackedResource): # pylint: disable=too-many-instance-attributes - """The Access Control List resource definition. - - 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 Azure. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar configuration_type: Input method to configure Access Control List. Known values are: - "File" and "Inline". - :vartype configuration_type: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationType - :ivar acls_url: Access Control List file URL. - :vartype acls_url: str - :ivar match_configurations: List of match configurations. - :vartype match_configurations: - list[~azure.mgmt.managednetworkfabric.models.AccessControlListMatchConfiguration] - :ivar dynamic_match_configurations: List of dynamic match configurations. - :vartype dynamic_match_configurations: - list[~azure.mgmt.managednetworkfabric.models.CommonDynamicMatchConfiguration] - :ivar last_synced_time: The last synced timestamp. - :vartype last_synced_time: ~datetime.datetime - :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", - "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", - "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", - "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.AdministrativeState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "acls_url": {"min_length": 1}, - "match_configurations": {"min_items": 1}, - "dynamic_match_configurations": {"min_items": 1}, - "last_synced_time": {"readonly": True}, - "configuration_state": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "administrative_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "annotation": {"key": "properties.annotation", "type": "str"}, - "configuration_type": {"key": "properties.configurationType", "type": "str"}, - "acls_url": {"key": "properties.aclsUrl", "type": "str"}, - "match_configurations": { - "key": "properties.matchConfigurations", - "type": "[AccessControlListMatchConfiguration]", - }, - "dynamic_match_configurations": { - "key": "properties.dynamicMatchConfigurations", - "type": "[CommonDynamicMatchConfiguration]", - }, - "last_synced_time": {"key": "properties.lastSyncedTime", "type": "iso-8601"}, - "configuration_state": {"key": "properties.configurationState", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "administrative_state": {"key": "properties.administrativeState", "type": "str"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - annotation: Optional[str] = None, - configuration_type: Optional[Union[str, "_models.ConfigurationType"]] = None, - acls_url: Optional[str] = None, - match_configurations: Optional[List["_models.AccessControlListMatchConfiguration"]] = None, - dynamic_match_configurations: Optional[List["_models.CommonDynamicMatchConfiguration"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword configuration_type: Input method to configure Access Control List. Known values are: - "File" and "Inline". - :paramtype configuration_type: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationType - :keyword acls_url: Access Control List file URL. - :paramtype acls_url: str - :keyword match_configurations: List of match configurations. - :paramtype match_configurations: - list[~azure.mgmt.managednetworkfabric.models.AccessControlListMatchConfiguration] - :keyword dynamic_match_configurations: List of dynamic match configurations. - :paramtype dynamic_match_configurations: - list[~azure.mgmt.managednetworkfabric.models.CommonDynamicMatchConfiguration] - """ - super().__init__(tags=tags, location=location, **kwargs) - self.annotation = annotation - self.configuration_type = configuration_type - self.acls_url = acls_url - self.match_configurations = match_configurations - self.dynamic_match_configurations = dynamic_match_configurations - self.last_synced_time = None - self.configuration_state = None - self.provisioning_state = None - self.administrative_state = None - - -class AccessControlListAction(_serialization.Model): - """Action that need to performed. - - :ivar type: Type of actions that can be performed. Known values are: "Drop", "Count", and - "Log". - :vartype type: str or ~azure.mgmt.managednetworkfabric.models.AclActionType - :ivar counter_name: Name of the counter block to get match count information. - :vartype counter_name: str - """ - - _validation = { - "counter_name": {"min_length": 1}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "counter_name": {"key": "counterName", "type": "str"}, - } - - def __init__( - self, - *, - type: Optional[Union[str, "_models.AclActionType"]] = None, - counter_name: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword type: Type of actions that can be performed. Known values are: "Drop", "Count", and - "Log". - :paramtype type: str or ~azure.mgmt.managednetworkfabric.models.AclActionType - :keyword counter_name: Name of the counter block to get match count information. - :paramtype counter_name: str - """ - super().__init__(**kwargs) - self.type = type - self.counter_name = counter_name - - -class CommonMatchConditions(_serialization.Model): - """Defines the common match conditions of the ACL and Network Tap Rule. - - :ivar protocol_types: List of the protocols that need to be matched. - :vartype protocol_types: list[str] - :ivar vlan_match_condition: Vlan match condition that needs to be matched. - :vartype vlan_match_condition: ~azure.mgmt.managednetworkfabric.models.VlanMatchCondition - :ivar ip_condition: IP condition that needs to be matched. - :vartype ip_condition: ~azure.mgmt.managednetworkfabric.models.IpMatchCondition - """ - - _validation = { - "protocol_types": {"min_items": 1}, - } - - _attribute_map = { - "protocol_types": {"key": "protocolTypes", "type": "[str]"}, - "vlan_match_condition": {"key": "vlanMatchCondition", "type": "VlanMatchCondition"}, - "ip_condition": {"key": "ipCondition", "type": "IpMatchCondition"}, - } - - def __init__( - self, - *, - protocol_types: Optional[List[str]] = None, - vlan_match_condition: Optional["_models.VlanMatchCondition"] = None, - ip_condition: Optional["_models.IpMatchCondition"] = None, - **kwargs: Any - ) -> None: - """ - :keyword protocol_types: List of the protocols that need to be matched. - :paramtype protocol_types: list[str] - :keyword vlan_match_condition: Vlan match condition that needs to be matched. - :paramtype vlan_match_condition: ~azure.mgmt.managednetworkfabric.models.VlanMatchCondition - :keyword ip_condition: IP condition that needs to be matched. - :paramtype ip_condition: ~azure.mgmt.managednetworkfabric.models.IpMatchCondition - """ - super().__init__(**kwargs) - self.protocol_types = protocol_types - self.vlan_match_condition = vlan_match_condition - self.ip_condition = ip_condition - - -class AccessControlListMatchCondition(CommonMatchConditions): - """Defines the match condition that is supported to filter the traffic. - - :ivar protocol_types: List of the protocols that need to be matched. - :vartype protocol_types: list[str] - :ivar vlan_match_condition: Vlan match condition that needs to be matched. - :vartype vlan_match_condition: ~azure.mgmt.managednetworkfabric.models.VlanMatchCondition - :ivar ip_condition: IP condition that needs to be matched. - :vartype ip_condition: ~azure.mgmt.managednetworkfabric.models.IpMatchCondition - :ivar ether_types: List of ether type values that needs to be matched. - :vartype ether_types: list[str] - :ivar fragments: List of IP fragment packets that needs to be matched. - :vartype fragments: list[str] - :ivar ip_lengths: List of IP Lengths that needs to be matched. - :vartype ip_lengths: list[str] - :ivar ttl_values: List of TTL [Time To Live] values that needs to be matched. - :vartype ttl_values: list[str] - :ivar dscp_markings: List of DSCP Markings that needs to be matched. - :vartype dscp_markings: list[str] - :ivar port_condition: Defines the port condition that needs to be matched. - :vartype port_condition: ~azure.mgmt.managednetworkfabric.models.AccessControlListPortCondition - """ - - _validation = { - "protocol_types": {"min_items": 1}, - "ether_types": {"min_items": 1}, - "fragments": {"min_items": 1}, - "ip_lengths": {"min_items": 1}, - "ttl_values": {"min_items": 1}, - "dscp_markings": {"min_items": 1}, - } - - _attribute_map = { - "protocol_types": {"key": "protocolTypes", "type": "[str]"}, - "vlan_match_condition": {"key": "vlanMatchCondition", "type": "VlanMatchCondition"}, - "ip_condition": {"key": "ipCondition", "type": "IpMatchCondition"}, - "ether_types": {"key": "etherTypes", "type": "[str]"}, - "fragments": {"key": "fragments", "type": "[str]"}, - "ip_lengths": {"key": "ipLengths", "type": "[str]"}, - "ttl_values": {"key": "ttlValues", "type": "[str]"}, - "dscp_markings": {"key": "dscpMarkings", "type": "[str]"}, - "port_condition": {"key": "portCondition", "type": "AccessControlListPortCondition"}, - } - - def __init__( - self, - *, - protocol_types: Optional[List[str]] = None, - vlan_match_condition: Optional["_models.VlanMatchCondition"] = None, - ip_condition: Optional["_models.IpMatchCondition"] = None, - ether_types: Optional[List[str]] = None, - fragments: Optional[List[str]] = None, - ip_lengths: Optional[List[str]] = None, - ttl_values: Optional[List[str]] = None, - dscp_markings: Optional[List[str]] = None, - port_condition: Optional["_models.AccessControlListPortCondition"] = None, - **kwargs: Any - ) -> None: - """ - :keyword protocol_types: List of the protocols that need to be matched. - :paramtype protocol_types: list[str] - :keyword vlan_match_condition: Vlan match condition that needs to be matched. - :paramtype vlan_match_condition: ~azure.mgmt.managednetworkfabric.models.VlanMatchCondition - :keyword ip_condition: IP condition that needs to be matched. - :paramtype ip_condition: ~azure.mgmt.managednetworkfabric.models.IpMatchCondition - :keyword ether_types: List of ether type values that needs to be matched. - :paramtype ether_types: list[str] - :keyword fragments: List of IP fragment packets that needs to be matched. - :paramtype fragments: list[str] - :keyword ip_lengths: List of IP Lengths that needs to be matched. - :paramtype ip_lengths: list[str] - :keyword ttl_values: List of TTL [Time To Live] values that needs to be matched. - :paramtype ttl_values: list[str] - :keyword dscp_markings: List of DSCP Markings that needs to be matched. - :paramtype dscp_markings: list[str] - :keyword port_condition: Defines the port condition that needs to be matched. - :paramtype port_condition: - ~azure.mgmt.managednetworkfabric.models.AccessControlListPortCondition - """ - super().__init__( - protocol_types=protocol_types, - vlan_match_condition=vlan_match_condition, - ip_condition=ip_condition, - **kwargs - ) - self.ether_types = ether_types - self.fragments = fragments - self.ip_lengths = ip_lengths - self.ttl_values = ttl_values - self.dscp_markings = dscp_markings - self.port_condition = port_condition - - -class AccessControlListMatchConfiguration(_serialization.Model): - """Defines the match configuration that are supported to filter the traffic. - - :ivar match_configuration_name: The name of the match configuration. - :vartype match_configuration_name: str - :ivar sequence_number: Sequence Number of the match configuration. - :vartype sequence_number: int - :ivar ip_address_type: Type of IP Address. IPv4 or IPv6. Known values are: "IPv4" and "IPv6". - :vartype ip_address_type: str or ~azure.mgmt.managednetworkfabric.models.IPAddressType - :ivar match_conditions: List of the match conditions. - :vartype match_conditions: - list[~azure.mgmt.managednetworkfabric.models.AccessControlListMatchCondition] - :ivar actions: List of actions that need to be performed for the matched conditions. - :vartype actions: list[~azure.mgmt.managednetworkfabric.models.AccessControlListAction] - """ - - _validation = { - "match_configuration_name": {"min_length": 1}, - "sequence_number": {"maximum": 4294967295, "minimum": 1}, - "match_conditions": {"min_items": 1}, - "actions": {"min_items": 1}, - } - - _attribute_map = { - "match_configuration_name": {"key": "matchConfigurationName", "type": "str"}, - "sequence_number": {"key": "sequenceNumber", "type": "int"}, - "ip_address_type": {"key": "ipAddressType", "type": "str"}, - "match_conditions": {"key": "matchConditions", "type": "[AccessControlListMatchCondition]"}, - "actions": {"key": "actions", "type": "[AccessControlListAction]"}, - } - - def __init__( - self, - *, - match_configuration_name: Optional[str] = None, - sequence_number: Optional[int] = None, - ip_address_type: Optional[Union[str, "_models.IPAddressType"]] = None, - match_conditions: Optional[List["_models.AccessControlListMatchCondition"]] = None, - actions: Optional[List["_models.AccessControlListAction"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword match_configuration_name: The name of the match configuration. - :paramtype match_configuration_name: str - :keyword sequence_number: Sequence Number of the match configuration. - :paramtype sequence_number: int - :keyword ip_address_type: Type of IP Address. IPv4 or IPv6. Known values are: "IPv4" and - "IPv6". - :paramtype ip_address_type: str or ~azure.mgmt.managednetworkfabric.models.IPAddressType - :keyword match_conditions: List of the match conditions. - :paramtype match_conditions: - list[~azure.mgmt.managednetworkfabric.models.AccessControlListMatchCondition] - :keyword actions: List of actions that need to be performed for the matched conditions. - :paramtype actions: list[~azure.mgmt.managednetworkfabric.models.AccessControlListAction] - """ - super().__init__(**kwargs) - self.match_configuration_name = match_configuration_name - self.sequence_number = sequence_number - self.ip_address_type = ip_address_type - self.match_conditions = match_conditions - self.actions = actions - - -class TagsUpdate(_serialization.Model): - """Base tracked resource type for PATCH updates. - - :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 AccessControlListPatch(TagsUpdate): - """The Access Control Lists patch resource definition. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar configuration_type: Input method to configure Access Control List. Known values are: - "File" and "Inline". - :vartype configuration_type: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationType - :ivar acls_url: Access Control List file URL. - :vartype acls_url: str - :ivar match_configurations: List of match configurations. - :vartype match_configurations: - list[~azure.mgmt.managednetworkfabric.models.AccessControlListMatchConfiguration] - :ivar dynamic_match_configurations: List of dynamic match configurations. - :vartype dynamic_match_configurations: - list[~azure.mgmt.managednetworkfabric.models.CommonDynamicMatchConfiguration] - :ivar annotation: Switch configuration description. - :vartype annotation: str - """ - - _validation = { - "acls_url": {"min_length": 1}, - "match_configurations": {"min_items": 1}, - "dynamic_match_configurations": {"min_items": 1}, - } - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "configuration_type": {"key": "properties.configurationType", "type": "str"}, - "acls_url": {"key": "properties.aclsUrl", "type": "str"}, - "match_configurations": { - "key": "properties.matchConfigurations", - "type": "[AccessControlListMatchConfiguration]", - }, - "dynamic_match_configurations": { - "key": "properties.dynamicMatchConfigurations", - "type": "[CommonDynamicMatchConfiguration]", - }, - "annotation": {"key": "properties.annotation", "type": "str"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - configuration_type: Optional[Union[str, "_models.ConfigurationType"]] = None, - acls_url: Optional[str] = None, - match_configurations: Optional[List["_models.AccessControlListMatchConfiguration"]] = None, - dynamic_match_configurations: Optional[List["_models.CommonDynamicMatchConfiguration"]] = None, - annotation: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword configuration_type: Input method to configure Access Control List. Known values are: - "File" and "Inline". - :paramtype configuration_type: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationType - :keyword acls_url: Access Control List file URL. - :paramtype acls_url: str - :keyword match_configurations: List of match configurations. - :paramtype match_configurations: - list[~azure.mgmt.managednetworkfabric.models.AccessControlListMatchConfiguration] - :keyword dynamic_match_configurations: List of dynamic match configurations. - :paramtype dynamic_match_configurations: - list[~azure.mgmt.managednetworkfabric.models.CommonDynamicMatchConfiguration] - :keyword annotation: Switch configuration description. - :paramtype annotation: str - """ - super().__init__(tags=tags, **kwargs) - self.configuration_type = configuration_type - self.acls_url = acls_url - self.match_configurations = match_configurations - self.dynamic_match_configurations = dynamic_match_configurations - self.annotation = annotation - - -class AccessControlListPatchableProperties(_serialization.Model): - """Access Control List Patch Properties defines the patchable resource properties. - - :ivar configuration_type: Input method to configure Access Control List. Known values are: - "File" and "Inline". - :vartype configuration_type: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationType - :ivar acls_url: Access Control List file URL. - :vartype acls_url: str - :ivar match_configurations: List of match configurations. - :vartype match_configurations: - list[~azure.mgmt.managednetworkfabric.models.AccessControlListMatchConfiguration] - :ivar dynamic_match_configurations: List of dynamic match configurations. - :vartype dynamic_match_configurations: - list[~azure.mgmt.managednetworkfabric.models.CommonDynamicMatchConfiguration] - """ - - _validation = { - "acls_url": {"min_length": 1}, - "match_configurations": {"min_items": 1}, - "dynamic_match_configurations": {"min_items": 1}, - } - - _attribute_map = { - "configuration_type": {"key": "configurationType", "type": "str"}, - "acls_url": {"key": "aclsUrl", "type": "str"}, - "match_configurations": {"key": "matchConfigurations", "type": "[AccessControlListMatchConfiguration]"}, - "dynamic_match_configurations": { - "key": "dynamicMatchConfigurations", - "type": "[CommonDynamicMatchConfiguration]", - }, - } - - def __init__( - self, - *, - configuration_type: Optional[Union[str, "_models.ConfigurationType"]] = None, - acls_url: Optional[str] = None, - match_configurations: Optional[List["_models.AccessControlListMatchConfiguration"]] = None, - dynamic_match_configurations: Optional[List["_models.CommonDynamicMatchConfiguration"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword configuration_type: Input method to configure Access Control List. Known values are: - "File" and "Inline". - :paramtype configuration_type: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationType - :keyword acls_url: Access Control List file URL. - :paramtype acls_url: str - :keyword match_configurations: List of match configurations. - :paramtype match_configurations: - list[~azure.mgmt.managednetworkfabric.models.AccessControlListMatchConfiguration] - :keyword dynamic_match_configurations: List of dynamic match configurations. - :paramtype dynamic_match_configurations: - list[~azure.mgmt.managednetworkfabric.models.CommonDynamicMatchConfiguration] - """ - super().__init__(**kwargs) - self.configuration_type = configuration_type - self.acls_url = acls_url - self.match_configurations = match_configurations - self.dynamic_match_configurations = dynamic_match_configurations - - -class AnnotationResource(_serialization.Model): - """Switch configuration entries require a description to discern between configuration groups. - - :ivar annotation: Switch configuration description. - :vartype annotation: str - """ - - _attribute_map = { - "annotation": {"key": "annotation", "type": "str"}, - } - - def __init__(self, *, annotation: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword annotation: Switch configuration description. - :paramtype annotation: str - """ - super().__init__(**kwargs) - self.annotation = annotation - - -class AccessControlListPatchProperties(AccessControlListPatchableProperties, AnnotationResource): - """Access Control Lists patch properties. - - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar configuration_type: Input method to configure Access Control List. Known values are: - "File" and "Inline". - :vartype configuration_type: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationType - :ivar acls_url: Access Control List file URL. - :vartype acls_url: str - :ivar match_configurations: List of match configurations. - :vartype match_configurations: - list[~azure.mgmt.managednetworkfabric.models.AccessControlListMatchConfiguration] - :ivar dynamic_match_configurations: List of dynamic match configurations. - :vartype dynamic_match_configurations: - list[~azure.mgmt.managednetworkfabric.models.CommonDynamicMatchConfiguration] - """ - - _validation = { - "acls_url": {"min_length": 1}, - "match_configurations": {"min_items": 1}, - "dynamic_match_configurations": {"min_items": 1}, - } - - _attribute_map = { - "annotation": {"key": "annotation", "type": "str"}, - "configuration_type": {"key": "configurationType", "type": "str"}, - "acls_url": {"key": "aclsUrl", "type": "str"}, - "match_configurations": {"key": "matchConfigurations", "type": "[AccessControlListMatchConfiguration]"}, - "dynamic_match_configurations": { - "key": "dynamicMatchConfigurations", - "type": "[CommonDynamicMatchConfiguration]", - }, - } - - def __init__( - self, - *, - annotation: Optional[str] = None, - configuration_type: Optional[Union[str, "_models.ConfigurationType"]] = None, - acls_url: Optional[str] = None, - match_configurations: Optional[List["_models.AccessControlListMatchConfiguration"]] = None, - dynamic_match_configurations: Optional[List["_models.CommonDynamicMatchConfiguration"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword configuration_type: Input method to configure Access Control List. Known values are: - "File" and "Inline". - :paramtype configuration_type: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationType - :keyword acls_url: Access Control List file URL. - :paramtype acls_url: str - :keyword match_configurations: List of match configurations. - :paramtype match_configurations: - list[~azure.mgmt.managednetworkfabric.models.AccessControlListMatchConfiguration] - :keyword dynamic_match_configurations: List of dynamic match configurations. - :paramtype dynamic_match_configurations: - list[~azure.mgmt.managednetworkfabric.models.CommonDynamicMatchConfiguration] - """ - super().__init__( - configuration_type=configuration_type, - acls_url=acls_url, - match_configurations=match_configurations, - dynamic_match_configurations=dynamic_match_configurations, - annotation=annotation, - **kwargs - ) - self.annotation = annotation - self.configuration_type = configuration_type - self.acls_url = acls_url - self.match_configurations = match_configurations - self.dynamic_match_configurations = dynamic_match_configurations - - -class PortCondition(_serialization.Model): - """Port condition that needs to be matched. - - All required parameters must be populated in order to send to Azure. - - :ivar port_type: Port type that needs to be matched. Known values are: "SourcePort" and - "DestinationPort". - :vartype port_type: str or ~azure.mgmt.managednetworkfabric.models.PortType - :ivar layer4_protocol: Layer4 protocol type that needs to be matched. Required. Known values - are: "TCP" and "UDP". - :vartype layer4_protocol: str or ~azure.mgmt.managednetworkfabric.models.Layer4Protocol - :ivar ports: List of the Ports that need to be matched. - :vartype ports: list[str] - :ivar port_group_names: List of the port Group Names that to be matched. - :vartype port_group_names: list[str] - """ - - _validation = { - "layer4_protocol": {"required": True}, - "ports": {"min_items": 1}, - "port_group_names": {"min_items": 1}, - } - - _attribute_map = { - "port_type": {"key": "portType", "type": "str"}, - "layer4_protocol": {"key": "layer4Protocol", "type": "str"}, - "ports": {"key": "ports", "type": "[str]"}, - "port_group_names": {"key": "portGroupNames", "type": "[str]"}, - } - - def __init__( - self, - *, - layer4_protocol: Union[str, "_models.Layer4Protocol"], - port_type: Optional[Union[str, "_models.PortType"]] = None, - ports: Optional[List[str]] = None, - port_group_names: Optional[List[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword port_type: Port type that needs to be matched. Known values are: "SourcePort" and - "DestinationPort". - :paramtype port_type: str or ~azure.mgmt.managednetworkfabric.models.PortType - :keyword layer4_protocol: Layer4 protocol type that needs to be matched. Required. Known values - are: "TCP" and "UDP". - :paramtype layer4_protocol: str or ~azure.mgmt.managednetworkfabric.models.Layer4Protocol - :keyword ports: List of the Ports that need to be matched. - :paramtype ports: list[str] - :keyword port_group_names: List of the port Group Names that to be matched. - :paramtype port_group_names: list[str] - """ - super().__init__(**kwargs) - self.port_type = port_type - self.layer4_protocol = layer4_protocol - self.ports = ports - self.port_group_names = port_group_names - - -class AccessControlListPortCondition(PortCondition): - """Defines the port condition that needs to be matched. - - All required parameters must be populated in order to send to Azure. - - :ivar port_type: Port type that needs to be matched. Known values are: "SourcePort" and - "DestinationPort". - :vartype port_type: str or ~azure.mgmt.managednetworkfabric.models.PortType - :ivar layer4_protocol: Layer4 protocol type that needs to be matched. Required. Known values - are: "TCP" and "UDP". - :vartype layer4_protocol: str or ~azure.mgmt.managednetworkfabric.models.Layer4Protocol - :ivar ports: List of the Ports that need to be matched. - :vartype ports: list[str] - :ivar port_group_names: List of the port Group Names that to be matched. - :vartype port_group_names: list[str] - :ivar flags: List of protocol flags that needs to be matched. - :vartype flags: list[str] - """ - - _validation = { - "layer4_protocol": {"required": True}, - "ports": {"min_items": 1}, - "port_group_names": {"min_items": 1}, - } - - _attribute_map = { - "port_type": {"key": "portType", "type": "str"}, - "layer4_protocol": {"key": "layer4Protocol", "type": "str"}, - "ports": {"key": "ports", "type": "[str]"}, - "port_group_names": {"key": "portGroupNames", "type": "[str]"}, - "flags": {"key": "flags", "type": "[str]"}, - } - - def __init__( - self, - *, - layer4_protocol: Union[str, "_models.Layer4Protocol"], - port_type: Optional[Union[str, "_models.PortType"]] = None, - ports: Optional[List[str]] = None, - port_group_names: Optional[List[str]] = None, - flags: Optional[List[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword port_type: Port type that needs to be matched. Known values are: "SourcePort" and - "DestinationPort". - :paramtype port_type: str or ~azure.mgmt.managednetworkfabric.models.PortType - :keyword layer4_protocol: Layer4 protocol type that needs to be matched. Required. Known values - are: "TCP" and "UDP". - :paramtype layer4_protocol: str or ~azure.mgmt.managednetworkfabric.models.Layer4Protocol - :keyword ports: List of the Ports that need to be matched. - :paramtype ports: list[str] - :keyword port_group_names: List of the port Group Names that to be matched. - :paramtype port_group_names: list[str] - :keyword flags: List of protocol flags that needs to be matched. - :paramtype flags: list[str] - """ - super().__init__( - port_type=port_type, - layer4_protocol=layer4_protocol, - ports=ports, - port_group_names=port_group_names, - **kwargs - ) - self.flags = flags - - -class AccessControlListProperties(AnnotationResource, AccessControlListPatchableProperties): - """Access Control List Properties defines the resource properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar configuration_type: Input method to configure Access Control List. Known values are: - "File" and "Inline". - :vartype configuration_type: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationType - :ivar acls_url: Access Control List file URL. - :vartype acls_url: str - :ivar match_configurations: List of match configurations. - :vartype match_configurations: - list[~azure.mgmt.managednetworkfabric.models.AccessControlListMatchConfiguration] - :ivar dynamic_match_configurations: List of dynamic match configurations. - :vartype dynamic_match_configurations: - list[~azure.mgmt.managednetworkfabric.models.CommonDynamicMatchConfiguration] - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar last_synced_time: The last synced timestamp. - :vartype last_synced_time: ~datetime.datetime - :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", - "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", - "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", - "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.AdministrativeState - """ - - _validation = { - "acls_url": {"min_length": 1}, - "match_configurations": {"min_items": 1}, - "dynamic_match_configurations": {"min_items": 1}, - "last_synced_time": {"readonly": True}, - "configuration_state": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "administrative_state": {"readonly": True}, - } - - _attribute_map = { - "configuration_type": {"key": "configurationType", "type": "str"}, - "acls_url": {"key": "aclsUrl", "type": "str"}, - "match_configurations": {"key": "matchConfigurations", "type": "[AccessControlListMatchConfiguration]"}, - "dynamic_match_configurations": { - "key": "dynamicMatchConfigurations", - "type": "[CommonDynamicMatchConfiguration]", - }, - "annotation": {"key": "annotation", "type": "str"}, - "last_synced_time": {"key": "lastSyncedTime", "type": "iso-8601"}, - "configuration_state": {"key": "configurationState", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "administrative_state": {"key": "administrativeState", "type": "str"}, - } - - def __init__( - self, - *, - configuration_type: Optional[Union[str, "_models.ConfigurationType"]] = None, - acls_url: Optional[str] = None, - match_configurations: Optional[List["_models.AccessControlListMatchConfiguration"]] = None, - dynamic_match_configurations: Optional[List["_models.CommonDynamicMatchConfiguration"]] = None, - annotation: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword configuration_type: Input method to configure Access Control List. Known values are: - "File" and "Inline". - :paramtype configuration_type: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationType - :keyword acls_url: Access Control List file URL. - :paramtype acls_url: str - :keyword match_configurations: List of match configurations. - :paramtype match_configurations: - list[~azure.mgmt.managednetworkfabric.models.AccessControlListMatchConfiguration] - :keyword dynamic_match_configurations: List of dynamic match configurations. - :paramtype dynamic_match_configurations: - list[~azure.mgmt.managednetworkfabric.models.CommonDynamicMatchConfiguration] - :keyword annotation: Switch configuration description. - :paramtype annotation: str - """ - super().__init__( - annotation=annotation, - configuration_type=configuration_type, - acls_url=acls_url, - match_configurations=match_configurations, - dynamic_match_configurations=dynamic_match_configurations, - **kwargs - ) - self.configuration_type = configuration_type - self.acls_url = acls_url - self.match_configurations = match_configurations - self.dynamic_match_configurations = dynamic_match_configurations - self.last_synced_time = None - self.configuration_state = None - self.provisioning_state = None - self.administrative_state = None - self.annotation = annotation - - -class AccessControlListsListResult(_serialization.Model): - """List of Access Control Lists. - - :ivar value: List of Access Control List resources. - :vartype value: list[~azure.mgmt.managednetworkfabric.models.AccessControlList] - :ivar next_link: Url to follow for getting next page of resources. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[AccessControlList]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, - *, - value: Optional[List["_models.AccessControlList"]] = None, - next_link: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword value: List of Access Control List resources. - :paramtype value: list[~azure.mgmt.managednetworkfabric.models.AccessControlList] - :keyword next_link: Url to follow for getting next page of resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class IpCommunitySetOperationProperties(_serialization.Model): - """IP Community set operation properties. - - :ivar set: List of IP Community IDs. - :vartype set: ~azure.mgmt.managednetworkfabric.models.IpCommunityIdList - """ - - _attribute_map = { - "set": {"key": "set", "type": "IpCommunityIdList"}, - } - - def __init__(self, *, set: Optional["_models.IpCommunityIdList"] = None, **kwargs: Any) -> None: - """ - :keyword set: List of IP Community IDs. - :paramtype set: ~azure.mgmt.managednetworkfabric.models.IpCommunityIdList - """ - super().__init__(**kwargs) - self.set = set - - -class IpCommunityDeleteOperationProperties(_serialization.Model): - """IP Community delete operation properties. - - :ivar delete: List of IP Community IDs. - :vartype delete: ~azure.mgmt.managednetworkfabric.models.IpCommunityIdList - """ - - _attribute_map = { - "delete": {"key": "delete", "type": "IpCommunityIdList"}, - } - - def __init__(self, *, delete: Optional["_models.IpCommunityIdList"] = None, **kwargs: Any) -> None: - """ - :keyword delete: List of IP Community IDs. - :paramtype delete: ~azure.mgmt.managednetworkfabric.models.IpCommunityIdList - """ - super().__init__(**kwargs) - self.delete = delete - - -class IpCommunityAddOperationProperties(_serialization.Model): - """IP Community add operation properties. - - :ivar add: List of IP Community IDs. - :vartype add: ~azure.mgmt.managednetworkfabric.models.IpCommunityIdList - """ - - _attribute_map = { - "add": {"key": "add", "type": "IpCommunityIdList"}, - } - - def __init__(self, *, add: Optional["_models.IpCommunityIdList"] = None, **kwargs: Any) -> None: - """ - :keyword add: List of IP Community IDs. - :paramtype add: ~azure.mgmt.managednetworkfabric.models.IpCommunityIdList - """ - super().__init__(**kwargs) - self.add = add - - -class ActionIpCommunityProperties( - IpCommunityAddOperationProperties, IpCommunityDeleteOperationProperties, IpCommunitySetOperationProperties -): - """IP Community Properties. - - :ivar set: List of IP Community IDs. - :vartype set: ~azure.mgmt.managednetworkfabric.models.IpCommunityIdList - :ivar delete: List of IP Community IDs. - :vartype delete: ~azure.mgmt.managednetworkfabric.models.IpCommunityIdList - :ivar add: List of IP Community IDs. - :vartype add: ~azure.mgmt.managednetworkfabric.models.IpCommunityIdList - """ - - _attribute_map = { - "set": {"key": "set", "type": "IpCommunityIdList"}, - "delete": {"key": "delete", "type": "IpCommunityIdList"}, - "add": {"key": "add", "type": "IpCommunityIdList"}, - } - - def __init__( - self, - *, - set: Optional["_models.IpCommunityIdList"] = None, - delete: Optional["_models.IpCommunityIdList"] = None, - add: Optional["_models.IpCommunityIdList"] = None, - **kwargs: Any - ) -> None: - """ - :keyword set: List of IP Community IDs. - :paramtype set: ~azure.mgmt.managednetworkfabric.models.IpCommunityIdList - :keyword delete: List of IP Community IDs. - :paramtype delete: ~azure.mgmt.managednetworkfabric.models.IpCommunityIdList - :keyword add: List of IP Community IDs. - :paramtype add: ~azure.mgmt.managednetworkfabric.models.IpCommunityIdList - """ - super().__init__(add=add, delete=delete, set=set, **kwargs) - self.set = set - self.delete = delete - self.add = add - - -class IpExtendedCommunitySetOperationProperties(_serialization.Model): - """IP Extended Community set operation properties. - - :ivar set: List of IP Extended Community IDs. - :vartype set: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityIdList - """ - - _attribute_map = { - "set": {"key": "set", "type": "IpExtendedCommunityIdList"}, - } - - def __init__(self, *, set: Optional["_models.IpExtendedCommunityIdList"] = None, **kwargs: Any) -> None: - """ - :keyword set: List of IP Extended Community IDs. - :paramtype set: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityIdList - """ - super().__init__(**kwargs) - self.set = set - - -class IpExtendedCommunityDeleteOperationProperties(_serialization.Model): - """IP Extended Community delete operation properties. - - :ivar delete: List of IP Extended Community IDs. - :vartype delete: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityIdList - """ - - _attribute_map = { - "delete": {"key": "delete", "type": "IpExtendedCommunityIdList"}, - } - - def __init__(self, *, delete: Optional["_models.IpExtendedCommunityIdList"] = None, **kwargs: Any) -> None: - """ - :keyword delete: List of IP Extended Community IDs. - :paramtype delete: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityIdList - """ - super().__init__(**kwargs) - self.delete = delete - - -class IpExtendedCommunityAddOperationProperties(_serialization.Model): - """IP Extended Community add operation properties. - - :ivar add: List of IP Extended Community IDs. - :vartype add: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityIdList - """ - - _attribute_map = { - "add": {"key": "add", "type": "IpExtendedCommunityIdList"}, - } - - def __init__(self, *, add: Optional["_models.IpExtendedCommunityIdList"] = None, **kwargs: Any) -> None: - """ - :keyword add: List of IP Extended Community IDs. - :paramtype add: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityIdList - """ - super().__init__(**kwargs) - self.add = add - - -class ActionIpExtendedCommunityProperties( - IpExtendedCommunityAddOperationProperties, - IpExtendedCommunityDeleteOperationProperties, - IpExtendedCommunitySetOperationProperties, -): - """IP Extended Community Properties. - - :ivar set: List of IP Extended Community IDs. - :vartype set: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityIdList - :ivar delete: List of IP Extended Community IDs. - :vartype delete: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityIdList - :ivar add: List of IP Extended Community IDs. - :vartype add: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityIdList - """ - - _attribute_map = { - "set": {"key": "set", "type": "IpExtendedCommunityIdList"}, - "delete": {"key": "delete", "type": "IpExtendedCommunityIdList"}, - "add": {"key": "add", "type": "IpExtendedCommunityIdList"}, - } - - def __init__( - self, - *, - set: Optional["_models.IpExtendedCommunityIdList"] = None, - delete: Optional["_models.IpExtendedCommunityIdList"] = None, - add: Optional["_models.IpExtendedCommunityIdList"] = None, - **kwargs: Any - ) -> None: - """ - :keyword set: List of IP Extended Community IDs. - :paramtype set: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityIdList - :keyword delete: List of IP Extended Community IDs. - :paramtype delete: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityIdList - :keyword add: List of IP Extended Community IDs. - :paramtype add: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityIdList - """ - super().__init__(add=add, delete=delete, set=set, **kwargs) - self.set = set - self.delete = delete - self.add = add - - -class AggregateRoute(_serialization.Model): - """aggregateIpv4Route model. - - All required parameters must be populated in order to send to Azure. - - :ivar prefix: IPv4 Prefix of the aggregate Ipv4Route. Required. - :vartype prefix: str - """ - - _validation = { - "prefix": {"required": True, "min_length": 1}, - } - - _attribute_map = { - "prefix": {"key": "prefix", "type": "str"}, - } - - def __init__(self, *, prefix: str, **kwargs: Any) -> None: - """ - :keyword prefix: IPv4 Prefix of the aggregate Ipv4Route. Required. - :paramtype prefix: str - """ - super().__init__(**kwargs) - self.prefix = prefix - - -class AggregateRouteConfiguration(_serialization.Model): - """List of IPv4 and IPv6 aggregate routes. - - :ivar ipv4_routes: List of IPv4 Route prefixes. - :vartype ipv4_routes: list[~azure.mgmt.managednetworkfabric.models.AggregateRoute] - :ivar ipv6_routes: List of Ipv6Routes prefixes. - :vartype ipv6_routes: list[~azure.mgmt.managednetworkfabric.models.AggregateRoute] - """ - - _validation = { - "ipv4_routes": {"min_items": 1}, - "ipv6_routes": {"min_items": 1}, - } - - _attribute_map = { - "ipv4_routes": {"key": "ipv4Routes", "type": "[AggregateRoute]"}, - "ipv6_routes": {"key": "ipv6Routes", "type": "[AggregateRoute]"}, - } - - def __init__( - self, - *, - ipv4_routes: Optional[List["_models.AggregateRoute"]] = None, - ipv6_routes: Optional[List["_models.AggregateRoute"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword ipv4_routes: List of IPv4 Route prefixes. - :paramtype ipv4_routes: list[~azure.mgmt.managednetworkfabric.models.AggregateRoute] - :keyword ipv6_routes: List of Ipv6Routes prefixes. - :paramtype ipv6_routes: list[~azure.mgmt.managednetworkfabric.models.AggregateRoute] - """ - super().__init__(**kwargs) - self.ipv4_routes = ipv4_routes - self.ipv6_routes = ipv6_routes - - -class BfdConfiguration(_serialization.Model): - """BFD configuration properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar administrative_state: Administrative state of the BfdConfiguration. Example: Enabled | - Disabled. Known values are: "Enabled", "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.BfdAdministrativeState - :ivar interval_in_milli_seconds: Interval in milliseconds. Example: 300. - :vartype interval_in_milli_seconds: int - :ivar multiplier: Multiplier for the Bfd Configuration. Example: 5. - :vartype multiplier: int - """ - - _validation = { - "administrative_state": {"readonly": True}, - } - - _attribute_map = { - "administrative_state": {"key": "administrativeState", "type": "str"}, - "interval_in_milli_seconds": {"key": "intervalInMilliSeconds", "type": "int"}, - "multiplier": {"key": "multiplier", "type": "int"}, - } - - def __init__(self, *, interval_in_milli_seconds: int = 300, multiplier: int = 5, **kwargs: Any) -> None: - """ - :keyword interval_in_milli_seconds: Interval in milliseconds. Example: 300. - :paramtype interval_in_milli_seconds: int - :keyword multiplier: Multiplier for the Bfd Configuration. Example: 5. - :paramtype multiplier: int - """ - super().__init__(**kwargs) - self.administrative_state = None - self.interval_in_milli_seconds = interval_in_milli_seconds - self.multiplier = multiplier - - -class BgpConfiguration(AnnotationResource): # pylint: disable=too-many-instance-attributes - """BGP configuration properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar bfd_configuration: BFD configuration properties. - :vartype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdConfiguration - :ivar default_route_originate: Originate a defaultRoute. Ex: "True" | "False". Known values - are: "True" and "False". - :vartype default_route_originate: str or - ~azure.mgmt.managednetworkfabric.models.BooleanEnumProperty - :ivar allow_as: Allows for routes to be received and processed even if the router detects its - own ASN in the AS-Path. 0 is disable, Possible values are 1-10, default is 2. - :vartype allow_as: int - :ivar allow_as_override: Enable Or Disable state. Known values are: "Enable" and "Disable". - :vartype allow_as_override: str or ~azure.mgmt.managednetworkfabric.models.AllowASOverride - :ivar fabric_asn: ASN of Network Fabric. Example: 65048. - :vartype fabric_asn: int - :ivar peer_asn: Peer ASN. Example: 65047. - :vartype peer_asn: int - :ivar ipv4_listen_range_prefixes: List of BGP IPv4 Listen Range prefixes. - :vartype ipv4_listen_range_prefixes: list[str] - :ivar ipv6_listen_range_prefixes: List of BGP IPv6 Listen Ranges prefixes. - :vartype ipv6_listen_range_prefixes: list[str] - :ivar ipv4_neighbor_address: List with stringified IPv4 Neighbor Addresses. - :vartype ipv4_neighbor_address: list[~azure.mgmt.managednetworkfabric.models.NeighborAddress] - :ivar ipv6_neighbor_address: List with stringified IPv6 Neighbor Address. - :vartype ipv6_neighbor_address: list[~azure.mgmt.managednetworkfabric.models.NeighborAddress] - """ - - _validation = { - "allow_as": {"maximum": 10, "minimum": 0}, - "fabric_asn": {"readonly": True}, - "peer_asn": {"maximum": 4294967295, "minimum": 1}, - "ipv4_listen_range_prefixes": {"min_items": 1}, - "ipv6_listen_range_prefixes": {"min_items": 1}, - "ipv4_neighbor_address": {"min_items": 1}, - "ipv6_neighbor_address": {"min_items": 1}, - } - - _attribute_map = { - "annotation": {"key": "annotation", "type": "str"}, - "bfd_configuration": {"key": "bfdConfiguration", "type": "BfdConfiguration"}, - "default_route_originate": {"key": "defaultRouteOriginate", "type": "str"}, - "allow_as": {"key": "allowAS", "type": "int"}, - "allow_as_override": {"key": "allowASOverride", "type": "str"}, - "fabric_asn": {"key": "fabricASN", "type": "int"}, - "peer_asn": {"key": "peerASN", "type": "int"}, - "ipv4_listen_range_prefixes": {"key": "ipv4ListenRangePrefixes", "type": "[str]"}, - "ipv6_listen_range_prefixes": {"key": "ipv6ListenRangePrefixes", "type": "[str]"}, - "ipv4_neighbor_address": {"key": "ipv4NeighborAddress", "type": "[NeighborAddress]"}, - "ipv6_neighbor_address": {"key": "ipv6NeighborAddress", "type": "[NeighborAddress]"}, - } - - def __init__( - self, - *, - annotation: Optional[str] = None, - bfd_configuration: Optional["_models.BfdConfiguration"] = None, - default_route_originate: Optional[Union[str, "_models.BooleanEnumProperty"]] = None, - allow_as: int = 2, - allow_as_override: Optional[Union[str, "_models.AllowASOverride"]] = None, - peer_asn: Optional[int] = None, - ipv4_listen_range_prefixes: Optional[List[str]] = None, - ipv6_listen_range_prefixes: Optional[List[str]] = None, - ipv4_neighbor_address: Optional[List["_models.NeighborAddress"]] = None, - ipv6_neighbor_address: Optional[List["_models.NeighborAddress"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword bfd_configuration: BFD configuration properties. - :paramtype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdConfiguration - :keyword default_route_originate: Originate a defaultRoute. Ex: "True" | "False". Known values - are: "True" and "False". - :paramtype default_route_originate: str or - ~azure.mgmt.managednetworkfabric.models.BooleanEnumProperty - :keyword allow_as: Allows for routes to be received and processed even if the router detects - its own ASN in the AS-Path. 0 is disable, Possible values are 1-10, default is 2. - :paramtype allow_as: int - :keyword allow_as_override: Enable Or Disable state. Known values are: "Enable" and "Disable". - :paramtype allow_as_override: str or ~azure.mgmt.managednetworkfabric.models.AllowASOverride - :keyword peer_asn: Peer ASN. Example: 65047. - :paramtype peer_asn: int - :keyword ipv4_listen_range_prefixes: List of BGP IPv4 Listen Range prefixes. - :paramtype ipv4_listen_range_prefixes: list[str] - :keyword ipv6_listen_range_prefixes: List of BGP IPv6 Listen Ranges prefixes. - :paramtype ipv6_listen_range_prefixes: list[str] - :keyword ipv4_neighbor_address: List with stringified IPv4 Neighbor Addresses. - :paramtype ipv4_neighbor_address: list[~azure.mgmt.managednetworkfabric.models.NeighborAddress] - :keyword ipv6_neighbor_address: List with stringified IPv6 Neighbor Address. - :paramtype ipv6_neighbor_address: list[~azure.mgmt.managednetworkfabric.models.NeighborAddress] - """ - super().__init__(annotation=annotation, **kwargs) - self.bfd_configuration = bfd_configuration - self.default_route_originate = default_route_originate - self.allow_as = allow_as - self.allow_as_override = allow_as_override - self.fabric_asn = None - self.peer_asn = peer_asn - self.ipv4_listen_range_prefixes = ipv4_listen_range_prefixes - self.ipv6_listen_range_prefixes = ipv6_listen_range_prefixes - self.ipv4_neighbor_address = ipv4_neighbor_address - self.ipv6_neighbor_address = ipv6_neighbor_address - - -class CommonDynamicMatchConfiguration(_serialization.Model): - """Dynamic match configuration object. - - :ivar ip_groups: List of IP Groups. - :vartype ip_groups: list[~azure.mgmt.managednetworkfabric.models.IpGroupProperties] - :ivar vlan_groups: List of vlan groups. - :vartype vlan_groups: list[~azure.mgmt.managednetworkfabric.models.VlanGroupProperties] - :ivar port_groups: List of the port group. - :vartype port_groups: list[~azure.mgmt.managednetworkfabric.models.PortGroupProperties] - """ - - _validation = { - "ip_groups": {"min_items": 1}, - "vlan_groups": {"min_items": 1}, - "port_groups": {"min_items": 1}, - } - - _attribute_map = { - "ip_groups": {"key": "ipGroups", "type": "[IpGroupProperties]"}, - "vlan_groups": {"key": "vlanGroups", "type": "[VlanGroupProperties]"}, - "port_groups": {"key": "portGroups", "type": "[PortGroupProperties]"}, - } - - def __init__( - self, - *, - ip_groups: Optional[List["_models.IpGroupProperties"]] = None, - vlan_groups: Optional[List["_models.VlanGroupProperties"]] = None, - port_groups: Optional[List["_models.PortGroupProperties"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword ip_groups: List of IP Groups. - :paramtype ip_groups: list[~azure.mgmt.managednetworkfabric.models.IpGroupProperties] - :keyword vlan_groups: List of vlan groups. - :paramtype vlan_groups: list[~azure.mgmt.managednetworkfabric.models.VlanGroupProperties] - :keyword port_groups: List of the port group. - :paramtype port_groups: list[~azure.mgmt.managednetworkfabric.models.PortGroupProperties] - """ - super().__init__(**kwargs) - self.ip_groups = ip_groups - self.vlan_groups = vlan_groups - self.port_groups = port_groups - - -class ErrorResponse(_serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed - operations. (This also follows the OData error response format.). - - :ivar error: The error object. - :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail - """ - - _attribute_map = { - "error": {"key": "error", "type": "ErrorDetail"}, - } - - def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail - """ - super().__init__(**kwargs) - self.error = error - - -class CommonPostActionResponseForDeviceUpdate(ErrorResponse): - """Common response for device updates. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar error: The error object. - :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail - :ivar configuration_state: Gets the configuration state. Known values are: "Succeeded", - "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", - "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - :ivar successful_devices: List of ARM Resource IDs for which the given action applied - successfully. - :vartype successful_devices: list[str] - :ivar failed_devices: List of ARM Resource IDs for which the given action failed to apply. - :vartype failed_devices: list[str] - """ - - _validation = { - "configuration_state": {"readonly": True}, - } - - _attribute_map = { - "error": {"key": "error", "type": "ErrorDetail"}, - "configuration_state": {"key": "configurationState", "type": "str"}, - "successful_devices": {"key": "successfulDevices", "type": "[str]"}, - "failed_devices": {"key": "failedDevices", "type": "[str]"}, - } - - def __init__( - self, - *, - error: Optional["_models.ErrorDetail"] = None, - successful_devices: Optional[List[str]] = None, - failed_devices: Optional[List[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail - :keyword successful_devices: List of ARM Resource IDs for which the given action applied - successfully. - :paramtype successful_devices: list[str] - :keyword failed_devices: List of ARM Resource IDs for which the given action failed to apply. - :paramtype failed_devices: list[str] - """ - super().__init__(error=error, **kwargs) - self.configuration_state = None - self.successful_devices = successful_devices - self.failed_devices = failed_devices - - -class CommonPostActionResponseForStateUpdate(ErrorResponse): - """Common response for the state updates. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar error: The error object. - :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail - :ivar configuration_state: Gets the configuration state. Known values are: "Succeeded", - "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", - "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - """ - - _validation = { - "configuration_state": {"readonly": True}, - } - - _attribute_map = { - "error": {"key": "error", "type": "ErrorDetail"}, - "configuration_state": {"key": "configurationState", "type": "str"}, - } - - def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail - """ - super().__init__(error=error, **kwargs) - self.configuration_state = None - - -class ConnectedSubnet(AnnotationResource): - """Connected Subnet properties. - - All required parameters must be populated in order to send to Azure. - - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar prefix: Prefix of the Connected Subnet. Required. - :vartype prefix: str - """ - - _validation = { - "prefix": {"required": True, "min_length": 1}, - } - - _attribute_map = { - "annotation": {"key": "annotation", "type": "str"}, - "prefix": {"key": "prefix", "type": "str"}, - } - - def __init__(self, *, prefix: str, annotation: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword prefix: Prefix of the Connected Subnet. Required. - :paramtype prefix: str - """ - super().__init__(annotation=annotation, **kwargs) - self.prefix = prefix - - -class ConnectedSubnetRoutePolicy(_serialization.Model): - """Connected Subnet Route Policy properties. - - :ivar export_route_policy_id: ARM Resource ID of the Route Policy. This is used for the - backward compatibility. - :vartype export_route_policy_id: str - :ivar export_route_policy: Array of ARM Resource ID of the RoutePolicies. - :vartype export_route_policy: ~azure.mgmt.managednetworkfabric.models.L3ExportRoutePolicy - """ - - _attribute_map = { - "export_route_policy_id": {"key": "exportRoutePolicyId", "type": "str"}, - "export_route_policy": {"key": "exportRoutePolicy", "type": "L3ExportRoutePolicy"}, - } - - def __init__( - self, - *, - export_route_policy_id: Optional[str] = None, - export_route_policy: Optional["_models.L3ExportRoutePolicy"] = None, - **kwargs: Any - ) -> None: - """ - :keyword export_route_policy_id: ARM Resource ID of the Route Policy. This is used for the - backward compatibility. - :paramtype export_route_policy_id: str - :keyword export_route_policy: Array of ARM Resource ID of the RoutePolicies. - :paramtype export_route_policy: ~azure.mgmt.managednetworkfabric.models.L3ExportRoutePolicy - """ - super().__init__(**kwargs) - self.export_route_policy_id = export_route_policy_id - self.export_route_policy = export_route_policy - - -class ControllerServices(_serialization.Model): - """Network Fabric Controller services. - - :ivar ipv4_address_spaces: The IPv4 Address space is optional, if the value is not defined at - the time of NFC creation, then the default value 10.0.0.0/19 is considered. The IPV4 address - subnet is an optional attribute. - :vartype ipv4_address_spaces: list[str] - :ivar ipv6_address_spaces: The IPv6 is not supported right now. - :vartype ipv6_address_spaces: list[str] - """ - - _attribute_map = { - "ipv4_address_spaces": {"key": "ipv4AddressSpaces", "type": "[str]"}, - "ipv6_address_spaces": {"key": "ipv6AddressSpaces", "type": "[str]"}, - } - - def __init__( - self, - *, - ipv4_address_spaces: Optional[List[str]] = None, - ipv6_address_spaces: Optional[List[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword ipv4_address_spaces: The IPv4 Address space is optional, if the value is not defined - at the time of NFC creation, then the default value 10.0.0.0/19 is considered. The IPV4 address - subnet is an optional attribute. - :paramtype ipv4_address_spaces: list[str] - :keyword ipv6_address_spaces: The IPv6 is not supported right now. - :paramtype ipv6_address_spaces: list[str] - """ - super().__init__(**kwargs) - self.ipv4_address_spaces = ipv4_address_spaces - self.ipv6_address_spaces = ipv6_address_spaces - - -class DestinationProperties(_serialization.Model): - """The network tap destination properties. - - :ivar name: Destination name. - :vartype name: str - :ivar destination_type: Type of destination. Input can be IsolationDomain or Direct. Known - values are: "IsolationDomain" and "Direct". - :vartype destination_type: str or ~azure.mgmt.managednetworkfabric.models.DestinationType - :ivar destination_id: The destination Id. ARM Resource ID of either NNI or Internal Networks. - :vartype destination_id: str - :ivar isolation_domain_properties: Isolation Domain Properties. - :vartype isolation_domain_properties: - ~azure.mgmt.managednetworkfabric.models.IsolationDomainProperties - :ivar destination_tap_rule_id: ARM Resource ID of destination Tap Rule that contains match - configurations. - :vartype destination_tap_rule_id: str - """ - - _validation = { - "name": {"min_length": 1}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "destination_type": {"key": "destinationType", "type": "str"}, - "destination_id": {"key": "destinationId", "type": "str"}, - "isolation_domain_properties": {"key": "isolationDomainProperties", "type": "IsolationDomainProperties"}, - "destination_tap_rule_id": {"key": "destinationTapRuleId", "type": "str"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - destination_type: Optional[Union[str, "_models.DestinationType"]] = None, - destination_id: Optional[str] = None, - isolation_domain_properties: Optional["_models.IsolationDomainProperties"] = None, - destination_tap_rule_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: Destination name. - :paramtype name: str - :keyword destination_type: Type of destination. Input can be IsolationDomain or Direct. Known - values are: "IsolationDomain" and "Direct". - :paramtype destination_type: str or ~azure.mgmt.managednetworkfabric.models.DestinationType - :keyword destination_id: The destination Id. ARM Resource ID of either NNI or Internal - Networks. - :paramtype destination_id: str - :keyword isolation_domain_properties: Isolation Domain Properties. - :paramtype isolation_domain_properties: - ~azure.mgmt.managednetworkfabric.models.IsolationDomainProperties - :keyword destination_tap_rule_id: ARM Resource ID of destination Tap Rule that contains match - configurations. - :paramtype destination_tap_rule_id: str - """ - super().__init__(**kwargs) - self.name = name - self.destination_type = destination_type - self.destination_id = destination_id - self.isolation_domain_properties = isolation_domain_properties - self.destination_tap_rule_id = destination_tap_rule_id - - -class DeviceInterfaceProperties(_serialization.Model): - """Network device interface properties. - - :ivar identifier: Interface identifier. Example: HundredGigE0/0. - :vartype identifier: str - :ivar interface_type: Interface type. - :vartype interface_type: str - :ivar supported_connector_types: List of supported connector types. - :vartype supported_connector_types: - list[~azure.mgmt.managednetworkfabric.models.SupportedConnectorProperties] - """ - - _attribute_map = { - "identifier": {"key": "identifier", "type": "str"}, - "interface_type": {"key": "interfaceType", "type": "str"}, - "supported_connector_types": {"key": "supportedConnectorTypes", "type": "[SupportedConnectorProperties]"}, - } - - def __init__( - self, - *, - identifier: Optional[str] = None, - interface_type: Optional[str] = None, - supported_connector_types: Optional[List["_models.SupportedConnectorProperties"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword identifier: Interface identifier. Example: HundredGigE0/0. - :paramtype identifier: str - :keyword interface_type: Interface type. - :paramtype interface_type: str - :keyword supported_connector_types: List of supported connector types. - :paramtype supported_connector_types: - list[~azure.mgmt.managednetworkfabric.models.SupportedConnectorProperties] - """ - super().__init__(**kwargs) - self.identifier = identifier - self.interface_type = interface_type - self.supported_connector_types = supported_connector_types - - -class EnableDisableOnResources(_serialization.Model): - """Update administrative state on list of resources. - - :ivar resource_ids: Network Fabrics or Network Rack resource Id. - :vartype resource_ids: list[str] - """ - - _attribute_map = { - "resource_ids": {"key": "resourceIds", "type": "[str]"}, - } - - def __init__(self, *, resource_ids: Optional[List[str]] = None, **kwargs: Any) -> None: - """ - :keyword resource_ids: Network Fabrics or Network Rack resource Id. - :paramtype resource_ids: list[str] - """ - super().__init__(**kwargs) - self.resource_ids = resource_ids - - -class ErrorAdditionalInfo(_serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: JSON - """ - - _validation = { - "type": {"readonly": True}, - "info": {"readonly": True}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "info": {"key": "info", "type": "object"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(_serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.managednetworkfabric.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.managednetworkfabric.models.ErrorAdditionalInfo] - """ - - _validation = { - "code": {"readonly": True}, - "message": {"readonly": True}, - "target": {"readonly": True}, - "details": {"readonly": True}, - "additional_info": {"readonly": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "target": {"key": "target", "type": "str"}, - "details": {"key": "details", "type": "[ErrorDetail]"}, - "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ExportRoutePolicy(_serialization.Model): - """Export Route Policy either IPv4 or IPv6. - - :ivar export_ipv4_route_policy_id: ARM resource ID of RoutePolicy. - :vartype export_ipv4_route_policy_id: str - :ivar export_ipv6_route_policy_id: ARM resource ID of RoutePolicy. - :vartype export_ipv6_route_policy_id: str - """ - - _attribute_map = { - "export_ipv4_route_policy_id": {"key": "exportIpv4RoutePolicyId", "type": "str"}, - "export_ipv6_route_policy_id": {"key": "exportIpv6RoutePolicyId", "type": "str"}, - } - - def __init__( - self, - *, - export_ipv4_route_policy_id: Optional[str] = None, - export_ipv6_route_policy_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword export_ipv4_route_policy_id: ARM resource ID of RoutePolicy. - :paramtype export_ipv4_route_policy_id: str - :keyword export_ipv6_route_policy_id: ARM resource ID of RoutePolicy. - :paramtype export_ipv6_route_policy_id: str - """ - super().__init__(**kwargs) - self.export_ipv4_route_policy_id = export_ipv4_route_policy_id - self.export_ipv6_route_policy_id = export_ipv6_route_policy_id - - -class ExportRoutePolicyInformation(_serialization.Model): - """Export Route Policy Configuration. - - :ivar export_ipv4_route_policy_id: Export IPv4 Route Policy Id. - :vartype export_ipv4_route_policy_id: str - :ivar export_ipv6_route_policy_id: Export IPv6 Route Policy Id. - :vartype export_ipv6_route_policy_id: str - """ - - _attribute_map = { - "export_ipv4_route_policy_id": {"key": "exportIpv4RoutePolicyId", "type": "str"}, - "export_ipv6_route_policy_id": {"key": "exportIpv6RoutePolicyId", "type": "str"}, - } - - def __init__( - self, - *, - export_ipv4_route_policy_id: Optional[str] = None, - export_ipv6_route_policy_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword export_ipv4_route_policy_id: Export IPv4 Route Policy Id. - :paramtype export_ipv4_route_policy_id: str - :keyword export_ipv6_route_policy_id: Export IPv6 Route Policy Id. - :paramtype export_ipv6_route_policy_id: str - """ - super().__init__(**kwargs) - self.export_ipv4_route_policy_id = export_ipv4_route_policy_id - self.export_ipv6_route_policy_id = export_ipv6_route_policy_id - - -class ExpressRouteConnectionInformation(_serialization.Model): - """The ExpressRoute circuit ID and the Auth Key are required for you to successfully deploy NFC - service. - - All required parameters must be populated in order to send to Azure. - - :ivar express_route_circuit_id: The express route circuit Azure resource ID, must be of type - Microsoft.Network/expressRouteCircuits/circuitName. The ExpressRoute Circuit is a mandatory - attribute. Required. - :vartype express_route_circuit_id: str - :ivar express_route_authorization_key: Authorization key for the circuit, must be of type - Microsoft.Network/expressRouteCircuits/authorizations. The Auth Key is a mandatory attribute. - Required. - :vartype express_route_authorization_key: str - """ - - _validation = { - "express_route_circuit_id": {"required": True}, - "express_route_authorization_key": {"required": True}, - } - - _attribute_map = { - "express_route_circuit_id": {"key": "expressRouteCircuitId", "type": "str"}, - "express_route_authorization_key": {"key": "expressRouteAuthorizationKey", "type": "str"}, - } - - def __init__(self, *, express_route_circuit_id: str, express_route_authorization_key: str, **kwargs: Any) -> None: - """ - :keyword express_route_circuit_id: The express route circuit Azure resource ID, must be of type - Microsoft.Network/expressRouteCircuits/circuitName. The ExpressRoute Circuit is a mandatory - attribute. Required. - :paramtype express_route_circuit_id: str - :keyword express_route_authorization_key: Authorization key for the circuit, must be of type - Microsoft.Network/expressRouteCircuits/authorizations. The Auth Key is a mandatory attribute. - Required. - :paramtype express_route_authorization_key: str - """ - super().__init__(**kwargs) - self.express_route_circuit_id = express_route_circuit_id - self.express_route_authorization_key = express_route_authorization_key - - -class ExtendedLocation(_serialization.Model): - """The extended location. - - :ivar type: The extended location type. - :vartype type: str - :ivar name: The extended location name. - :vartype name: str - """ - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "name": {"key": "name", "type": "str"}, - } - - def __init__(self, *, type: Optional[str] = None, name: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword type: The extended location type. - :paramtype type: str - :keyword name: The extended location name. - :paramtype name: str - """ - super().__init__(**kwargs) - self.type = type - self.name = name - - -class ExtensionEnumProperty(_serialization.Model): - """Extension property. - - :ivar extension: Extension. Example: NoExtension | NPB. Known values are: "NoExtension" and - "NPB". - :vartype extension: str or ~azure.mgmt.managednetworkfabric.models.Extension - """ - - _attribute_map = { - "extension": {"key": "extension", "type": "str"}, - } - - def __init__(self, *, extension: Union[str, "_models.Extension"] = "NoExtension", **kwargs: Any) -> None: - """ - :keyword extension: Extension. Example: NoExtension | NPB. Known values are: "NoExtension" and - "NPB". - :paramtype extension: str or ~azure.mgmt.managednetworkfabric.models.Extension - """ - super().__init__(**kwargs) - self.extension = extension - - -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have - tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - - -class ExternalNetwork(ProxyResource): # pylint: disable=too-many-instance-attributes - """Defines the External Network 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 Azure. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar import_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the backward - compatibility. - :vartype import_route_policy_id: str - :ivar export_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the backward - compatibility. - :vartype export_route_policy_id: str - :ivar import_route_policy: Import Route Policy either IPv4 or IPv6. - :vartype import_route_policy: ~azure.mgmt.managednetworkfabric.models.ImportRoutePolicy - :ivar export_route_policy: Export Route Policy either IPv4 or IPv6. - :vartype export_route_policy: ~azure.mgmt.managednetworkfabric.models.ExportRoutePolicy - :ivar network_to_network_interconnect_id: Gets the networkToNetworkInterconnectId of the - resource. - :vartype network_to_network_interconnect_id: str - :ivar peering_option: Peering option list. Required. Known values are: "OptionA" and "OptionB". - :vartype peering_option: str or ~azure.mgmt.managednetworkfabric.models.PeeringOption - :ivar option_b_properties: option B properties object. - :vartype option_b_properties: ~azure.mgmt.managednetworkfabric.models.L3OptionBProperties - :ivar option_a_properties: option A properties object. - :vartype option_a_properties: - ~azure.mgmt.managednetworkfabric.models.ExternalNetworkPropertiesOptionAProperties - :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", - "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", - "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", - "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.AdministrativeState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "network_to_network_interconnect_id": {"readonly": True}, - "peering_option": {"required": True}, - "configuration_state": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "administrative_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "annotation": {"key": "properties.annotation", "type": "str"}, - "import_route_policy_id": {"key": "properties.importRoutePolicyId", "type": "str"}, - "export_route_policy_id": {"key": "properties.exportRoutePolicyId", "type": "str"}, - "import_route_policy": {"key": "properties.importRoutePolicy", "type": "ImportRoutePolicy"}, - "export_route_policy": {"key": "properties.exportRoutePolicy", "type": "ExportRoutePolicy"}, - "network_to_network_interconnect_id": {"key": "properties.networkToNetworkInterconnectId", "type": "str"}, - "peering_option": {"key": "properties.peeringOption", "type": "str"}, - "option_b_properties": {"key": "properties.optionBProperties", "type": "L3OptionBProperties"}, - "option_a_properties": { - "key": "properties.optionAProperties", - "type": "ExternalNetworkPropertiesOptionAProperties", - }, - "configuration_state": {"key": "properties.configurationState", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "administrative_state": {"key": "properties.administrativeState", "type": "str"}, - } - - def __init__( - self, - *, - peering_option: Union[str, "_models.PeeringOption"], - annotation: Optional[str] = None, - import_route_policy_id: Optional[str] = None, - export_route_policy_id: Optional[str] = None, - import_route_policy: Optional["_models.ImportRoutePolicy"] = None, - export_route_policy: Optional["_models.ExportRoutePolicy"] = None, - option_b_properties: Optional["_models.L3OptionBProperties"] = None, - option_a_properties: Optional["_models.ExternalNetworkPropertiesOptionAProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword import_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the - backward compatibility. - :paramtype import_route_policy_id: str - :keyword export_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the - backward compatibility. - :paramtype export_route_policy_id: str - :keyword import_route_policy: Import Route Policy either IPv4 or IPv6. - :paramtype import_route_policy: ~azure.mgmt.managednetworkfabric.models.ImportRoutePolicy - :keyword export_route_policy: Export Route Policy either IPv4 or IPv6. - :paramtype export_route_policy: ~azure.mgmt.managednetworkfabric.models.ExportRoutePolicy - :keyword peering_option: Peering option list. Required. Known values are: "OptionA" and - "OptionB". - :paramtype peering_option: str or ~azure.mgmt.managednetworkfabric.models.PeeringOption - :keyword option_b_properties: option B properties object. - :paramtype option_b_properties: ~azure.mgmt.managednetworkfabric.models.L3OptionBProperties - :keyword option_a_properties: option A properties object. - :paramtype option_a_properties: - ~azure.mgmt.managednetworkfabric.models.ExternalNetworkPropertiesOptionAProperties - """ - super().__init__(**kwargs) - self.annotation = annotation - self.import_route_policy_id = import_route_policy_id - self.export_route_policy_id = export_route_policy_id - self.import_route_policy = import_route_policy - self.export_route_policy = export_route_policy - self.network_to_network_interconnect_id = None - self.peering_option = peering_option - self.option_b_properties = option_b_properties - self.option_a_properties = option_a_properties - self.configuration_state = None - self.provisioning_state = None - self.administrative_state = None - - -class ExternalNetworkPatch(_serialization.Model): - """The ExternalNetwork patch resource definition. - - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar import_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the backward - compatibility. - :vartype import_route_policy_id: str - :ivar export_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the backward - compatibility. - :vartype export_route_policy_id: str - :ivar import_route_policy: Import Route Policy either IPv4 or IPv6. - :vartype import_route_policy: ~azure.mgmt.managednetworkfabric.models.ImportRoutePolicy - :ivar export_route_policy: Export Route Policy either IPv4 or IPv6. - :vartype export_route_policy: ~azure.mgmt.managednetworkfabric.models.ExportRoutePolicy - :ivar peering_option: Peering option list. Known values are: "OptionA" and "OptionB". - :vartype peering_option: str or ~azure.mgmt.managednetworkfabric.models.PeeringOption - :ivar option_b_properties: option B properties object. - :vartype option_b_properties: ~azure.mgmt.managednetworkfabric.models.L3OptionBProperties - :ivar option_a_properties: option A properties object. - :vartype option_a_properties: - ~azure.mgmt.managednetworkfabric.models.ExternalNetworkPatchPropertiesOptionAProperties - """ - - _attribute_map = { - "annotation": {"key": "properties.annotation", "type": "str"}, - "import_route_policy_id": {"key": "properties.importRoutePolicyId", "type": "str"}, - "export_route_policy_id": {"key": "properties.exportRoutePolicyId", "type": "str"}, - "import_route_policy": {"key": "properties.importRoutePolicy", "type": "ImportRoutePolicy"}, - "export_route_policy": {"key": "properties.exportRoutePolicy", "type": "ExportRoutePolicy"}, - "peering_option": {"key": "properties.peeringOption", "type": "str"}, - "option_b_properties": {"key": "properties.optionBProperties", "type": "L3OptionBProperties"}, - "option_a_properties": { - "key": "properties.optionAProperties", - "type": "ExternalNetworkPatchPropertiesOptionAProperties", - }, - } - - def __init__( - self, - *, - annotation: Optional[str] = None, - import_route_policy_id: Optional[str] = None, - export_route_policy_id: Optional[str] = None, - import_route_policy: Optional["_models.ImportRoutePolicy"] = None, - export_route_policy: Optional["_models.ExportRoutePolicy"] = None, - peering_option: Optional[Union[str, "_models.PeeringOption"]] = None, - option_b_properties: Optional["_models.L3OptionBProperties"] = None, - option_a_properties: Optional["_models.ExternalNetworkPatchPropertiesOptionAProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword import_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the - backward compatibility. - :paramtype import_route_policy_id: str - :keyword export_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the - backward compatibility. - :paramtype export_route_policy_id: str - :keyword import_route_policy: Import Route Policy either IPv4 or IPv6. - :paramtype import_route_policy: ~azure.mgmt.managednetworkfabric.models.ImportRoutePolicy - :keyword export_route_policy: Export Route Policy either IPv4 or IPv6. - :paramtype export_route_policy: ~azure.mgmt.managednetworkfabric.models.ExportRoutePolicy - :keyword peering_option: Peering option list. Known values are: "OptionA" and "OptionB". - :paramtype peering_option: str or ~azure.mgmt.managednetworkfabric.models.PeeringOption - :keyword option_b_properties: option B properties object. - :paramtype option_b_properties: ~azure.mgmt.managednetworkfabric.models.L3OptionBProperties - :keyword option_a_properties: option A properties object. - :paramtype option_a_properties: - ~azure.mgmt.managednetworkfabric.models.ExternalNetworkPatchPropertiesOptionAProperties - """ - super().__init__(**kwargs) - self.annotation = annotation - self.import_route_policy_id = import_route_policy_id - self.export_route_policy_id = export_route_policy_id - self.import_route_policy = import_route_policy - self.export_route_policy = export_route_policy - self.peering_option = peering_option - self.option_b_properties = option_b_properties - self.option_a_properties = option_a_properties - - -class ExternalNetworkPatchableProperties(_serialization.Model): - """The ExternalNetwork patchable properties. - - :ivar import_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the backward - compatibility. - :vartype import_route_policy_id: str - :ivar export_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the backward - compatibility. - :vartype export_route_policy_id: str - :ivar import_route_policy: Import Route Policy either IPv4 or IPv6. - :vartype import_route_policy: ~azure.mgmt.managednetworkfabric.models.ImportRoutePolicy - :ivar export_route_policy: Export Route Policy either IPv4 or IPv6. - :vartype export_route_policy: ~azure.mgmt.managednetworkfabric.models.ExportRoutePolicy - """ - - _attribute_map = { - "import_route_policy_id": {"key": "importRoutePolicyId", "type": "str"}, - "export_route_policy_id": {"key": "exportRoutePolicyId", "type": "str"}, - "import_route_policy": {"key": "importRoutePolicy", "type": "ImportRoutePolicy"}, - "export_route_policy": {"key": "exportRoutePolicy", "type": "ExportRoutePolicy"}, - } - - def __init__( - self, - *, - import_route_policy_id: Optional[str] = None, - export_route_policy_id: Optional[str] = None, - import_route_policy: Optional["_models.ImportRoutePolicy"] = None, - export_route_policy: Optional["_models.ExportRoutePolicy"] = None, - **kwargs: Any - ) -> None: - """ - :keyword import_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the - backward compatibility. - :paramtype import_route_policy_id: str - :keyword export_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the - backward compatibility. - :paramtype export_route_policy_id: str - :keyword import_route_policy: Import Route Policy either IPv4 or IPv6. - :paramtype import_route_policy: ~azure.mgmt.managednetworkfabric.models.ImportRoutePolicy - :keyword export_route_policy: Export Route Policy either IPv4 or IPv6. - :paramtype export_route_policy: ~azure.mgmt.managednetworkfabric.models.ExportRoutePolicy - """ - super().__init__(**kwargs) - self.import_route_policy_id = import_route_policy_id - self.export_route_policy_id = export_route_policy_id - self.import_route_policy = import_route_policy - self.export_route_policy = export_route_policy - - -class ExternalNetworkPatchProperties(AnnotationResource, ExternalNetworkPatchableProperties): - """External Network Patch properties. - - :ivar import_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the backward - compatibility. - :vartype import_route_policy_id: str - :ivar export_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the backward - compatibility. - :vartype export_route_policy_id: str - :ivar import_route_policy: Import Route Policy either IPv4 or IPv6. - :vartype import_route_policy: ~azure.mgmt.managednetworkfabric.models.ImportRoutePolicy - :ivar export_route_policy: Export Route Policy either IPv4 or IPv6. - :vartype export_route_policy: ~azure.mgmt.managednetworkfabric.models.ExportRoutePolicy - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar peering_option: Peering option list. Known values are: "OptionA" and "OptionB". - :vartype peering_option: str or ~azure.mgmt.managednetworkfabric.models.PeeringOption - :ivar option_b_properties: option B properties object. - :vartype option_b_properties: ~azure.mgmt.managednetworkfabric.models.L3OptionBProperties - :ivar option_a_properties: option A properties object. - :vartype option_a_properties: - ~azure.mgmt.managednetworkfabric.models.ExternalNetworkPatchPropertiesOptionAProperties - """ - - _attribute_map = { - "import_route_policy_id": {"key": "importRoutePolicyId", "type": "str"}, - "export_route_policy_id": {"key": "exportRoutePolicyId", "type": "str"}, - "import_route_policy": {"key": "importRoutePolicy", "type": "ImportRoutePolicy"}, - "export_route_policy": {"key": "exportRoutePolicy", "type": "ExportRoutePolicy"}, - "annotation": {"key": "annotation", "type": "str"}, - "peering_option": {"key": "peeringOption", "type": "str"}, - "option_b_properties": {"key": "optionBProperties", "type": "L3OptionBProperties"}, - "option_a_properties": {"key": "optionAProperties", "type": "ExternalNetworkPatchPropertiesOptionAProperties"}, - } - - def __init__( - self, - *, - import_route_policy_id: Optional[str] = None, - export_route_policy_id: Optional[str] = None, - import_route_policy: Optional["_models.ImportRoutePolicy"] = None, - export_route_policy: Optional["_models.ExportRoutePolicy"] = None, - annotation: Optional[str] = None, - peering_option: Optional[Union[str, "_models.PeeringOption"]] = None, - option_b_properties: Optional["_models.L3OptionBProperties"] = None, - option_a_properties: Optional["_models.ExternalNetworkPatchPropertiesOptionAProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword import_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the - backward compatibility. - :paramtype import_route_policy_id: str - :keyword export_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the - backward compatibility. - :paramtype export_route_policy_id: str - :keyword import_route_policy: Import Route Policy either IPv4 or IPv6. - :paramtype import_route_policy: ~azure.mgmt.managednetworkfabric.models.ImportRoutePolicy - :keyword export_route_policy: Export Route Policy either IPv4 or IPv6. - :paramtype export_route_policy: ~azure.mgmt.managednetworkfabric.models.ExportRoutePolicy - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword peering_option: Peering option list. Known values are: "OptionA" and "OptionB". - :paramtype peering_option: str or ~azure.mgmt.managednetworkfabric.models.PeeringOption - :keyword option_b_properties: option B properties object. - :paramtype option_b_properties: ~azure.mgmt.managednetworkfabric.models.L3OptionBProperties - :keyword option_a_properties: option A properties object. - :paramtype option_a_properties: - ~azure.mgmt.managednetworkfabric.models.ExternalNetworkPatchPropertiesOptionAProperties - """ - super().__init__( - annotation=annotation, - import_route_policy_id=import_route_policy_id, - export_route_policy_id=export_route_policy_id, - import_route_policy=import_route_policy, - export_route_policy=export_route_policy, - **kwargs - ) - self.import_route_policy_id = import_route_policy_id - self.export_route_policy_id = export_route_policy_id - self.import_route_policy = import_route_policy - self.export_route_policy = export_route_policy - self.peering_option = peering_option - self.option_b_properties = option_b_properties - self.option_a_properties = option_a_properties - self.annotation = annotation - - -class L3OptionAProperties(_serialization.Model): - """Peering optionA properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar mtu: MTU to use for option A peering. - :vartype mtu: int - :ivar vlan_id: Vlan identifier. Example : 501. - :vartype vlan_id: int - :ivar fabric_asn: Fabric ASN number. Example 65001. - :vartype fabric_asn: int - :ivar peer_asn: Peer ASN number.Example : 28. - :vartype peer_asn: int - :ivar bfd_configuration: BFD configuration properties. - :vartype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdConfiguration - :ivar ingress_acl_id: Ingress Acl. ARM resource ID of Access Control Lists. - :vartype ingress_acl_id: str - :ivar egress_acl_id: Egress Acl. ARM resource ID of Access Control Lists. - :vartype egress_acl_id: str - """ - - _validation = { - "mtu": {"maximum": 9200, "minimum": 64}, - "vlan_id": {"maximum": 4094, "minimum": 501}, - "fabric_asn": {"readonly": True, "maximum": 4294967295, "minimum": 1}, - "peer_asn": {"maximum": 4294967295, "minimum": 1}, - } - - _attribute_map = { - "mtu": {"key": "mtu", "type": "int"}, - "vlan_id": {"key": "vlanId", "type": "int"}, - "fabric_asn": {"key": "fabricASN", "type": "int"}, - "peer_asn": {"key": "peerASN", "type": "int"}, - "bfd_configuration": {"key": "bfdConfiguration", "type": "BfdConfiguration"}, - "ingress_acl_id": {"key": "ingressAclId", "type": "str"}, - "egress_acl_id": {"key": "egressAclId", "type": "str"}, - } - - def __init__( - self, - *, - mtu: int = 1500, - vlan_id: Optional[int] = None, - peer_asn: Optional[int] = None, - bfd_configuration: Optional["_models.BfdConfiguration"] = None, - ingress_acl_id: Optional[str] = None, - egress_acl_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword mtu: MTU to use for option A peering. - :paramtype mtu: int - :keyword vlan_id: Vlan identifier. Example : 501. - :paramtype vlan_id: int - :keyword peer_asn: Peer ASN number.Example : 28. - :paramtype peer_asn: int - :keyword bfd_configuration: BFD configuration properties. - :paramtype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdConfiguration - :keyword ingress_acl_id: Ingress Acl. ARM resource ID of Access Control Lists. - :paramtype ingress_acl_id: str - :keyword egress_acl_id: Egress Acl. ARM resource ID of Access Control Lists. - :paramtype egress_acl_id: str - """ - super().__init__(**kwargs) - self.mtu = mtu - self.vlan_id = vlan_id - self.fabric_asn = None - self.peer_asn = peer_asn - self.bfd_configuration = bfd_configuration - self.ingress_acl_id = ingress_acl_id - self.egress_acl_id = egress_acl_id - - -class Layer3IpPrefixProperties(_serialization.Model): - """Layer 3 primary and secondary IP Address prefixes. - - :ivar primary_ipv4_prefix: IPv4 Address Prefix. - :vartype primary_ipv4_prefix: str - :ivar primary_ipv6_prefix: IPv6 Address Prefix. - :vartype primary_ipv6_prefix: str - :ivar secondary_ipv4_prefix: Secondary IPv4 Address Prefix. - :vartype secondary_ipv4_prefix: str - :ivar secondary_ipv6_prefix: Secondary IPv6 Address Prefix. - :vartype secondary_ipv6_prefix: str - """ - - _attribute_map = { - "primary_ipv4_prefix": {"key": "primaryIpv4Prefix", "type": "str"}, - "primary_ipv6_prefix": {"key": "primaryIpv6Prefix", "type": "str"}, - "secondary_ipv4_prefix": {"key": "secondaryIpv4Prefix", "type": "str"}, - "secondary_ipv6_prefix": {"key": "secondaryIpv6Prefix", "type": "str"}, - } - - def __init__( - self, - *, - primary_ipv4_prefix: Optional[str] = None, - primary_ipv6_prefix: Optional[str] = None, - secondary_ipv4_prefix: Optional[str] = None, - secondary_ipv6_prefix: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword primary_ipv4_prefix: IPv4 Address Prefix. - :paramtype primary_ipv4_prefix: str - :keyword primary_ipv6_prefix: IPv6 Address Prefix. - :paramtype primary_ipv6_prefix: str - :keyword secondary_ipv4_prefix: Secondary IPv4 Address Prefix. - :paramtype secondary_ipv4_prefix: str - :keyword secondary_ipv6_prefix: Secondary IPv6 Address Prefix. - :paramtype secondary_ipv6_prefix: str - """ - super().__init__(**kwargs) - self.primary_ipv4_prefix = primary_ipv4_prefix - self.primary_ipv6_prefix = primary_ipv6_prefix - self.secondary_ipv4_prefix = secondary_ipv4_prefix - self.secondary_ipv6_prefix = secondary_ipv6_prefix - - -class ExternalNetworkPatchPropertiesOptionAProperties( - Layer3IpPrefixProperties, L3OptionAProperties -): # pylint: disable=too-many-instance-attributes - """option A properties object. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar mtu: MTU to use for option A peering. - :vartype mtu: int - :ivar vlan_id: Vlan identifier. Example : 501. - :vartype vlan_id: int - :ivar fabric_asn: Fabric ASN number. Example 65001. - :vartype fabric_asn: int - :ivar peer_asn: Peer ASN number.Example : 28. - :vartype peer_asn: int - :ivar bfd_configuration: BFD configuration properties. - :vartype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdConfiguration - :ivar ingress_acl_id: Ingress Acl. ARM resource ID of Access Control Lists. - :vartype ingress_acl_id: str - :ivar egress_acl_id: Egress Acl. ARM resource ID of Access Control Lists. - :vartype egress_acl_id: str - :ivar primary_ipv4_prefix: IPv4 Address Prefix. - :vartype primary_ipv4_prefix: str - :ivar primary_ipv6_prefix: IPv6 Address Prefix. - :vartype primary_ipv6_prefix: str - :ivar secondary_ipv4_prefix: Secondary IPv4 Address Prefix. - :vartype secondary_ipv4_prefix: str - :ivar secondary_ipv6_prefix: Secondary IPv6 Address Prefix. - :vartype secondary_ipv6_prefix: str - """ - - _validation = { - "mtu": {"maximum": 9200, "minimum": 64}, - "vlan_id": {"maximum": 4094, "minimum": 501}, - "fabric_asn": {"readonly": True, "maximum": 4294967295, "minimum": 1}, - "peer_asn": {"maximum": 4294967295, "minimum": 1}, - } - - _attribute_map = { - "mtu": {"key": "mtu", "type": "int"}, - "vlan_id": {"key": "vlanId", "type": "int"}, - "fabric_asn": {"key": "fabricASN", "type": "int"}, - "peer_asn": {"key": "peerASN", "type": "int"}, - "bfd_configuration": {"key": "bfdConfiguration", "type": "BfdConfiguration"}, - "ingress_acl_id": {"key": "ingressAclId", "type": "str"}, - "egress_acl_id": {"key": "egressAclId", "type": "str"}, - "primary_ipv4_prefix": {"key": "primaryIpv4Prefix", "type": "str"}, - "primary_ipv6_prefix": {"key": "primaryIpv6Prefix", "type": "str"}, - "secondary_ipv4_prefix": {"key": "secondaryIpv4Prefix", "type": "str"}, - "secondary_ipv6_prefix": {"key": "secondaryIpv6Prefix", "type": "str"}, - } - - def __init__( - self, - *, - mtu: int = 1500, - vlan_id: Optional[int] = None, - peer_asn: Optional[int] = None, - bfd_configuration: Optional["_models.BfdConfiguration"] = None, - ingress_acl_id: Optional[str] = None, - egress_acl_id: Optional[str] = None, - primary_ipv4_prefix: Optional[str] = None, - primary_ipv6_prefix: Optional[str] = None, - secondary_ipv4_prefix: Optional[str] = None, - secondary_ipv6_prefix: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword mtu: MTU to use for option A peering. - :paramtype mtu: int - :keyword vlan_id: Vlan identifier. Example : 501. - :paramtype vlan_id: int - :keyword peer_asn: Peer ASN number.Example : 28. - :paramtype peer_asn: int - :keyword bfd_configuration: BFD configuration properties. - :paramtype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdConfiguration - :keyword ingress_acl_id: Ingress Acl. ARM resource ID of Access Control Lists. - :paramtype ingress_acl_id: str - :keyword egress_acl_id: Egress Acl. ARM resource ID of Access Control Lists. - :paramtype egress_acl_id: str - :keyword primary_ipv4_prefix: IPv4 Address Prefix. - :paramtype primary_ipv4_prefix: str - :keyword primary_ipv6_prefix: IPv6 Address Prefix. - :paramtype primary_ipv6_prefix: str - :keyword secondary_ipv4_prefix: Secondary IPv4 Address Prefix. - :paramtype secondary_ipv4_prefix: str - :keyword secondary_ipv6_prefix: Secondary IPv6 Address Prefix. - :paramtype secondary_ipv6_prefix: str - """ - super().__init__( - primary_ipv4_prefix=primary_ipv4_prefix, - primary_ipv6_prefix=primary_ipv6_prefix, - secondary_ipv4_prefix=secondary_ipv4_prefix, - secondary_ipv6_prefix=secondary_ipv6_prefix, - mtu=mtu, - vlan_id=vlan_id, - peer_asn=peer_asn, - bfd_configuration=bfd_configuration, - ingress_acl_id=ingress_acl_id, - egress_acl_id=egress_acl_id, - **kwargs - ) - self.mtu = mtu - self.vlan_id = vlan_id - self.fabric_asn = None - self.peer_asn = peer_asn - self.bfd_configuration = bfd_configuration - self.ingress_acl_id = ingress_acl_id - self.egress_acl_id = egress_acl_id - self.primary_ipv4_prefix = primary_ipv4_prefix - self.primary_ipv6_prefix = primary_ipv6_prefix - self.secondary_ipv4_prefix = secondary_ipv4_prefix - self.secondary_ipv6_prefix = secondary_ipv6_prefix - - -class ExternalNetworkProperties( - AnnotationResource, ExternalNetworkPatchableProperties -): # pylint: disable=too-many-instance-attributes - """External Network Properties. - - 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 Azure. - - :ivar import_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the backward - compatibility. - :vartype import_route_policy_id: str - :ivar export_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the backward - compatibility. - :vartype export_route_policy_id: str - :ivar import_route_policy: Import Route Policy either IPv4 or IPv6. - :vartype import_route_policy: ~azure.mgmt.managednetworkfabric.models.ImportRoutePolicy - :ivar export_route_policy: Export Route Policy either IPv4 or IPv6. - :vartype export_route_policy: ~azure.mgmt.managednetworkfabric.models.ExportRoutePolicy - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar network_to_network_interconnect_id: Gets the networkToNetworkInterconnectId of the - resource. - :vartype network_to_network_interconnect_id: str - :ivar peering_option: Peering option list. Required. Known values are: "OptionA" and "OptionB". - :vartype peering_option: str or ~azure.mgmt.managednetworkfabric.models.PeeringOption - :ivar option_b_properties: option B properties object. - :vartype option_b_properties: ~azure.mgmt.managednetworkfabric.models.L3OptionBProperties - :ivar option_a_properties: option A properties object. - :vartype option_a_properties: - ~azure.mgmt.managednetworkfabric.models.ExternalNetworkPropertiesOptionAProperties - :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", - "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", - "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", - "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.AdministrativeState - """ - - _validation = { - "network_to_network_interconnect_id": {"readonly": True}, - "peering_option": {"required": True}, - "configuration_state": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "administrative_state": {"readonly": True}, - } - - _attribute_map = { - "import_route_policy_id": {"key": "importRoutePolicyId", "type": "str"}, - "export_route_policy_id": {"key": "exportRoutePolicyId", "type": "str"}, - "import_route_policy": {"key": "importRoutePolicy", "type": "ImportRoutePolicy"}, - "export_route_policy": {"key": "exportRoutePolicy", "type": "ExportRoutePolicy"}, - "annotation": {"key": "annotation", "type": "str"}, - "network_to_network_interconnect_id": {"key": "networkToNetworkInterconnectId", "type": "str"}, - "peering_option": {"key": "peeringOption", "type": "str"}, - "option_b_properties": {"key": "optionBProperties", "type": "L3OptionBProperties"}, - "option_a_properties": {"key": "optionAProperties", "type": "ExternalNetworkPropertiesOptionAProperties"}, - "configuration_state": {"key": "configurationState", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "administrative_state": {"key": "administrativeState", "type": "str"}, - } - - def __init__( - self, - *, - peering_option: Union[str, "_models.PeeringOption"], - import_route_policy_id: Optional[str] = None, - export_route_policy_id: Optional[str] = None, - import_route_policy: Optional["_models.ImportRoutePolicy"] = None, - export_route_policy: Optional["_models.ExportRoutePolicy"] = None, - annotation: Optional[str] = None, - option_b_properties: Optional["_models.L3OptionBProperties"] = None, - option_a_properties: Optional["_models.ExternalNetworkPropertiesOptionAProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword import_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the - backward compatibility. - :paramtype import_route_policy_id: str - :keyword export_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the - backward compatibility. - :paramtype export_route_policy_id: str - :keyword import_route_policy: Import Route Policy either IPv4 or IPv6. - :paramtype import_route_policy: ~azure.mgmt.managednetworkfabric.models.ImportRoutePolicy - :keyword export_route_policy: Export Route Policy either IPv4 or IPv6. - :paramtype export_route_policy: ~azure.mgmt.managednetworkfabric.models.ExportRoutePolicy - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword peering_option: Peering option list. Required. Known values are: "OptionA" and - "OptionB". - :paramtype peering_option: str or ~azure.mgmt.managednetworkfabric.models.PeeringOption - :keyword option_b_properties: option B properties object. - :paramtype option_b_properties: ~azure.mgmt.managednetworkfabric.models.L3OptionBProperties - :keyword option_a_properties: option A properties object. - :paramtype option_a_properties: - ~azure.mgmt.managednetworkfabric.models.ExternalNetworkPropertiesOptionAProperties - """ - super().__init__( - annotation=annotation, - import_route_policy_id=import_route_policy_id, - export_route_policy_id=export_route_policy_id, - import_route_policy=import_route_policy, - export_route_policy=export_route_policy, - **kwargs - ) - self.import_route_policy_id = import_route_policy_id - self.export_route_policy_id = export_route_policy_id - self.import_route_policy = import_route_policy - self.export_route_policy = export_route_policy - self.network_to_network_interconnect_id = None - self.peering_option = peering_option - self.option_b_properties = option_b_properties - self.option_a_properties = option_a_properties - self.configuration_state = None - self.provisioning_state = None - self.administrative_state = None - self.annotation = annotation - - -class ExternalNetworkPropertiesOptionAProperties( - Layer3IpPrefixProperties, L3OptionAProperties -): # pylint: disable=too-many-instance-attributes - """option A properties object. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar mtu: MTU to use for option A peering. - :vartype mtu: int - :ivar vlan_id: Vlan identifier. Example : 501. - :vartype vlan_id: int - :ivar fabric_asn: Fabric ASN number. Example 65001. - :vartype fabric_asn: int - :ivar peer_asn: Peer ASN number.Example : 28. - :vartype peer_asn: int - :ivar bfd_configuration: BFD configuration properties. - :vartype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdConfiguration - :ivar ingress_acl_id: Ingress Acl. ARM resource ID of Access Control Lists. - :vartype ingress_acl_id: str - :ivar egress_acl_id: Egress Acl. ARM resource ID of Access Control Lists. - :vartype egress_acl_id: str - :ivar primary_ipv4_prefix: IPv4 Address Prefix. - :vartype primary_ipv4_prefix: str - :ivar primary_ipv6_prefix: IPv6 Address Prefix. - :vartype primary_ipv6_prefix: str - :ivar secondary_ipv4_prefix: Secondary IPv4 Address Prefix. - :vartype secondary_ipv4_prefix: str - :ivar secondary_ipv6_prefix: Secondary IPv6 Address Prefix. - :vartype secondary_ipv6_prefix: str - """ - - _validation = { - "mtu": {"maximum": 9200, "minimum": 64}, - "vlan_id": {"maximum": 4094, "minimum": 501}, - "fabric_asn": {"readonly": True, "maximum": 4294967295, "minimum": 1}, - "peer_asn": {"maximum": 4294967295, "minimum": 1}, - } - - _attribute_map = { - "mtu": {"key": "mtu", "type": "int"}, - "vlan_id": {"key": "vlanId", "type": "int"}, - "fabric_asn": {"key": "fabricASN", "type": "int"}, - "peer_asn": {"key": "peerASN", "type": "int"}, - "bfd_configuration": {"key": "bfdConfiguration", "type": "BfdConfiguration"}, - "ingress_acl_id": {"key": "ingressAclId", "type": "str"}, - "egress_acl_id": {"key": "egressAclId", "type": "str"}, - "primary_ipv4_prefix": {"key": "primaryIpv4Prefix", "type": "str"}, - "primary_ipv6_prefix": {"key": "primaryIpv6Prefix", "type": "str"}, - "secondary_ipv4_prefix": {"key": "secondaryIpv4Prefix", "type": "str"}, - "secondary_ipv6_prefix": {"key": "secondaryIpv6Prefix", "type": "str"}, - } - - def __init__( - self, - *, - mtu: int = 1500, - vlan_id: Optional[int] = None, - peer_asn: Optional[int] = None, - bfd_configuration: Optional["_models.BfdConfiguration"] = None, - ingress_acl_id: Optional[str] = None, - egress_acl_id: Optional[str] = None, - primary_ipv4_prefix: Optional[str] = None, - primary_ipv6_prefix: Optional[str] = None, - secondary_ipv4_prefix: Optional[str] = None, - secondary_ipv6_prefix: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword mtu: MTU to use for option A peering. - :paramtype mtu: int - :keyword vlan_id: Vlan identifier. Example : 501. - :paramtype vlan_id: int - :keyword peer_asn: Peer ASN number.Example : 28. - :paramtype peer_asn: int - :keyword bfd_configuration: BFD configuration properties. - :paramtype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdConfiguration - :keyword ingress_acl_id: Ingress Acl. ARM resource ID of Access Control Lists. - :paramtype ingress_acl_id: str - :keyword egress_acl_id: Egress Acl. ARM resource ID of Access Control Lists. - :paramtype egress_acl_id: str - :keyword primary_ipv4_prefix: IPv4 Address Prefix. - :paramtype primary_ipv4_prefix: str - :keyword primary_ipv6_prefix: IPv6 Address Prefix. - :paramtype primary_ipv6_prefix: str - :keyword secondary_ipv4_prefix: Secondary IPv4 Address Prefix. - :paramtype secondary_ipv4_prefix: str - :keyword secondary_ipv6_prefix: Secondary IPv6 Address Prefix. - :paramtype secondary_ipv6_prefix: str - """ - super().__init__( - primary_ipv4_prefix=primary_ipv4_prefix, - primary_ipv6_prefix=primary_ipv6_prefix, - secondary_ipv4_prefix=secondary_ipv4_prefix, - secondary_ipv6_prefix=secondary_ipv6_prefix, - mtu=mtu, - vlan_id=vlan_id, - peer_asn=peer_asn, - bfd_configuration=bfd_configuration, - ingress_acl_id=ingress_acl_id, - egress_acl_id=egress_acl_id, - **kwargs - ) - self.mtu = mtu - self.vlan_id = vlan_id - self.fabric_asn = None - self.peer_asn = peer_asn - self.bfd_configuration = bfd_configuration - self.ingress_acl_id = ingress_acl_id - self.egress_acl_id = egress_acl_id - self.primary_ipv4_prefix = primary_ipv4_prefix - self.primary_ipv6_prefix = primary_ipv6_prefix - self.secondary_ipv4_prefix = secondary_ipv4_prefix - self.secondary_ipv6_prefix = secondary_ipv6_prefix - - -class ExternalNetworksList(_serialization.Model): - """List of External Networks. - - :ivar value: List of External Network resources. - :vartype value: list[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] - :ivar next_link: Url to follow for getting next page of resources. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[ExternalNetwork]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: Optional[List["_models.ExternalNetwork"]] = None, next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: List of External Network resources. - :paramtype value: list[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] - :keyword next_link: Url to follow for getting next page of resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class ImportRoutePolicy(_serialization.Model): - """Import Route Policy either IPv4 or IPv6. - - :ivar import_ipv4_route_policy_id: ARM resource ID of RoutePolicy. - :vartype import_ipv4_route_policy_id: str - :ivar import_ipv6_route_policy_id: ARM resource ID of RoutePolicy. - :vartype import_ipv6_route_policy_id: str - """ - - _attribute_map = { - "import_ipv4_route_policy_id": {"key": "importIpv4RoutePolicyId", "type": "str"}, - "import_ipv6_route_policy_id": {"key": "importIpv6RoutePolicyId", "type": "str"}, - } - - def __init__( - self, - *, - import_ipv4_route_policy_id: Optional[str] = None, - import_ipv6_route_policy_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword import_ipv4_route_policy_id: ARM resource ID of RoutePolicy. - :paramtype import_ipv4_route_policy_id: str - :keyword import_ipv6_route_policy_id: ARM resource ID of RoutePolicy. - :paramtype import_ipv6_route_policy_id: str - """ - super().__init__(**kwargs) - self.import_ipv4_route_policy_id = import_ipv4_route_policy_id - self.import_ipv6_route_policy_id = import_ipv6_route_policy_id - - -class ImportRoutePolicyInformation(_serialization.Model): - """Import Route Policy Configuration. - - :ivar import_ipv4_route_policy_id: Import IPv4 Route Policy Id. - :vartype import_ipv4_route_policy_id: str - :ivar import_ipv6_route_policy_id: Import IPv6 Route Policy Id. - :vartype import_ipv6_route_policy_id: str - """ - - _attribute_map = { - "import_ipv4_route_policy_id": {"key": "importIpv4RoutePolicyId", "type": "str"}, - "import_ipv6_route_policy_id": {"key": "importIpv6RoutePolicyId", "type": "str"}, - } - - def __init__( - self, - *, - import_ipv4_route_policy_id: Optional[str] = None, - import_ipv6_route_policy_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword import_ipv4_route_policy_id: Import IPv4 Route Policy Id. - :paramtype import_ipv4_route_policy_id: str - :keyword import_ipv6_route_policy_id: Import IPv6 Route Policy Id. - :paramtype import_ipv6_route_policy_id: str - """ - super().__init__(**kwargs) - self.import_ipv4_route_policy_id = import_ipv4_route_policy_id - self.import_ipv6_route_policy_id = import_ipv6_route_policy_id - - -class InternalNetwork(ProxyResource): # pylint: disable=too-many-instance-attributes - """Defines the Internal Network 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 Azure. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar mtu: Maximum transmission unit. Default value is 1500. - :vartype mtu: int - :ivar connected_i_pv4_subnets: List of Connected IPv4 Subnets. - :vartype connected_i_pv4_subnets: list[~azure.mgmt.managednetworkfabric.models.ConnectedSubnet] - :ivar connected_i_pv6_subnets: List of connected IPv6 Subnets. - :vartype connected_i_pv6_subnets: list[~azure.mgmt.managednetworkfabric.models.ConnectedSubnet] - :ivar import_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the backward - compatibility. - :vartype import_route_policy_id: str - :ivar export_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the backward - compatibility. - :vartype export_route_policy_id: str - :ivar import_route_policy: Import Route Policy either IPv4 or IPv6. - :vartype import_route_policy: ~azure.mgmt.managednetworkfabric.models.ImportRoutePolicy - :ivar export_route_policy: Export Route Policy either IPv4 or IPv6. - :vartype export_route_policy: ~azure.mgmt.managednetworkfabric.models.ExportRoutePolicy - :ivar ingress_acl_id: Ingress Acl. ARM resource ID of Access Control Lists. - :vartype ingress_acl_id: str - :ivar egress_acl_id: Egress Acl. ARM resource ID of Access Control Lists. - :vartype egress_acl_id: str - :ivar is_monitoring_enabled: To check whether monitoring of internal network is enabled or not. - Known values are: "True" and "False". - :vartype is_monitoring_enabled: str or - ~azure.mgmt.managednetworkfabric.models.IsMonitoringEnabled - :ivar extension: Extension. Example: NoExtension | NPB. Known values are: "NoExtension" and - "NPB". - :vartype extension: str or ~azure.mgmt.managednetworkfabric.models.Extension - :ivar vlan_id: Vlan identifier. Example: 1001. Required. - :vartype vlan_id: int - :ivar bgp_configuration: BGP configuration properties. - :vartype bgp_configuration: - ~azure.mgmt.managednetworkfabric.models.InternalNetworkPropertiesBgpConfiguration - :ivar static_route_configuration: Static Route Configuration properties. - :vartype static_route_configuration: - ~azure.mgmt.managednetworkfabric.models.InternalNetworkPropertiesStaticRouteConfiguration - :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", - "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", - "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", - "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.AdministrativeState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "mtu": {"maximum": 9200, "minimum": 64}, - "connected_i_pv4_subnets": {"min_items": 1}, - "connected_i_pv6_subnets": {"min_items": 1}, - "vlan_id": {"required": True, "maximum": 4094, "minimum": 100}, - "configuration_state": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "administrative_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "annotation": {"key": "properties.annotation", "type": "str"}, - "mtu": {"key": "properties.mtu", "type": "int"}, - "connected_i_pv4_subnets": {"key": "properties.connectedIPv4Subnets", "type": "[ConnectedSubnet]"}, - "connected_i_pv6_subnets": {"key": "properties.connectedIPv6Subnets", "type": "[ConnectedSubnet]"}, - "import_route_policy_id": {"key": "properties.importRoutePolicyId", "type": "str"}, - "export_route_policy_id": {"key": "properties.exportRoutePolicyId", "type": "str"}, - "import_route_policy": {"key": "properties.importRoutePolicy", "type": "ImportRoutePolicy"}, - "export_route_policy": {"key": "properties.exportRoutePolicy", "type": "ExportRoutePolicy"}, - "ingress_acl_id": {"key": "properties.ingressAclId", "type": "str"}, - "egress_acl_id": {"key": "properties.egressAclId", "type": "str"}, - "is_monitoring_enabled": {"key": "properties.isMonitoringEnabled", "type": "str"}, - "extension": {"key": "properties.extension", "type": "str"}, - "vlan_id": {"key": "properties.vlanId", "type": "int"}, - "bgp_configuration": { - "key": "properties.bgpConfiguration", - "type": "InternalNetworkPropertiesBgpConfiguration", - }, - "static_route_configuration": { - "key": "properties.staticRouteConfiguration", - "type": "InternalNetworkPropertiesStaticRouteConfiguration", - }, - "configuration_state": {"key": "properties.configurationState", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "administrative_state": {"key": "properties.administrativeState", "type": "str"}, - } - - def __init__( - self, - *, - vlan_id: int, - annotation: Optional[str] = None, - mtu: int = 1500, - connected_i_pv4_subnets: Optional[List["_models.ConnectedSubnet"]] = None, - connected_i_pv6_subnets: Optional[List["_models.ConnectedSubnet"]] = None, - import_route_policy_id: Optional[str] = None, - export_route_policy_id: Optional[str] = None, - import_route_policy: Optional["_models.ImportRoutePolicy"] = None, - export_route_policy: Optional["_models.ExportRoutePolicy"] = None, - ingress_acl_id: Optional[str] = None, - egress_acl_id: Optional[str] = None, - is_monitoring_enabled: Union[str, "_models.IsMonitoringEnabled"] = "False", - extension: Union[str, "_models.Extension"] = "NoExtension", - bgp_configuration: Optional["_models.InternalNetworkPropertiesBgpConfiguration"] = None, - static_route_configuration: Optional["_models.InternalNetworkPropertiesStaticRouteConfiguration"] = None, - **kwargs: Any - ) -> None: - """ - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword mtu: Maximum transmission unit. Default value is 1500. - :paramtype mtu: int - :keyword connected_i_pv4_subnets: List of Connected IPv4 Subnets. - :paramtype connected_i_pv4_subnets: - list[~azure.mgmt.managednetworkfabric.models.ConnectedSubnet] - :keyword connected_i_pv6_subnets: List of connected IPv6 Subnets. - :paramtype connected_i_pv6_subnets: - list[~azure.mgmt.managednetworkfabric.models.ConnectedSubnet] - :keyword import_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the - backward compatibility. - :paramtype import_route_policy_id: str - :keyword export_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the - backward compatibility. - :paramtype export_route_policy_id: str - :keyword import_route_policy: Import Route Policy either IPv4 or IPv6. - :paramtype import_route_policy: ~azure.mgmt.managednetworkfabric.models.ImportRoutePolicy - :keyword export_route_policy: Export Route Policy either IPv4 or IPv6. - :paramtype export_route_policy: ~azure.mgmt.managednetworkfabric.models.ExportRoutePolicy - :keyword ingress_acl_id: Ingress Acl. ARM resource ID of Access Control Lists. - :paramtype ingress_acl_id: str - :keyword egress_acl_id: Egress Acl. ARM resource ID of Access Control Lists. - :paramtype egress_acl_id: str - :keyword is_monitoring_enabled: To check whether monitoring of internal network is enabled or - not. Known values are: "True" and "False". - :paramtype is_monitoring_enabled: str or - ~azure.mgmt.managednetworkfabric.models.IsMonitoringEnabled - :keyword extension: Extension. Example: NoExtension | NPB. Known values are: "NoExtension" and - "NPB". - :paramtype extension: str or ~azure.mgmt.managednetworkfabric.models.Extension - :keyword vlan_id: Vlan identifier. Example: 1001. Required. - :paramtype vlan_id: int - :keyword bgp_configuration: BGP configuration properties. - :paramtype bgp_configuration: - ~azure.mgmt.managednetworkfabric.models.InternalNetworkPropertiesBgpConfiguration - :keyword static_route_configuration: Static Route Configuration properties. - :paramtype static_route_configuration: - ~azure.mgmt.managednetworkfabric.models.InternalNetworkPropertiesStaticRouteConfiguration - """ - super().__init__(**kwargs) - self.annotation = annotation - self.mtu = mtu - self.connected_i_pv4_subnets = connected_i_pv4_subnets - self.connected_i_pv6_subnets = connected_i_pv6_subnets - self.import_route_policy_id = import_route_policy_id - self.export_route_policy_id = export_route_policy_id - self.import_route_policy = import_route_policy - self.export_route_policy = export_route_policy - self.ingress_acl_id = ingress_acl_id - self.egress_acl_id = egress_acl_id - self.is_monitoring_enabled = is_monitoring_enabled - self.extension = extension - self.vlan_id = vlan_id - self.bgp_configuration = bgp_configuration - self.static_route_configuration = static_route_configuration - self.configuration_state = None - self.provisioning_state = None - self.administrative_state = None - - -class InternalNetworkPatch(_serialization.Model): # pylint: disable=too-many-instance-attributes - """The InternalNetwork patch resource definition. - - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar mtu: Maximum transmission unit. Default value is 1500. - :vartype mtu: int - :ivar connected_i_pv4_subnets: List of Connected IPv4 Subnets. - :vartype connected_i_pv4_subnets: list[~azure.mgmt.managednetworkfabric.models.ConnectedSubnet] - :ivar connected_i_pv6_subnets: List of connected IPv6 Subnets. - :vartype connected_i_pv6_subnets: list[~azure.mgmt.managednetworkfabric.models.ConnectedSubnet] - :ivar import_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the backward - compatibility. - :vartype import_route_policy_id: str - :ivar export_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the backward - compatibility. - :vartype export_route_policy_id: str - :ivar import_route_policy: Import Route Policy either IPv4 or IPv6. - :vartype import_route_policy: ~azure.mgmt.managednetworkfabric.models.ImportRoutePolicy - :ivar export_route_policy: Export Route Policy either IPv4 or IPv6. - :vartype export_route_policy: ~azure.mgmt.managednetworkfabric.models.ExportRoutePolicy - :ivar ingress_acl_id: Ingress Acl. ARM resource ID of Access Control Lists. - :vartype ingress_acl_id: str - :ivar egress_acl_id: Egress Acl. ARM resource ID of Access Control Lists. - :vartype egress_acl_id: str - :ivar is_monitoring_enabled: To check whether monitoring of internal network is enabled or not. - Known values are: "True" and "False". - :vartype is_monitoring_enabled: str or - ~azure.mgmt.managednetworkfabric.models.IsMonitoringEnabled - :ivar bgp_configuration: BGP configuration properties. - :vartype bgp_configuration: ~azure.mgmt.managednetworkfabric.models.BgpConfiguration - :ivar static_route_configuration: Static Route Configuration properties. - :vartype static_route_configuration: - ~azure.mgmt.managednetworkfabric.models.StaticRouteConfiguration - """ - - _validation = { - "mtu": {"maximum": 9200, "minimum": 64}, - "connected_i_pv4_subnets": {"min_items": 1}, - "connected_i_pv6_subnets": {"min_items": 1}, - } - - _attribute_map = { - "annotation": {"key": "properties.annotation", "type": "str"}, - "mtu": {"key": "properties.mtu", "type": "int"}, - "connected_i_pv4_subnets": {"key": "properties.connectedIPv4Subnets", "type": "[ConnectedSubnet]"}, - "connected_i_pv6_subnets": {"key": "properties.connectedIPv6Subnets", "type": "[ConnectedSubnet]"}, - "import_route_policy_id": {"key": "properties.importRoutePolicyId", "type": "str"}, - "export_route_policy_id": {"key": "properties.exportRoutePolicyId", "type": "str"}, - "import_route_policy": {"key": "properties.importRoutePolicy", "type": "ImportRoutePolicy"}, - "export_route_policy": {"key": "properties.exportRoutePolicy", "type": "ExportRoutePolicy"}, - "ingress_acl_id": {"key": "properties.ingressAclId", "type": "str"}, - "egress_acl_id": {"key": "properties.egressAclId", "type": "str"}, - "is_monitoring_enabled": {"key": "properties.isMonitoringEnabled", "type": "str"}, - "bgp_configuration": {"key": "properties.bgpConfiguration", "type": "BgpConfiguration"}, - "static_route_configuration": { - "key": "properties.staticRouteConfiguration", - "type": "StaticRouteConfiguration", - }, - } - - def __init__( - self, - *, - annotation: Optional[str] = None, - mtu: int = 1500, - connected_i_pv4_subnets: Optional[List["_models.ConnectedSubnet"]] = None, - connected_i_pv6_subnets: Optional[List["_models.ConnectedSubnet"]] = None, - import_route_policy_id: Optional[str] = None, - export_route_policy_id: Optional[str] = None, - import_route_policy: Optional["_models.ImportRoutePolicy"] = None, - export_route_policy: Optional["_models.ExportRoutePolicy"] = None, - ingress_acl_id: Optional[str] = None, - egress_acl_id: Optional[str] = None, - is_monitoring_enabled: Union[str, "_models.IsMonitoringEnabled"] = "False", - bgp_configuration: Optional["_models.BgpConfiguration"] = None, - static_route_configuration: Optional["_models.StaticRouteConfiguration"] = None, - **kwargs: Any - ) -> None: - """ - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword mtu: Maximum transmission unit. Default value is 1500. - :paramtype mtu: int - :keyword connected_i_pv4_subnets: List of Connected IPv4 Subnets. - :paramtype connected_i_pv4_subnets: - list[~azure.mgmt.managednetworkfabric.models.ConnectedSubnet] - :keyword connected_i_pv6_subnets: List of connected IPv6 Subnets. - :paramtype connected_i_pv6_subnets: - list[~azure.mgmt.managednetworkfabric.models.ConnectedSubnet] - :keyword import_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the - backward compatibility. - :paramtype import_route_policy_id: str - :keyword export_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the - backward compatibility. - :paramtype export_route_policy_id: str - :keyword import_route_policy: Import Route Policy either IPv4 or IPv6. - :paramtype import_route_policy: ~azure.mgmt.managednetworkfabric.models.ImportRoutePolicy - :keyword export_route_policy: Export Route Policy either IPv4 or IPv6. - :paramtype export_route_policy: ~azure.mgmt.managednetworkfabric.models.ExportRoutePolicy - :keyword ingress_acl_id: Ingress Acl. ARM resource ID of Access Control Lists. - :paramtype ingress_acl_id: str - :keyword egress_acl_id: Egress Acl. ARM resource ID of Access Control Lists. - :paramtype egress_acl_id: str - :keyword is_monitoring_enabled: To check whether monitoring of internal network is enabled or - not. Known values are: "True" and "False". - :paramtype is_monitoring_enabled: str or - ~azure.mgmt.managednetworkfabric.models.IsMonitoringEnabled - :keyword bgp_configuration: BGP configuration properties. - :paramtype bgp_configuration: ~azure.mgmt.managednetworkfabric.models.BgpConfiguration - :keyword static_route_configuration: Static Route Configuration properties. - :paramtype static_route_configuration: - ~azure.mgmt.managednetworkfabric.models.StaticRouteConfiguration - """ - super().__init__(**kwargs) - self.annotation = annotation - self.mtu = mtu - self.connected_i_pv4_subnets = connected_i_pv4_subnets - self.connected_i_pv6_subnets = connected_i_pv6_subnets - self.import_route_policy_id = import_route_policy_id - self.export_route_policy_id = export_route_policy_id - self.import_route_policy = import_route_policy - self.export_route_policy = export_route_policy - self.ingress_acl_id = ingress_acl_id - self.egress_acl_id = egress_acl_id - self.is_monitoring_enabled = is_monitoring_enabled - self.bgp_configuration = bgp_configuration - self.static_route_configuration = static_route_configuration - - -class InternalNetworkPatchableProperties(_serialization.Model): - """The InternalNetwork patchable properties. - - :ivar mtu: Maximum transmission unit. Default value is 1500. - :vartype mtu: int - :ivar connected_i_pv4_subnets: List of Connected IPv4 Subnets. - :vartype connected_i_pv4_subnets: list[~azure.mgmt.managednetworkfabric.models.ConnectedSubnet] - :ivar connected_i_pv6_subnets: List of connected IPv6 Subnets. - :vartype connected_i_pv6_subnets: list[~azure.mgmt.managednetworkfabric.models.ConnectedSubnet] - :ivar import_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the backward - compatibility. - :vartype import_route_policy_id: str - :ivar export_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the backward - compatibility. - :vartype export_route_policy_id: str - :ivar import_route_policy: Import Route Policy either IPv4 or IPv6. - :vartype import_route_policy: ~azure.mgmt.managednetworkfabric.models.ImportRoutePolicy - :ivar export_route_policy: Export Route Policy either IPv4 or IPv6. - :vartype export_route_policy: ~azure.mgmt.managednetworkfabric.models.ExportRoutePolicy - :ivar ingress_acl_id: Ingress Acl. ARM resource ID of Access Control Lists. - :vartype ingress_acl_id: str - :ivar egress_acl_id: Egress Acl. ARM resource ID of Access Control Lists. - :vartype egress_acl_id: str - :ivar is_monitoring_enabled: To check whether monitoring of internal network is enabled or not. - Known values are: "True" and "False". - :vartype is_monitoring_enabled: str or - ~azure.mgmt.managednetworkfabric.models.IsMonitoringEnabled - """ - - _validation = { - "mtu": {"maximum": 9200, "minimum": 64}, - "connected_i_pv4_subnets": {"min_items": 1}, - "connected_i_pv6_subnets": {"min_items": 1}, - } - - _attribute_map = { - "mtu": {"key": "mtu", "type": "int"}, - "connected_i_pv4_subnets": {"key": "connectedIPv4Subnets", "type": "[ConnectedSubnet]"}, - "connected_i_pv6_subnets": {"key": "connectedIPv6Subnets", "type": "[ConnectedSubnet]"}, - "import_route_policy_id": {"key": "importRoutePolicyId", "type": "str"}, - "export_route_policy_id": {"key": "exportRoutePolicyId", "type": "str"}, - "import_route_policy": {"key": "importRoutePolicy", "type": "ImportRoutePolicy"}, - "export_route_policy": {"key": "exportRoutePolicy", "type": "ExportRoutePolicy"}, - "ingress_acl_id": {"key": "ingressAclId", "type": "str"}, - "egress_acl_id": {"key": "egressAclId", "type": "str"}, - "is_monitoring_enabled": {"key": "isMonitoringEnabled", "type": "str"}, - } - - def __init__( - self, - *, - mtu: int = 1500, - connected_i_pv4_subnets: Optional[List["_models.ConnectedSubnet"]] = None, - connected_i_pv6_subnets: Optional[List["_models.ConnectedSubnet"]] = None, - import_route_policy_id: Optional[str] = None, - export_route_policy_id: Optional[str] = None, - import_route_policy: Optional["_models.ImportRoutePolicy"] = None, - export_route_policy: Optional["_models.ExportRoutePolicy"] = None, - ingress_acl_id: Optional[str] = None, - egress_acl_id: Optional[str] = None, - is_monitoring_enabled: Union[str, "_models.IsMonitoringEnabled"] = "False", - **kwargs: Any - ) -> None: - """ - :keyword mtu: Maximum transmission unit. Default value is 1500. - :paramtype mtu: int - :keyword connected_i_pv4_subnets: List of Connected IPv4 Subnets. - :paramtype connected_i_pv4_subnets: - list[~azure.mgmt.managednetworkfabric.models.ConnectedSubnet] - :keyword connected_i_pv6_subnets: List of connected IPv6 Subnets. - :paramtype connected_i_pv6_subnets: - list[~azure.mgmt.managednetworkfabric.models.ConnectedSubnet] - :keyword import_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the - backward compatibility. - :paramtype import_route_policy_id: str - :keyword export_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the - backward compatibility. - :paramtype export_route_policy_id: str - :keyword import_route_policy: Import Route Policy either IPv4 or IPv6. - :paramtype import_route_policy: ~azure.mgmt.managednetworkfabric.models.ImportRoutePolicy - :keyword export_route_policy: Export Route Policy either IPv4 or IPv6. - :paramtype export_route_policy: ~azure.mgmt.managednetworkfabric.models.ExportRoutePolicy - :keyword ingress_acl_id: Ingress Acl. ARM resource ID of Access Control Lists. - :paramtype ingress_acl_id: str - :keyword egress_acl_id: Egress Acl. ARM resource ID of Access Control Lists. - :paramtype egress_acl_id: str - :keyword is_monitoring_enabled: To check whether monitoring of internal network is enabled or - not. Known values are: "True" and "False". - :paramtype is_monitoring_enabled: str or - ~azure.mgmt.managednetworkfabric.models.IsMonitoringEnabled - """ - super().__init__(**kwargs) - self.mtu = mtu - self.connected_i_pv4_subnets = connected_i_pv4_subnets - self.connected_i_pv6_subnets = connected_i_pv6_subnets - self.import_route_policy_id = import_route_policy_id - self.export_route_policy_id = export_route_policy_id - self.import_route_policy = import_route_policy - self.export_route_policy = export_route_policy - self.ingress_acl_id = ingress_acl_id - self.egress_acl_id = egress_acl_id - self.is_monitoring_enabled = is_monitoring_enabled - - -class InternalNetworkPatchProperties( - AnnotationResource, InternalNetworkPatchableProperties -): # pylint: disable=too-many-instance-attributes - """InternalNetwork Patch properties. - - :ivar mtu: Maximum transmission unit. Default value is 1500. - :vartype mtu: int - :ivar connected_i_pv4_subnets: List of Connected IPv4 Subnets. - :vartype connected_i_pv4_subnets: list[~azure.mgmt.managednetworkfabric.models.ConnectedSubnet] - :ivar connected_i_pv6_subnets: List of connected IPv6 Subnets. - :vartype connected_i_pv6_subnets: list[~azure.mgmt.managednetworkfabric.models.ConnectedSubnet] - :ivar import_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the backward - compatibility. - :vartype import_route_policy_id: str - :ivar export_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the backward - compatibility. - :vartype export_route_policy_id: str - :ivar import_route_policy: Import Route Policy either IPv4 or IPv6. - :vartype import_route_policy: ~azure.mgmt.managednetworkfabric.models.ImportRoutePolicy - :ivar export_route_policy: Export Route Policy either IPv4 or IPv6. - :vartype export_route_policy: ~azure.mgmt.managednetworkfabric.models.ExportRoutePolicy - :ivar ingress_acl_id: Ingress Acl. ARM resource ID of Access Control Lists. - :vartype ingress_acl_id: str - :ivar egress_acl_id: Egress Acl. ARM resource ID of Access Control Lists. - :vartype egress_acl_id: str - :ivar is_monitoring_enabled: To check whether monitoring of internal network is enabled or not. - Known values are: "True" and "False". - :vartype is_monitoring_enabled: str or - ~azure.mgmt.managednetworkfabric.models.IsMonitoringEnabled - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar bgp_configuration: BGP configuration properties. - :vartype bgp_configuration: ~azure.mgmt.managednetworkfabric.models.BgpConfiguration - :ivar static_route_configuration: Static Route Configuration properties. - :vartype static_route_configuration: - ~azure.mgmt.managednetworkfabric.models.StaticRouteConfiguration - """ - - _validation = { - "mtu": {"maximum": 9200, "minimum": 64}, - "connected_i_pv4_subnets": {"min_items": 1}, - "connected_i_pv6_subnets": {"min_items": 1}, - } - - _attribute_map = { - "mtu": {"key": "mtu", "type": "int"}, - "connected_i_pv4_subnets": {"key": "connectedIPv4Subnets", "type": "[ConnectedSubnet]"}, - "connected_i_pv6_subnets": {"key": "connectedIPv6Subnets", "type": "[ConnectedSubnet]"}, - "import_route_policy_id": {"key": "importRoutePolicyId", "type": "str"}, - "export_route_policy_id": {"key": "exportRoutePolicyId", "type": "str"}, - "import_route_policy": {"key": "importRoutePolicy", "type": "ImportRoutePolicy"}, - "export_route_policy": {"key": "exportRoutePolicy", "type": "ExportRoutePolicy"}, - "ingress_acl_id": {"key": "ingressAclId", "type": "str"}, - "egress_acl_id": {"key": "egressAclId", "type": "str"}, - "is_monitoring_enabled": {"key": "isMonitoringEnabled", "type": "str"}, - "annotation": {"key": "annotation", "type": "str"}, - "bgp_configuration": {"key": "bgpConfiguration", "type": "BgpConfiguration"}, - "static_route_configuration": {"key": "staticRouteConfiguration", "type": "StaticRouteConfiguration"}, - } - - def __init__( - self, - *, - mtu: int = 1500, - connected_i_pv4_subnets: Optional[List["_models.ConnectedSubnet"]] = None, - connected_i_pv6_subnets: Optional[List["_models.ConnectedSubnet"]] = None, - import_route_policy_id: Optional[str] = None, - export_route_policy_id: Optional[str] = None, - import_route_policy: Optional["_models.ImportRoutePolicy"] = None, - export_route_policy: Optional["_models.ExportRoutePolicy"] = None, - ingress_acl_id: Optional[str] = None, - egress_acl_id: Optional[str] = None, - is_monitoring_enabled: Union[str, "_models.IsMonitoringEnabled"] = "False", - annotation: Optional[str] = None, - bgp_configuration: Optional["_models.BgpConfiguration"] = None, - static_route_configuration: Optional["_models.StaticRouteConfiguration"] = None, - **kwargs: Any - ) -> None: - """ - :keyword mtu: Maximum transmission unit. Default value is 1500. - :paramtype mtu: int - :keyword connected_i_pv4_subnets: List of Connected IPv4 Subnets. - :paramtype connected_i_pv4_subnets: - list[~azure.mgmt.managednetworkfabric.models.ConnectedSubnet] - :keyword connected_i_pv6_subnets: List of connected IPv6 Subnets. - :paramtype connected_i_pv6_subnets: - list[~azure.mgmt.managednetworkfabric.models.ConnectedSubnet] - :keyword import_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the - backward compatibility. - :paramtype import_route_policy_id: str - :keyword export_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the - backward compatibility. - :paramtype export_route_policy_id: str - :keyword import_route_policy: Import Route Policy either IPv4 or IPv6. - :paramtype import_route_policy: ~azure.mgmt.managednetworkfabric.models.ImportRoutePolicy - :keyword export_route_policy: Export Route Policy either IPv4 or IPv6. - :paramtype export_route_policy: ~azure.mgmt.managednetworkfabric.models.ExportRoutePolicy - :keyword ingress_acl_id: Ingress Acl. ARM resource ID of Access Control Lists. - :paramtype ingress_acl_id: str - :keyword egress_acl_id: Egress Acl. ARM resource ID of Access Control Lists. - :paramtype egress_acl_id: str - :keyword is_monitoring_enabled: To check whether monitoring of internal network is enabled or - not. Known values are: "True" and "False". - :paramtype is_monitoring_enabled: str or - ~azure.mgmt.managednetworkfabric.models.IsMonitoringEnabled - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword bgp_configuration: BGP configuration properties. - :paramtype bgp_configuration: ~azure.mgmt.managednetworkfabric.models.BgpConfiguration - :keyword static_route_configuration: Static Route Configuration properties. - :paramtype static_route_configuration: - ~azure.mgmt.managednetworkfabric.models.StaticRouteConfiguration - """ - super().__init__( - annotation=annotation, - mtu=mtu, - connected_i_pv4_subnets=connected_i_pv4_subnets, - connected_i_pv6_subnets=connected_i_pv6_subnets, - import_route_policy_id=import_route_policy_id, - export_route_policy_id=export_route_policy_id, - import_route_policy=import_route_policy, - export_route_policy=export_route_policy, - ingress_acl_id=ingress_acl_id, - egress_acl_id=egress_acl_id, - is_monitoring_enabled=is_monitoring_enabled, - **kwargs - ) - self.mtu = mtu - self.connected_i_pv4_subnets = connected_i_pv4_subnets - self.connected_i_pv6_subnets = connected_i_pv6_subnets - self.import_route_policy_id = import_route_policy_id - self.export_route_policy_id = export_route_policy_id - self.import_route_policy = import_route_policy - self.export_route_policy = export_route_policy - self.ingress_acl_id = ingress_acl_id - self.egress_acl_id = egress_acl_id - self.is_monitoring_enabled = is_monitoring_enabled - self.bgp_configuration = bgp_configuration - self.static_route_configuration = static_route_configuration - self.annotation = annotation - - -class InternalNetworkProperties( - AnnotationResource, InternalNetworkPatchableProperties, ExtensionEnumProperty -): # pylint: disable=too-many-instance-attributes - """Internal Network Properties defines the properties of the 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 Azure. - - :ivar extension: Extension. Example: NoExtension | NPB. Known values are: "NoExtension" and - "NPB". - :vartype extension: str or ~azure.mgmt.managednetworkfabric.models.Extension - :ivar mtu: Maximum transmission unit. Default value is 1500. - :vartype mtu: int - :ivar connected_i_pv4_subnets: List of Connected IPv4 Subnets. - :vartype connected_i_pv4_subnets: list[~azure.mgmt.managednetworkfabric.models.ConnectedSubnet] - :ivar connected_i_pv6_subnets: List of connected IPv6 Subnets. - :vartype connected_i_pv6_subnets: list[~azure.mgmt.managednetworkfabric.models.ConnectedSubnet] - :ivar import_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the backward - compatibility. - :vartype import_route_policy_id: str - :ivar export_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the backward - compatibility. - :vartype export_route_policy_id: str - :ivar import_route_policy: Import Route Policy either IPv4 or IPv6. - :vartype import_route_policy: ~azure.mgmt.managednetworkfabric.models.ImportRoutePolicy - :ivar export_route_policy: Export Route Policy either IPv4 or IPv6. - :vartype export_route_policy: ~azure.mgmt.managednetworkfabric.models.ExportRoutePolicy - :ivar ingress_acl_id: Ingress Acl. ARM resource ID of Access Control Lists. - :vartype ingress_acl_id: str - :ivar egress_acl_id: Egress Acl. ARM resource ID of Access Control Lists. - :vartype egress_acl_id: str - :ivar is_monitoring_enabled: To check whether monitoring of internal network is enabled or not. - Known values are: "True" and "False". - :vartype is_monitoring_enabled: str or - ~azure.mgmt.managednetworkfabric.models.IsMonitoringEnabled - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar vlan_id: Vlan identifier. Example: 1001. Required. - :vartype vlan_id: int - :ivar bgp_configuration: BGP configuration properties. - :vartype bgp_configuration: - ~azure.mgmt.managednetworkfabric.models.InternalNetworkPropertiesBgpConfiguration - :ivar static_route_configuration: Static Route Configuration properties. - :vartype static_route_configuration: - ~azure.mgmt.managednetworkfabric.models.InternalNetworkPropertiesStaticRouteConfiguration - :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", - "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", - "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", - "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.AdministrativeState - """ - - _validation = { - "mtu": {"maximum": 9200, "minimum": 64}, - "connected_i_pv4_subnets": {"min_items": 1}, - "connected_i_pv6_subnets": {"min_items": 1}, - "vlan_id": {"required": True, "maximum": 4094, "minimum": 100}, - "configuration_state": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "administrative_state": {"readonly": True}, - } - - _attribute_map = { - "extension": {"key": "extension", "type": "str"}, - "mtu": {"key": "mtu", "type": "int"}, - "connected_i_pv4_subnets": {"key": "connectedIPv4Subnets", "type": "[ConnectedSubnet]"}, - "connected_i_pv6_subnets": {"key": "connectedIPv6Subnets", "type": "[ConnectedSubnet]"}, - "import_route_policy_id": {"key": "importRoutePolicyId", "type": "str"}, - "export_route_policy_id": {"key": "exportRoutePolicyId", "type": "str"}, - "import_route_policy": {"key": "importRoutePolicy", "type": "ImportRoutePolicy"}, - "export_route_policy": {"key": "exportRoutePolicy", "type": "ExportRoutePolicy"}, - "ingress_acl_id": {"key": "ingressAclId", "type": "str"}, - "egress_acl_id": {"key": "egressAclId", "type": "str"}, - "is_monitoring_enabled": {"key": "isMonitoringEnabled", "type": "str"}, - "annotation": {"key": "annotation", "type": "str"}, - "vlan_id": {"key": "vlanId", "type": "int"}, - "bgp_configuration": {"key": "bgpConfiguration", "type": "InternalNetworkPropertiesBgpConfiguration"}, - "static_route_configuration": { - "key": "staticRouteConfiguration", - "type": "InternalNetworkPropertiesStaticRouteConfiguration", - }, - "configuration_state": {"key": "configurationState", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "administrative_state": {"key": "administrativeState", "type": "str"}, - } - - def __init__( - self, - *, - vlan_id: int, - extension: Union[str, "_models.Extension"] = "NoExtension", - mtu: int = 1500, - connected_i_pv4_subnets: Optional[List["_models.ConnectedSubnet"]] = None, - connected_i_pv6_subnets: Optional[List["_models.ConnectedSubnet"]] = None, - import_route_policy_id: Optional[str] = None, - export_route_policy_id: Optional[str] = None, - import_route_policy: Optional["_models.ImportRoutePolicy"] = None, - export_route_policy: Optional["_models.ExportRoutePolicy"] = None, - ingress_acl_id: Optional[str] = None, - egress_acl_id: Optional[str] = None, - is_monitoring_enabled: Union[str, "_models.IsMonitoringEnabled"] = "False", - annotation: Optional[str] = None, - bgp_configuration: Optional["_models.InternalNetworkPropertiesBgpConfiguration"] = None, - static_route_configuration: Optional["_models.InternalNetworkPropertiesStaticRouteConfiguration"] = None, - **kwargs: Any - ) -> None: - """ - :keyword extension: Extension. Example: NoExtension | NPB. Known values are: "NoExtension" and - "NPB". - :paramtype extension: str or ~azure.mgmt.managednetworkfabric.models.Extension - :keyword mtu: Maximum transmission unit. Default value is 1500. - :paramtype mtu: int - :keyword connected_i_pv4_subnets: List of Connected IPv4 Subnets. - :paramtype connected_i_pv4_subnets: - list[~azure.mgmt.managednetworkfabric.models.ConnectedSubnet] - :keyword connected_i_pv6_subnets: List of connected IPv6 Subnets. - :paramtype connected_i_pv6_subnets: - list[~azure.mgmt.managednetworkfabric.models.ConnectedSubnet] - :keyword import_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the - backward compatibility. - :paramtype import_route_policy_id: str - :keyword export_route_policy_id: ARM Resource ID of the RoutePolicy. This is used for the - backward compatibility. - :paramtype export_route_policy_id: str - :keyword import_route_policy: Import Route Policy either IPv4 or IPv6. - :paramtype import_route_policy: ~azure.mgmt.managednetworkfabric.models.ImportRoutePolicy - :keyword export_route_policy: Export Route Policy either IPv4 or IPv6. - :paramtype export_route_policy: ~azure.mgmt.managednetworkfabric.models.ExportRoutePolicy - :keyword ingress_acl_id: Ingress Acl. ARM resource ID of Access Control Lists. - :paramtype ingress_acl_id: str - :keyword egress_acl_id: Egress Acl. ARM resource ID of Access Control Lists. - :paramtype egress_acl_id: str - :keyword is_monitoring_enabled: To check whether monitoring of internal network is enabled or - not. Known values are: "True" and "False". - :paramtype is_monitoring_enabled: str or - ~azure.mgmt.managednetworkfabric.models.IsMonitoringEnabled - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword vlan_id: Vlan identifier. Example: 1001. Required. - :paramtype vlan_id: int - :keyword bgp_configuration: BGP configuration properties. - :paramtype bgp_configuration: - ~azure.mgmt.managednetworkfabric.models.InternalNetworkPropertiesBgpConfiguration - :keyword static_route_configuration: Static Route Configuration properties. - :paramtype static_route_configuration: - ~azure.mgmt.managednetworkfabric.models.InternalNetworkPropertiesStaticRouteConfiguration - """ - super().__init__( - annotation=annotation, - mtu=mtu, - connected_i_pv4_subnets=connected_i_pv4_subnets, - connected_i_pv6_subnets=connected_i_pv6_subnets, - import_route_policy_id=import_route_policy_id, - export_route_policy_id=export_route_policy_id, - import_route_policy=import_route_policy, - export_route_policy=export_route_policy, - ingress_acl_id=ingress_acl_id, - egress_acl_id=egress_acl_id, - is_monitoring_enabled=is_monitoring_enabled, - extension=extension, - **kwargs - ) - self.extension = extension - self.mtu = mtu - self.connected_i_pv4_subnets = connected_i_pv4_subnets - self.connected_i_pv6_subnets = connected_i_pv6_subnets - self.import_route_policy_id = import_route_policy_id - self.export_route_policy_id = export_route_policy_id - self.import_route_policy = import_route_policy - self.export_route_policy = export_route_policy - self.ingress_acl_id = ingress_acl_id - self.egress_acl_id = egress_acl_id - self.is_monitoring_enabled = is_monitoring_enabled - self.vlan_id = vlan_id - self.bgp_configuration = bgp_configuration - self.static_route_configuration = static_route_configuration - self.configuration_state = None - self.provisioning_state = None - self.administrative_state = None - self.annotation = annotation - - -class InternalNetworkPropertiesBgpConfiguration(BgpConfiguration): # pylint: disable=too-many-instance-attributes - """BGP configuration properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar bfd_configuration: BFD configuration properties. - :vartype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdConfiguration - :ivar default_route_originate: Originate a defaultRoute. Ex: "True" | "False". Known values - are: "True" and "False". - :vartype default_route_originate: str or - ~azure.mgmt.managednetworkfabric.models.BooleanEnumProperty - :ivar allow_as: Allows for routes to be received and processed even if the router detects its - own ASN in the AS-Path. 0 is disable, Possible values are 1-10, default is 2. - :vartype allow_as: int - :ivar allow_as_override: Enable Or Disable state. Known values are: "Enable" and "Disable". - :vartype allow_as_override: str or ~azure.mgmt.managednetworkfabric.models.AllowASOverride - :ivar fabric_asn: ASN of Network Fabric. Example: 65048. - :vartype fabric_asn: int - :ivar peer_asn: Peer ASN. Example: 65047. - :vartype peer_asn: int - :ivar ipv4_listen_range_prefixes: List of BGP IPv4 Listen Range prefixes. - :vartype ipv4_listen_range_prefixes: list[str] - :ivar ipv6_listen_range_prefixes: List of BGP IPv6 Listen Ranges prefixes. - :vartype ipv6_listen_range_prefixes: list[str] - :ivar ipv4_neighbor_address: List with stringified IPv4 Neighbor Addresses. - :vartype ipv4_neighbor_address: list[~azure.mgmt.managednetworkfabric.models.NeighborAddress] - :ivar ipv6_neighbor_address: List with stringified IPv6 Neighbor Address. - :vartype ipv6_neighbor_address: list[~azure.mgmt.managednetworkfabric.models.NeighborAddress] - """ - - _validation = { - "allow_as": {"maximum": 10, "minimum": 0}, - "fabric_asn": {"readonly": True}, - "peer_asn": {"maximum": 4294967295, "minimum": 1}, - "ipv4_listen_range_prefixes": {"min_items": 1}, - "ipv6_listen_range_prefixes": {"min_items": 1}, - "ipv4_neighbor_address": {"min_items": 1}, - "ipv6_neighbor_address": {"min_items": 1}, - } - - _attribute_map = { - "annotation": {"key": "annotation", "type": "str"}, - "bfd_configuration": {"key": "bfdConfiguration", "type": "BfdConfiguration"}, - "default_route_originate": {"key": "defaultRouteOriginate", "type": "str"}, - "allow_as": {"key": "allowAS", "type": "int"}, - "allow_as_override": {"key": "allowASOverride", "type": "str"}, - "fabric_asn": {"key": "fabricASN", "type": "int"}, - "peer_asn": {"key": "peerASN", "type": "int"}, - "ipv4_listen_range_prefixes": {"key": "ipv4ListenRangePrefixes", "type": "[str]"}, - "ipv6_listen_range_prefixes": {"key": "ipv6ListenRangePrefixes", "type": "[str]"}, - "ipv4_neighbor_address": {"key": "ipv4NeighborAddress", "type": "[NeighborAddress]"}, - "ipv6_neighbor_address": {"key": "ipv6NeighborAddress", "type": "[NeighborAddress]"}, - } - - def __init__( - self, - *, - annotation: Optional[str] = None, - bfd_configuration: Optional["_models.BfdConfiguration"] = None, - default_route_originate: Optional[Union[str, "_models.BooleanEnumProperty"]] = None, - allow_as: int = 2, - allow_as_override: Optional[Union[str, "_models.AllowASOverride"]] = None, - peer_asn: Optional[int] = None, - ipv4_listen_range_prefixes: Optional[List[str]] = None, - ipv6_listen_range_prefixes: Optional[List[str]] = None, - ipv4_neighbor_address: Optional[List["_models.NeighborAddress"]] = None, - ipv6_neighbor_address: Optional[List["_models.NeighborAddress"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword bfd_configuration: BFD configuration properties. - :paramtype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdConfiguration - :keyword default_route_originate: Originate a defaultRoute. Ex: "True" | "False". Known values - are: "True" and "False". - :paramtype default_route_originate: str or - ~azure.mgmt.managednetworkfabric.models.BooleanEnumProperty - :keyword allow_as: Allows for routes to be received and processed even if the router detects - its own ASN in the AS-Path. 0 is disable, Possible values are 1-10, default is 2. - :paramtype allow_as: int - :keyword allow_as_override: Enable Or Disable state. Known values are: "Enable" and "Disable". - :paramtype allow_as_override: str or ~azure.mgmt.managednetworkfabric.models.AllowASOverride - :keyword peer_asn: Peer ASN. Example: 65047. - :paramtype peer_asn: int - :keyword ipv4_listen_range_prefixes: List of BGP IPv4 Listen Range prefixes. - :paramtype ipv4_listen_range_prefixes: list[str] - :keyword ipv6_listen_range_prefixes: List of BGP IPv6 Listen Ranges prefixes. - :paramtype ipv6_listen_range_prefixes: list[str] - :keyword ipv4_neighbor_address: List with stringified IPv4 Neighbor Addresses. - :paramtype ipv4_neighbor_address: list[~azure.mgmt.managednetworkfabric.models.NeighborAddress] - :keyword ipv6_neighbor_address: List with stringified IPv6 Neighbor Address. - :paramtype ipv6_neighbor_address: list[~azure.mgmt.managednetworkfabric.models.NeighborAddress] - """ - super().__init__( - annotation=annotation, - bfd_configuration=bfd_configuration, - default_route_originate=default_route_originate, - allow_as=allow_as, - allow_as_override=allow_as_override, - peer_asn=peer_asn, - ipv4_listen_range_prefixes=ipv4_listen_range_prefixes, - ipv6_listen_range_prefixes=ipv6_listen_range_prefixes, - ipv4_neighbor_address=ipv4_neighbor_address, - ipv6_neighbor_address=ipv6_neighbor_address, - **kwargs - ) - - -class StaticRouteConfiguration(_serialization.Model): - """Static Route Configuration properties. - - :ivar bfd_configuration: BFD configuration properties. - :vartype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdConfiguration - :ivar ipv4_routes: List of IPv4 Routes. - :vartype ipv4_routes: list[~azure.mgmt.managednetworkfabric.models.StaticRouteProperties] - :ivar ipv6_routes: List of IPv6 Routes. - :vartype ipv6_routes: list[~azure.mgmt.managednetworkfabric.models.StaticRouteProperties] - """ - - _validation = { - "ipv4_routes": {"min_items": 1}, - "ipv6_routes": {"min_items": 1}, - } - - _attribute_map = { - "bfd_configuration": {"key": "bfdConfiguration", "type": "BfdConfiguration"}, - "ipv4_routes": {"key": "ipv4Routes", "type": "[StaticRouteProperties]"}, - "ipv6_routes": {"key": "ipv6Routes", "type": "[StaticRouteProperties]"}, - } - - def __init__( - self, - *, - bfd_configuration: Optional["_models.BfdConfiguration"] = None, - ipv4_routes: Optional[List["_models.StaticRouteProperties"]] = None, - ipv6_routes: Optional[List["_models.StaticRouteProperties"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword bfd_configuration: BFD configuration properties. - :paramtype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdConfiguration - :keyword ipv4_routes: List of IPv4 Routes. - :paramtype ipv4_routes: list[~azure.mgmt.managednetworkfabric.models.StaticRouteProperties] - :keyword ipv6_routes: List of IPv6 Routes. - :paramtype ipv6_routes: list[~azure.mgmt.managednetworkfabric.models.StaticRouteProperties] - """ - super().__init__(**kwargs) - self.bfd_configuration = bfd_configuration - self.ipv4_routes = ipv4_routes - self.ipv6_routes = ipv6_routes - - -class InternalNetworkPropertiesStaticRouteConfiguration(StaticRouteConfiguration, ExtensionEnumProperty): - """Static Route Configuration properties. - - :ivar extension: Extension. Example: NoExtension | NPB. Known values are: "NoExtension" and - "NPB". - :vartype extension: str or ~azure.mgmt.managednetworkfabric.models.Extension - :ivar bfd_configuration: BFD configuration properties. - :vartype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdConfiguration - :ivar ipv4_routes: List of IPv4 Routes. - :vartype ipv4_routes: list[~azure.mgmt.managednetworkfabric.models.StaticRouteProperties] - :ivar ipv6_routes: List of IPv6 Routes. - :vartype ipv6_routes: list[~azure.mgmt.managednetworkfabric.models.StaticRouteProperties] - """ - - _validation = { - "ipv4_routes": {"min_items": 1}, - "ipv6_routes": {"min_items": 1}, - } - - _attribute_map = { - "extension": {"key": "extension", "type": "str"}, - "bfd_configuration": {"key": "bfdConfiguration", "type": "BfdConfiguration"}, - "ipv4_routes": {"key": "ipv4Routes", "type": "[StaticRouteProperties]"}, - "ipv6_routes": {"key": "ipv6Routes", "type": "[StaticRouteProperties]"}, - } - - def __init__( - self, - *, - extension: Union[str, "_models.Extension"] = "NoExtension", - bfd_configuration: Optional["_models.BfdConfiguration"] = None, - ipv4_routes: Optional[List["_models.StaticRouteProperties"]] = None, - ipv6_routes: Optional[List["_models.StaticRouteProperties"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword extension: Extension. Example: NoExtension | NPB. Known values are: "NoExtension" and - "NPB". - :paramtype extension: str or ~azure.mgmt.managednetworkfabric.models.Extension - :keyword bfd_configuration: BFD configuration properties. - :paramtype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdConfiguration - :keyword ipv4_routes: List of IPv4 Routes. - :paramtype ipv4_routes: list[~azure.mgmt.managednetworkfabric.models.StaticRouteProperties] - :keyword ipv6_routes: List of IPv6 Routes. - :paramtype ipv6_routes: list[~azure.mgmt.managednetworkfabric.models.StaticRouteProperties] - """ - super().__init__( - bfd_configuration=bfd_configuration, - ipv4_routes=ipv4_routes, - ipv6_routes=ipv6_routes, - extension=extension, - **kwargs - ) - self.extension = extension - self.bfd_configuration = bfd_configuration - self.ipv4_routes = ipv4_routes - self.ipv6_routes = ipv6_routes - - -class InternalNetworksList(_serialization.Model): - """List of Internal Networks. - - :ivar value: List of Internal Network resources. - :vartype value: list[~azure.mgmt.managednetworkfabric.models.InternalNetwork] - :ivar next_link: Url to follow for getting next page of resources. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[InternalNetwork]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: Optional[List["_models.InternalNetwork"]] = None, next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: List of Internal Network resources. - :paramtype value: list[~azure.mgmt.managednetworkfabric.models.InternalNetwork] - :keyword next_link: Url to follow for getting next page of resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class InternetGateway(TrackedResource): # pylint: disable=too-many-instance-attributes - """The Internet Gateway resource definition. - - 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 Azure. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar internet_gateway_rule_id: ARM Resource ID of the Internet Gateway Rule. - :vartype internet_gateway_rule_id: str - :ivar ipv4_address: IPv4 Address of Internet Gateway. - :vartype ipv4_address: str - :ivar port: Port number of Internet Gateway. - :vartype port: int - :ivar type_properties_type: Gateway Type of the resource. Required. Known values are: - "Infrastructure" and "Workload". - :vartype type_properties_type: str or ~azure.mgmt.managednetworkfabric.models.GatewayType - :ivar network_fabric_controller_id: ARM Resource ID of the Network Fabric Controller. Required. - :vartype network_fabric_controller_id: str - :ivar provisioning_state: Provisioning state of resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "ipv4_address": {"readonly": True}, - "port": {"readonly": True}, - "type_properties_type": {"required": True}, - "network_fabric_controller_id": {"required": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "annotation": {"key": "properties.annotation", "type": "str"}, - "internet_gateway_rule_id": {"key": "properties.internetGatewayRuleId", "type": "str"}, - "ipv4_address": {"key": "properties.ipv4Address", "type": "str"}, - "port": {"key": "properties.port", "type": "int"}, - "type_properties_type": {"key": "properties.type", "type": "str"}, - "network_fabric_controller_id": {"key": "properties.networkFabricControllerId", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - } - - def __init__( - self, - *, - location: str, - type_properties_type: Union[str, "_models.GatewayType"], - network_fabric_controller_id: str, - tags: Optional[Dict[str, str]] = None, - annotation: Optional[str] = None, - internet_gateway_rule_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword internet_gateway_rule_id: ARM Resource ID of the Internet Gateway Rule. - :paramtype internet_gateway_rule_id: str - :keyword type_properties_type: Gateway Type of the resource. Required. Known values are: - "Infrastructure" and "Workload". - :paramtype type_properties_type: str or ~azure.mgmt.managednetworkfabric.models.GatewayType - :keyword network_fabric_controller_id: ARM Resource ID of the Network Fabric Controller. - Required. - :paramtype network_fabric_controller_id: str - """ - super().__init__(tags=tags, location=location, **kwargs) - self.annotation = annotation - self.internet_gateway_rule_id = internet_gateway_rule_id - self.ipv4_address = None - self.port = None - self.type_properties_type = type_properties_type - self.network_fabric_controller_id = network_fabric_controller_id - self.provisioning_state = None - - -class InternetGatewayPatch(TagsUpdate): - """The Internet Gateway patch resource definition. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar internet_gateway_rule_id: ARM Resource ID of the Internet Gateway Rule. - :vartype internet_gateway_rule_id: str - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "internet_gateway_rule_id": {"key": "properties.internetGatewayRuleId", "type": "str"}, - } - - def __init__( - self, *, tags: Optional[Dict[str, str]] = None, internet_gateway_rule_id: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword internet_gateway_rule_id: ARM Resource ID of the Internet Gateway Rule. - :paramtype internet_gateway_rule_id: str - """ - super().__init__(tags=tags, **kwargs) - self.internet_gateway_rule_id = internet_gateway_rule_id - - -class InternetGatewayPatchableProperties(_serialization.Model): - """Internet Gateway Patchable Properties defines the patchable properties of the resource. - - :ivar internet_gateway_rule_id: ARM Resource ID of the Internet Gateway Rule. - :vartype internet_gateway_rule_id: str - """ - - _attribute_map = { - "internet_gateway_rule_id": {"key": "internetGatewayRuleId", "type": "str"}, - } - - def __init__(self, *, internet_gateway_rule_id: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword internet_gateway_rule_id: ARM Resource ID of the Internet Gateway Rule. - :paramtype internet_gateway_rule_id: str - """ - super().__init__(**kwargs) - self.internet_gateway_rule_id = internet_gateway_rule_id - - -class InternetGatewayProperties(AnnotationResource, InternetGatewayPatchableProperties): - """Internet Gateway Properties defines the properties of the 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 Azure. - - :ivar internet_gateway_rule_id: ARM Resource ID of the Internet Gateway Rule. - :vartype internet_gateway_rule_id: str - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar ipv4_address: IPv4 Address of Internet Gateway. - :vartype ipv4_address: str - :ivar port: Port number of Internet Gateway. - :vartype port: int - :ivar type: Gateway Type of the resource. Required. Known values are: "Infrastructure" and - "Workload". - :vartype type: str or ~azure.mgmt.managednetworkfabric.models.GatewayType - :ivar network_fabric_controller_id: ARM Resource ID of the Network Fabric Controller. Required. - :vartype network_fabric_controller_id: str - :ivar provisioning_state: Provisioning state of resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - """ - - _validation = { - "ipv4_address": {"readonly": True}, - "port": {"readonly": True}, - "type": {"required": True}, - "network_fabric_controller_id": {"required": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "internet_gateway_rule_id": {"key": "internetGatewayRuleId", "type": "str"}, - "annotation": {"key": "annotation", "type": "str"}, - "ipv4_address": {"key": "ipv4Address", "type": "str"}, - "port": {"key": "port", "type": "int"}, - "type": {"key": "type", "type": "str"}, - "network_fabric_controller_id": {"key": "networkFabricControllerId", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - } - - def __init__( - self, - *, - type: Union[str, "_models.GatewayType"], - network_fabric_controller_id: str, - internet_gateway_rule_id: Optional[str] = None, - annotation: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword internet_gateway_rule_id: ARM Resource ID of the Internet Gateway Rule. - :paramtype internet_gateway_rule_id: str - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword type: Gateway Type of the resource. Required. Known values are: "Infrastructure" and - "Workload". - :paramtype type: str or ~azure.mgmt.managednetworkfabric.models.GatewayType - :keyword network_fabric_controller_id: ARM Resource ID of the Network Fabric Controller. - Required. - :paramtype network_fabric_controller_id: str - """ - super().__init__(annotation=annotation, internet_gateway_rule_id=internet_gateway_rule_id, **kwargs) - self.internet_gateway_rule_id = internet_gateway_rule_id - self.ipv4_address = None - self.port = None - self.type = type - self.network_fabric_controller_id = network_fabric_controller_id - self.provisioning_state = None - self.annotation = annotation - - -class InternetGatewayRule(TrackedResource): - """The Internet Gateway Rule resource definition. - - 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 Azure. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar rule_properties: Rules for the InternetGateways. Required. - :vartype rule_properties: ~azure.mgmt.managednetworkfabric.models.RuleProperties - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar internet_gateway_ids: List of Internet Gateway resource Id. - :vartype internet_gateway_ids: list[str] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "rule_properties": {"required": True}, - "provisioning_state": {"readonly": True}, - "internet_gateway_ids": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "annotation": {"key": "properties.annotation", "type": "str"}, - "rule_properties": {"key": "properties.ruleProperties", "type": "RuleProperties"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "internet_gateway_ids": {"key": "properties.internetGatewayIds", "type": "[str]"}, - } - - def __init__( - self, - *, - location: str, - rule_properties: "_models.RuleProperties", - tags: Optional[Dict[str, str]] = None, - annotation: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword rule_properties: Rules for the InternetGateways. Required. - :paramtype rule_properties: ~azure.mgmt.managednetworkfabric.models.RuleProperties - """ - super().__init__(tags=tags, location=location, **kwargs) - self.annotation = annotation - self.rule_properties = rule_properties - self.provisioning_state = None - self.internet_gateway_ids = None - - -class InternetGatewayRulePatch(TagsUpdate): - """The Internet Gateway Rules patch resource definition. - - :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__(tags=tags, **kwargs) - - -class InternetGatewayRuleProperties(AnnotationResource): - """Internet Gateway Rule Properties defines the resource properties. - - 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 Azure. - - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar rule_properties: Rules for the InternetGateways. Required. - :vartype rule_properties: ~azure.mgmt.managednetworkfabric.models.RuleProperties - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar internet_gateway_ids: List of Internet Gateway resource Id. - :vartype internet_gateway_ids: list[str] - """ - - _validation = { - "rule_properties": {"required": True}, - "provisioning_state": {"readonly": True}, - "internet_gateway_ids": {"readonly": True}, - } - - _attribute_map = { - "annotation": {"key": "annotation", "type": "str"}, - "rule_properties": {"key": "ruleProperties", "type": "RuleProperties"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "internet_gateway_ids": {"key": "internetGatewayIds", "type": "[str]"}, - } - - def __init__( - self, *, rule_properties: "_models.RuleProperties", annotation: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword rule_properties: Rules for the InternetGateways. Required. - :paramtype rule_properties: ~azure.mgmt.managednetworkfabric.models.RuleProperties - """ - super().__init__(annotation=annotation, **kwargs) - self.rule_properties = rule_properties - self.provisioning_state = None - self.internet_gateway_ids = None - - -class InternetGatewayRulesListResult(_serialization.Model): - """List of Internet Gateway Rules. - - :ivar value: List of Internet Gateway Rule resources. - :vartype value: list[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] - :ivar next_link: Url to follow for getting next page of resources. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[InternetGatewayRule]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, - *, - value: Optional[List["_models.InternetGatewayRule"]] = None, - next_link: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword value: List of Internet Gateway Rule resources. - :paramtype value: list[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] - :keyword next_link: Url to follow for getting next page of resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class InternetGatewaysListResult(_serialization.Model): - """List of InternetGateways. - - :ivar value: Displays list of Internet Gateway resources. - :vartype value: list[~azure.mgmt.managednetworkfabric.models.InternetGateway] - :ivar next_link: Url to follow for getting next page of resources. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[InternetGateway]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: Optional[List["_models.InternetGateway"]] = None, next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: Displays list of Internet Gateway resources. - :paramtype value: list[~azure.mgmt.managednetworkfabric.models.InternetGateway] - :keyword next_link: Url to follow for getting next page of resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class IpCommunitiesListResult(_serialization.Model): - """List of IP Communities. - - :ivar value: List of IP Community resources. - :vartype value: list[~azure.mgmt.managednetworkfabric.models.IpCommunity] - :ivar next_link: Url to follow for getting next page of resources. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[IpCommunity]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: Optional[List["_models.IpCommunity"]] = None, next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: List of IP Community resources. - :paramtype value: list[~azure.mgmt.managednetworkfabric.models.IpCommunity] - :keyword next_link: Url to follow for getting next page of resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class IpCommunity(TrackedResource): # pylint: disable=too-many-instance-attributes - """The IP Community resource definition. - - 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 Azure. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar ip_community_rules: List of IP Community Rules. - :vartype ip_community_rules: list[~azure.mgmt.managednetworkfabric.models.IpCommunityRule] - :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", - "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", - "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", - "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.AdministrativeState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "configuration_state": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "administrative_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "annotation": {"key": "properties.annotation", "type": "str"}, - "ip_community_rules": {"key": "properties.ipCommunityRules", "type": "[IpCommunityRule]"}, - "configuration_state": {"key": "properties.configurationState", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "administrative_state": {"key": "properties.administrativeState", "type": "str"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - annotation: Optional[str] = None, - ip_community_rules: Optional[List["_models.IpCommunityRule"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword ip_community_rules: List of IP Community Rules. - :paramtype ip_community_rules: list[~azure.mgmt.managednetworkfabric.models.IpCommunityRule] - """ - super().__init__(tags=tags, location=location, **kwargs) - self.annotation = annotation - self.ip_community_rules = ip_community_rules - self.configuration_state = None - self.provisioning_state = None - self.administrative_state = None - - -class IpCommunityIdList(_serialization.Model): - """IP Community ID list properties. - - :ivar ip_community_ids: List of IP Community resource IDs. - :vartype ip_community_ids: list[str] - """ - - _attribute_map = { - "ip_community_ids": {"key": "ipCommunityIds", "type": "[str]"}, - } - - def __init__(self, *, ip_community_ids: Optional[List[str]] = None, **kwargs: Any) -> None: - """ - :keyword ip_community_ids: List of IP Community resource IDs. - :paramtype ip_community_ids: list[str] - """ - super().__init__(**kwargs) - self.ip_community_ids = ip_community_ids - - -class IpCommunityPatch(TagsUpdate): - """The IP Community patch resource definition. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar ip_community_rules: List of IP Community Rules. - :vartype ip_community_rules: list[~azure.mgmt.managednetworkfabric.models.IpCommunityRule] - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "ip_community_rules": {"key": "properties.ipCommunityRules", "type": "[IpCommunityRule]"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - ip_community_rules: Optional[List["_models.IpCommunityRule"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword ip_community_rules: List of IP Community Rules. - :paramtype ip_community_rules: list[~azure.mgmt.managednetworkfabric.models.IpCommunityRule] - """ - super().__init__(tags=tags, **kwargs) - self.ip_community_rules = ip_community_rules - - -class IpCommunityPatchableProperties(_serialization.Model): - """IP Community patchable properties. - - :ivar ip_community_rules: List of IP Community Rules. - :vartype ip_community_rules: list[~azure.mgmt.managednetworkfabric.models.IpCommunityRule] - """ - - _attribute_map = { - "ip_community_rules": {"key": "ipCommunityRules", "type": "[IpCommunityRule]"}, - } - - def __init__(self, *, ip_community_rules: Optional[List["_models.IpCommunityRule"]] = None, **kwargs: Any) -> None: - """ - :keyword ip_community_rules: List of IP Community Rules. - :paramtype ip_community_rules: list[~azure.mgmt.managednetworkfabric.models.IpCommunityRule] - """ - super().__init__(**kwargs) - self.ip_community_rules = ip_community_rules - - -class IpCommunityProperties(AnnotationResource, IpCommunityPatchableProperties): - """IP Community Properties defines the resource properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar ip_community_rules: List of IP Community Rules. - :vartype ip_community_rules: list[~azure.mgmt.managednetworkfabric.models.IpCommunityRule] - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", - "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", - "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", - "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.AdministrativeState - """ - - _validation = { - "configuration_state": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "administrative_state": {"readonly": True}, - } - - _attribute_map = { - "ip_community_rules": {"key": "ipCommunityRules", "type": "[IpCommunityRule]"}, - "annotation": {"key": "annotation", "type": "str"}, - "configuration_state": {"key": "configurationState", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "administrative_state": {"key": "administrativeState", "type": "str"}, - } - - def __init__( - self, - *, - ip_community_rules: Optional[List["_models.IpCommunityRule"]] = None, - annotation: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword ip_community_rules: List of IP Community Rules. - :paramtype ip_community_rules: list[~azure.mgmt.managednetworkfabric.models.IpCommunityRule] - :keyword annotation: Switch configuration description. - :paramtype annotation: str - """ - super().__init__(annotation=annotation, ip_community_rules=ip_community_rules, **kwargs) - self.ip_community_rules = ip_community_rules - self.configuration_state = None - self.provisioning_state = None - self.administrative_state = None - self.annotation = annotation - - -class IpCommunityRule(_serialization.Model): - """IP Community patchable properties. - - All required parameters must be populated in order to send to Azure. - - :ivar action: Action to be taken on the configuration. Example: Permit | Deny. Required. Known - values are: "Permit" and "Deny". - :vartype action: str or ~azure.mgmt.managednetworkfabric.models.CommunityActionTypes - :ivar sequence_number: Sequence to insert to/delete from existing route. Prefix lists are - evaluated starting with the lowest sequence number and continue down the list until a match is - made. Once a match is made, the permit or deny statement is applied to that network and the - rest of the list is ignored. Required. - :vartype sequence_number: int - :ivar well_known_communities: Supported well known Community List. - :vartype well_known_communities: list[str or - ~azure.mgmt.managednetworkfabric.models.WellKnownCommunities] - :ivar community_members: List the community members of IP Community. Required. - :vartype community_members: list[str] - """ - - _validation = { - "action": {"required": True}, - "sequence_number": {"required": True, "maximum": 4294967295, "minimum": 1}, - "well_known_communities": {"unique": True}, - "community_members": {"required": True, "min_items": 1}, - } - - _attribute_map = { - "action": {"key": "action", "type": "str"}, - "sequence_number": {"key": "sequenceNumber", "type": "int"}, - "well_known_communities": {"key": "wellKnownCommunities", "type": "[str]"}, - "community_members": {"key": "communityMembers", "type": "[str]"}, - } - - def __init__( - self, - *, - action: Union[str, "_models.CommunityActionTypes"], - sequence_number: int, - community_members: List[str], - well_known_communities: Optional[List[Union[str, "_models.WellKnownCommunities"]]] = None, - **kwargs: Any - ) -> None: - """ - :keyword action: Action to be taken on the configuration. Example: Permit | Deny. Required. - Known values are: "Permit" and "Deny". - :paramtype action: str or ~azure.mgmt.managednetworkfabric.models.CommunityActionTypes - :keyword sequence_number: Sequence to insert to/delete from existing route. Prefix lists are - evaluated starting with the lowest sequence number and continue down the list until a match is - made. Once a match is made, the permit or deny statement is applied to that network and the - rest of the list is ignored. Required. - :paramtype sequence_number: int - :keyword well_known_communities: Supported well known Community List. - :paramtype well_known_communities: list[str or - ~azure.mgmt.managednetworkfabric.models.WellKnownCommunities] - :keyword community_members: List the community members of IP Community. Required. - :paramtype community_members: list[str] - """ - super().__init__(**kwargs) - self.action = action - self.sequence_number = sequence_number - self.well_known_communities = well_known_communities - self.community_members = community_members - - -class IpExtendedCommunity(TrackedResource): # pylint: disable=too-many-instance-attributes - """The IP Extended Community resource definition. - - 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 Azure. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar ip_extended_community_rules: List of IP Extended Community Rules. Required. - :vartype ip_extended_community_rules: - list[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityRule] - :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", - "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", - "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", - "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.AdministrativeState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "ip_extended_community_rules": {"required": True}, - "configuration_state": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "administrative_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "annotation": {"key": "properties.annotation", "type": "str"}, - "ip_extended_community_rules": { - "key": "properties.ipExtendedCommunityRules", - "type": "[IpExtendedCommunityRule]", - }, - "configuration_state": {"key": "properties.configurationState", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "administrative_state": {"key": "properties.administrativeState", "type": "str"}, - } - - def __init__( - self, - *, - location: str, - ip_extended_community_rules: List["_models.IpExtendedCommunityRule"], - tags: Optional[Dict[str, str]] = None, - annotation: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword ip_extended_community_rules: List of IP Extended Community Rules. Required. - :paramtype ip_extended_community_rules: - list[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityRule] - """ - super().__init__(tags=tags, location=location, **kwargs) - self.annotation = annotation - self.ip_extended_community_rules = ip_extended_community_rules - self.configuration_state = None - self.provisioning_state = None - self.administrative_state = None - - -class IpExtendedCommunityIdList(_serialization.Model): - """IP Extended Community Id list properties. - - :ivar ip_extended_community_ids: List of IP Extended Community resource IDs. - :vartype ip_extended_community_ids: list[str] - """ - - _attribute_map = { - "ip_extended_community_ids": {"key": "ipExtendedCommunityIds", "type": "[str]"}, - } - - def __init__(self, *, ip_extended_community_ids: Optional[List[str]] = None, **kwargs: Any) -> None: - """ - :keyword ip_extended_community_ids: List of IP Extended Community resource IDs. - :paramtype ip_extended_community_ids: list[str] - """ - super().__init__(**kwargs) - self.ip_extended_community_ids = ip_extended_community_ids - - -class IpExtendedCommunityListResult(_serialization.Model): - """List of IP Extended Communities. - - :ivar value: List of IP Extended Communities resources. - :vartype value: list[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] - :ivar next_link: Url to follow for getting next page of resources. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[IpExtendedCommunity]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, - *, - value: Optional[List["_models.IpExtendedCommunity"]] = None, - next_link: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword value: List of IP Extended Communities resources. - :paramtype value: list[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] - :keyword next_link: Url to follow for getting next page of resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class IpExtendedCommunityPatch(TagsUpdate): - """The IP Extended Communities patch resource definition. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar ip_extended_community_rules: List of IP Extended Community Rules. - :vartype ip_extended_community_rules: - list[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityRule] - :ivar annotation: Switch configuration description. - :vartype annotation: str - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "ip_extended_community_rules": { - "key": "properties.ipExtendedCommunityRules", - "type": "[IpExtendedCommunityRule]", - }, - "annotation": {"key": "properties.annotation", "type": "str"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - ip_extended_community_rules: Optional[List["_models.IpExtendedCommunityRule"]] = None, - annotation: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword ip_extended_community_rules: List of IP Extended Community Rules. - :paramtype ip_extended_community_rules: - list[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityRule] - :keyword annotation: Switch configuration description. - :paramtype annotation: str - """ - super().__init__(tags=tags, **kwargs) - self.ip_extended_community_rules = ip_extended_community_rules - self.annotation = annotation - - -class IpExtendedCommunityPatchableProperties(_serialization.Model): - """IP Extended Community patchable properties. - - All required parameters must be populated in order to send to Azure. - - :ivar ip_extended_community_rules: List of IP Extended Community Rules. Required. - :vartype ip_extended_community_rules: - list[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityRule] - """ - - _validation = { - "ip_extended_community_rules": {"required": True}, - } - - _attribute_map = { - "ip_extended_community_rules": {"key": "ipExtendedCommunityRules", "type": "[IpExtendedCommunityRule]"}, - } - - def __init__(self, *, ip_extended_community_rules: List["_models.IpExtendedCommunityRule"], **kwargs: Any) -> None: - """ - :keyword ip_extended_community_rules: List of IP Extended Community Rules. Required. - :paramtype ip_extended_community_rules: - list[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityRule] - """ - super().__init__(**kwargs) - self.ip_extended_community_rules = ip_extended_community_rules - - -class IpExtendedCommunityPatchProperties(IpExtendedCommunityPatchableProperties, AnnotationResource): - """IP Extended Community patchable properties. - - All required parameters must be populated in order to send to Azure. - - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar ip_extended_community_rules: List of IP Extended Community Rules. Required. - :vartype ip_extended_community_rules: - list[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityRule] - """ - - _validation = { - "ip_extended_community_rules": {"required": True}, - } - - _attribute_map = { - "annotation": {"key": "annotation", "type": "str"}, - "ip_extended_community_rules": {"key": "ipExtendedCommunityRules", "type": "[IpExtendedCommunityRule]"}, - } - - def __init__( - self, - *, - ip_extended_community_rules: List["_models.IpExtendedCommunityRule"], - annotation: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword ip_extended_community_rules: List of IP Extended Community Rules. Required. - :paramtype ip_extended_community_rules: - list[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityRule] - """ - super().__init__(ip_extended_community_rules=ip_extended_community_rules, annotation=annotation, **kwargs) - self.annotation = annotation - self.ip_extended_community_rules = ip_extended_community_rules - - -class IpExtendedCommunityProperties(AnnotationResource, IpExtendedCommunityPatchableProperties): - """IP Extended Community Properties defines the resource properties. - - 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 Azure. - - :ivar ip_extended_community_rules: List of IP Extended Community Rules. Required. - :vartype ip_extended_community_rules: - list[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityRule] - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", - "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", - "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", - "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.AdministrativeState - """ - - _validation = { - "ip_extended_community_rules": {"required": True}, - "configuration_state": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "administrative_state": {"readonly": True}, - } - - _attribute_map = { - "ip_extended_community_rules": {"key": "ipExtendedCommunityRules", "type": "[IpExtendedCommunityRule]"}, - "annotation": {"key": "annotation", "type": "str"}, - "configuration_state": {"key": "configurationState", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "administrative_state": {"key": "administrativeState", "type": "str"}, - } - - def __init__( - self, - *, - ip_extended_community_rules: List["_models.IpExtendedCommunityRule"], - annotation: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword ip_extended_community_rules: List of IP Extended Community Rules. Required. - :paramtype ip_extended_community_rules: - list[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityRule] - :keyword annotation: Switch configuration description. - :paramtype annotation: str - """ - super().__init__(annotation=annotation, ip_extended_community_rules=ip_extended_community_rules, **kwargs) - self.ip_extended_community_rules = ip_extended_community_rules - self.configuration_state = None - self.provisioning_state = None - self.administrative_state = None - self.annotation = annotation - - -class IpExtendedCommunityRule(_serialization.Model): - """List of IP Extended Community Rules. - - All required parameters must be populated in order to send to Azure. - - :ivar action: Action to be taken on the configuration. Example: Permit | Deny. Required. Known - values are: "Permit" and "Deny". - :vartype action: str or ~azure.mgmt.managednetworkfabric.models.CommunityActionTypes - :ivar sequence_number: Sequence to insert to/delete from existing route. Prefix lists are - evaluated starting with the lowest sequence number and continue down the list until a match is - made. Once a match is made, the permit or deny statement is applied to that network and the - rest of the list is ignored. Required. - :vartype sequence_number: int - :ivar route_targets: Route Target List.The expected formats are ASN(plain):NN >> example - 4294967294:50, ASN.ASN:NN >> example 65533.65333:40, IP-address:NN >> example - 10.10.10.10:65535. The possible values of ASN,NN are in range of 0-65535, ASN(plain) is in - range of 0-4294967295. Required. - :vartype route_targets: list[str] - """ - - _validation = { - "action": {"required": True}, - "sequence_number": {"required": True, "maximum": 4294967295, "minimum": 1}, - "route_targets": {"required": True, "min_items": 1}, - } - - _attribute_map = { - "action": {"key": "action", "type": "str"}, - "sequence_number": {"key": "sequenceNumber", "type": "int"}, - "route_targets": {"key": "routeTargets", "type": "[str]"}, - } - - def __init__( - self, - *, - action: Union[str, "_models.CommunityActionTypes"], - sequence_number: int, - route_targets: List[str], - **kwargs: Any - ) -> None: - """ - :keyword action: Action to be taken on the configuration. Example: Permit | Deny. Required. - Known values are: "Permit" and "Deny". - :paramtype action: str or ~azure.mgmt.managednetworkfabric.models.CommunityActionTypes - :keyword sequence_number: Sequence to insert to/delete from existing route. Prefix lists are - evaluated starting with the lowest sequence number and continue down the list until a match is - made. Once a match is made, the permit or deny statement is applied to that network and the - rest of the list is ignored. Required. - :paramtype sequence_number: int - :keyword route_targets: Route Target List.The expected formats are ASN(plain):NN >> example - 4294967294:50, ASN.ASN:NN >> example 65533.65333:40, IP-address:NN >> example - 10.10.10.10:65535. The possible values of ASN,NN are in range of 0-65535, ASN(plain) is in - range of 0-4294967295. Required. - :paramtype route_targets: list[str] - """ - super().__init__(**kwargs) - self.action = action - self.sequence_number = sequence_number - self.route_targets = route_targets - - -class IpGroupProperties(_serialization.Model): - """IP Group properties. - - :ivar name: IP Group name. - :vartype name: str - :ivar ip_address_type: IP Address type. Known values are: "IPv4" and "IPv6". - :vartype ip_address_type: str or ~azure.mgmt.managednetworkfabric.models.IPAddressType - :ivar ip_prefixes: List of IP Prefixes. - :vartype ip_prefixes: list[str] - """ - - _validation = { - "name": {"min_length": 1}, - "ip_prefixes": {"min_items": 1}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "ip_address_type": {"key": "ipAddressType", "type": "str"}, - "ip_prefixes": {"key": "ipPrefixes", "type": "[str]"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - ip_address_type: Optional[Union[str, "_models.IPAddressType"]] = None, - ip_prefixes: Optional[List[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: IP Group name. - :paramtype name: str - :keyword ip_address_type: IP Address type. Known values are: "IPv4" and "IPv6". - :paramtype ip_address_type: str or ~azure.mgmt.managednetworkfabric.models.IPAddressType - :keyword ip_prefixes: List of IP Prefixes. - :paramtype ip_prefixes: list[str] - """ - super().__init__(**kwargs) - self.name = name - self.ip_address_type = ip_address_type - self.ip_prefixes = ip_prefixes - - -class IpMatchCondition(_serialization.Model): - """Defines the condition that can be filtered using the selected IPs. - - :ivar type: IP Address type. Known values are: "SourceIP" and "DestinationIP". - :vartype type: str or ~azure.mgmt.managednetworkfabric.models.SourceDestinationType - :ivar prefix_type: IP Prefix Type. Known values are: "Prefix" and "LongestPrefix". - :vartype prefix_type: str or ~azure.mgmt.managednetworkfabric.models.PrefixType - :ivar ip_prefix_values: The list of IP Prefixes. - :vartype ip_prefix_values: list[str] - :ivar ip_group_names: The List of IP Group Names that need to be matched. - :vartype ip_group_names: list[str] - """ - - _validation = { - "ip_prefix_values": {"min_items": 1}, - "ip_group_names": {"min_items": 1}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "prefix_type": {"key": "prefixType", "type": "str"}, - "ip_prefix_values": {"key": "ipPrefixValues", "type": "[str]"}, - "ip_group_names": {"key": "ipGroupNames", "type": "[str]"}, - } - - def __init__( - self, - *, - type: Optional[Union[str, "_models.SourceDestinationType"]] = None, - prefix_type: Optional[Union[str, "_models.PrefixType"]] = None, - ip_prefix_values: Optional[List[str]] = None, - ip_group_names: Optional[List[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword type: IP Address type. Known values are: "SourceIP" and "DestinationIP". - :paramtype type: str or ~azure.mgmt.managednetworkfabric.models.SourceDestinationType - :keyword prefix_type: IP Prefix Type. Known values are: "Prefix" and "LongestPrefix". - :paramtype prefix_type: str or ~azure.mgmt.managednetworkfabric.models.PrefixType - :keyword ip_prefix_values: The list of IP Prefixes. - :paramtype ip_prefix_values: list[str] - :keyword ip_group_names: The List of IP Group Names that need to be matched. - :paramtype ip_group_names: list[str] - """ - super().__init__(**kwargs) - self.type = type - self.prefix_type = prefix_type - self.ip_prefix_values = ip_prefix_values - self.ip_group_names = ip_group_names - - -class IpPrefix(TrackedResource): # pylint: disable=too-many-instance-attributes - """The IP Prefix resource definition. - - 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 Azure. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar ip_prefix_rules: The list of IP Prefix Rules. - :vartype ip_prefix_rules: list[~azure.mgmt.managednetworkfabric.models.IpPrefixRule] - :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", - "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", - "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", - "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.AdministrativeState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "configuration_state": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "administrative_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "annotation": {"key": "properties.annotation", "type": "str"}, - "ip_prefix_rules": {"key": "properties.ipPrefixRules", "type": "[IpPrefixRule]"}, - "configuration_state": {"key": "properties.configurationState", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "administrative_state": {"key": "properties.administrativeState", "type": "str"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - annotation: Optional[str] = None, - ip_prefix_rules: Optional[List["_models.IpPrefixRule"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword ip_prefix_rules: The list of IP Prefix Rules. - :paramtype ip_prefix_rules: list[~azure.mgmt.managednetworkfabric.models.IpPrefixRule] - """ - super().__init__(tags=tags, location=location, **kwargs) - self.annotation = annotation - self.ip_prefix_rules = ip_prefix_rules - self.configuration_state = None - self.provisioning_state = None - self.administrative_state = None - - -class IpPrefixesListResult(_serialization.Model): - """List of IP Prefixes. - - :ivar value: List of IP Prefix resources. - :vartype value: list[~azure.mgmt.managednetworkfabric.models.IpPrefix] - :ivar next_link: Url to follow for getting next page of resources. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[IpPrefix]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: Optional[List["_models.IpPrefix"]] = None, next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: List of IP Prefix resources. - :paramtype value: list[~azure.mgmt.managednetworkfabric.models.IpPrefix] - :keyword next_link: Url to follow for getting next page of resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class IpPrefixPatch(TagsUpdate): - """The IP Prefix patch resource definition. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar ip_prefix_rules: The list of IP Prefix Rules. - :vartype ip_prefix_rules: list[~azure.mgmt.managednetworkfabric.models.IpPrefixRule] - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "annotation": {"key": "properties.annotation", "type": "str"}, - "ip_prefix_rules": {"key": "properties.ipPrefixRules", "type": "[IpPrefixRule]"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - annotation: Optional[str] = None, - ip_prefix_rules: Optional[List["_models.IpPrefixRule"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword ip_prefix_rules: The list of IP Prefix Rules. - :paramtype ip_prefix_rules: list[~azure.mgmt.managednetworkfabric.models.IpPrefixRule] - """ - super().__init__(tags=tags, **kwargs) - self.annotation = annotation - self.ip_prefix_rules = ip_prefix_rules - - -class IpPrefixPatchableProperties(_serialization.Model): - """IP Prefix patchable properties. - - :ivar ip_prefix_rules: The list of IP Prefix Rules. - :vartype ip_prefix_rules: list[~azure.mgmt.managednetworkfabric.models.IpPrefixRule] - """ - - _attribute_map = { - "ip_prefix_rules": {"key": "ipPrefixRules", "type": "[IpPrefixRule]"}, - } - - def __init__(self, *, ip_prefix_rules: Optional[List["_models.IpPrefixRule"]] = None, **kwargs: Any) -> None: - """ - :keyword ip_prefix_rules: The list of IP Prefix Rules. - :paramtype ip_prefix_rules: list[~azure.mgmt.managednetworkfabric.models.IpPrefixRule] - """ - super().__init__(**kwargs) - self.ip_prefix_rules = ip_prefix_rules - - -class IpPrefixPatchProperties(AnnotationResource, IpPrefixPatchableProperties): - """IP Prefix patchable properties. - - :ivar ip_prefix_rules: The list of IP Prefix Rules. - :vartype ip_prefix_rules: list[~azure.mgmt.managednetworkfabric.models.IpPrefixRule] - :ivar annotation: Switch configuration description. - :vartype annotation: str - """ - - _attribute_map = { - "ip_prefix_rules": {"key": "ipPrefixRules", "type": "[IpPrefixRule]"}, - "annotation": {"key": "annotation", "type": "str"}, - } - - def __init__( - self, - *, - ip_prefix_rules: Optional[List["_models.IpPrefixRule"]] = None, - annotation: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword ip_prefix_rules: The list of IP Prefix Rules. - :paramtype ip_prefix_rules: list[~azure.mgmt.managednetworkfabric.models.IpPrefixRule] - :keyword annotation: Switch configuration description. - :paramtype annotation: str - """ - super().__init__(annotation=annotation, ip_prefix_rules=ip_prefix_rules, **kwargs) - self.ip_prefix_rules = ip_prefix_rules - self.annotation = annotation - - -class IpPrefixProperties(AnnotationResource, IpPrefixPatchableProperties): - """IP Prefix Properties defines the properties of the resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar ip_prefix_rules: The list of IP Prefix Rules. - :vartype ip_prefix_rules: list[~azure.mgmt.managednetworkfabric.models.IpPrefixRule] - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", - "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", - "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", - "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.AdministrativeState - """ - - _validation = { - "configuration_state": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "administrative_state": {"readonly": True}, - } - - _attribute_map = { - "ip_prefix_rules": {"key": "ipPrefixRules", "type": "[IpPrefixRule]"}, - "annotation": {"key": "annotation", "type": "str"}, - "configuration_state": {"key": "configurationState", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "administrative_state": {"key": "administrativeState", "type": "str"}, - } - - def __init__( - self, - *, - ip_prefix_rules: Optional[List["_models.IpPrefixRule"]] = None, - annotation: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword ip_prefix_rules: The list of IP Prefix Rules. - :paramtype ip_prefix_rules: list[~azure.mgmt.managednetworkfabric.models.IpPrefixRule] - :keyword annotation: Switch configuration description. - :paramtype annotation: str - """ - super().__init__(annotation=annotation, ip_prefix_rules=ip_prefix_rules, **kwargs) - self.ip_prefix_rules = ip_prefix_rules - self.configuration_state = None - self.provisioning_state = None - self.administrative_state = None - self.annotation = annotation - - -class IpPrefixRule(_serialization.Model): - """IP Prefix Rule properties. - - All required parameters must be populated in order to send to Azure. - - :ivar action: Action to be taken on the configuration. Example: Permit | Deny. Required. Known - values are: "Permit" and "Deny". - :vartype action: str or ~azure.mgmt.managednetworkfabric.models.CommunityActionTypes - :ivar sequence_number: Sequence to insert to/delete from existing route. Prefix lists are - evaluated starting with the lowest sequence number and continue down the list until a match is - made. Once a match is made, the permit or deny statement is applied to that network and the - rest of the list is ignored. Required. - :vartype sequence_number: int - :ivar network_prefix: Network Prefix specifying IPv4/IPv6 packets to be permitted or denied. - Example: 1.1.1.0/24 | 3FFE:FFFF:0:CD30::/126. Required. - :vartype network_prefix: str - :ivar condition: Specify prefix-list bounds. Known values are: "EqualTo", - "GreaterThanOrEqualTo", "LesserThanOrEqualTo", and "Range". - :vartype condition: str or ~azure.mgmt.managednetworkfabric.models.Condition - :ivar subnet_mask_length: SubnetMaskLength gives the minimum NetworkPrefix length to be - matched. Possible values for IPv4 are 1 - 32 . Possible values of IPv6 are 1 - 128. - :vartype subnet_mask_length: str - """ - - _validation = { - "action": {"required": True}, - "sequence_number": {"required": True, "maximum": 4294967295, "minimum": 1}, - "network_prefix": {"required": True}, - } - - _attribute_map = { - "action": {"key": "action", "type": "str"}, - "sequence_number": {"key": "sequenceNumber", "type": "int"}, - "network_prefix": {"key": "networkPrefix", "type": "str"}, - "condition": {"key": "condition", "type": "str"}, - "subnet_mask_length": {"key": "subnetMaskLength", "type": "str"}, - } - - def __init__( - self, - *, - action: Union[str, "_models.CommunityActionTypes"], - sequence_number: int, - network_prefix: str, - condition: Optional[Union[str, "_models.Condition"]] = None, - subnet_mask_length: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword action: Action to be taken on the configuration. Example: Permit | Deny. Required. - Known values are: "Permit" and "Deny". - :paramtype action: str or ~azure.mgmt.managednetworkfabric.models.CommunityActionTypes - :keyword sequence_number: Sequence to insert to/delete from existing route. Prefix lists are - evaluated starting with the lowest sequence number and continue down the list until a match is - made. Once a match is made, the permit or deny statement is applied to that network and the - rest of the list is ignored. Required. - :paramtype sequence_number: int - :keyword network_prefix: Network Prefix specifying IPv4/IPv6 packets to be permitted or denied. - Example: 1.1.1.0/24 | 3FFE:FFFF:0:CD30::/126. Required. - :paramtype network_prefix: str - :keyword condition: Specify prefix-list bounds. Known values are: "EqualTo", - "GreaterThanOrEqualTo", "LesserThanOrEqualTo", and "Range". - :paramtype condition: str or ~azure.mgmt.managednetworkfabric.models.Condition - :keyword subnet_mask_length: SubnetMaskLength gives the minimum NetworkPrefix length to be - matched. Possible values for IPv4 are 1 - 32 . Possible values of IPv6 are 1 - 128. - :paramtype subnet_mask_length: str - """ - super().__init__(**kwargs) - self.action = action - self.sequence_number = sequence_number - self.network_prefix = network_prefix - self.condition = condition - self.subnet_mask_length = subnet_mask_length - - -class IsolationDomainProperties(_serialization.Model): - """Isolation Domain Properties. - - :ivar encapsulation: Type of encapsulation. Known values are: "None" and "GRE". - :vartype encapsulation: str or ~azure.mgmt.managednetworkfabric.models.Encapsulation - :ivar neighbor_group_ids: List of Neighbor Group IDs. - :vartype neighbor_group_ids: list[str] - """ - - _attribute_map = { - "encapsulation": {"key": "encapsulation", "type": "str"}, - "neighbor_group_ids": {"key": "neighborGroupIds", "type": "[str]"}, - } - - def __init__( - self, - *, - encapsulation: Optional[Union[str, "_models.Encapsulation"]] = None, - neighbor_group_ids: Optional[List[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword encapsulation: Type of encapsulation. Known values are: "None" and "GRE". - :paramtype encapsulation: str or ~azure.mgmt.managednetworkfabric.models.Encapsulation - :keyword neighbor_group_ids: List of Neighbor Group IDs. - :paramtype neighbor_group_ids: list[str] - """ - super().__init__(**kwargs) - self.encapsulation = encapsulation - self.neighbor_group_ids = neighbor_group_ids - - -class L2IsolationDomain(TrackedResource): # pylint: disable=too-many-instance-attributes - """The L2 Isolation Domain resource definition. - - 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 Azure. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar network_fabric_id: ARM Resource ID of the Network Fabric. Required. - :vartype network_fabric_id: str - :ivar vlan_id: Vlan Identifier of the Network Fabric. Example: 501. Required. - :vartype vlan_id: int - :ivar mtu: Maximum transmission unit. Default value is 1500. - :vartype mtu: int - :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", - "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", - "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", - "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.AdministrativeState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "network_fabric_id": {"required": True}, - "vlan_id": {"required": True, "maximum": 4094, "minimum": 100}, - "mtu": {"maximum": 9200, "minimum": 64}, - "configuration_state": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "administrative_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "annotation": {"key": "properties.annotation", "type": "str"}, - "network_fabric_id": {"key": "properties.networkFabricId", "type": "str"}, - "vlan_id": {"key": "properties.vlanId", "type": "int"}, - "mtu": {"key": "properties.mtu", "type": "int"}, - "configuration_state": {"key": "properties.configurationState", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "administrative_state": {"key": "properties.administrativeState", "type": "str"}, - } - - def __init__( - self, - *, - location: str, - network_fabric_id: str, - vlan_id: int, - tags: Optional[Dict[str, str]] = None, - annotation: Optional[str] = None, - mtu: int = 1500, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword network_fabric_id: ARM Resource ID of the Network Fabric. Required. - :paramtype network_fabric_id: str - :keyword vlan_id: Vlan Identifier of the Network Fabric. Example: 501. Required. - :paramtype vlan_id: int - :keyword mtu: Maximum transmission unit. Default value is 1500. - :paramtype mtu: int - """ - super().__init__(tags=tags, location=location, **kwargs) - self.annotation = annotation - self.network_fabric_id = network_fabric_id - self.vlan_id = vlan_id - self.mtu = mtu - self.configuration_state = None - self.provisioning_state = None - self.administrative_state = None - - -class L2IsolationDomainPatch(TagsUpdate): - """The L2 Isolation Domain patch resource definition. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar mtu: Maximum transmission unit. Default value is 1500. - :vartype mtu: int - """ - - _validation = { - "mtu": {"maximum": 9200, "minimum": 64}, - } - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "annotation": {"key": "properties.annotation", "type": "str"}, - "mtu": {"key": "properties.mtu", "type": "int"}, - } - - def __init__( - self, *, tags: Optional[Dict[str, str]] = None, annotation: Optional[str] = None, mtu: int = 1500, **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword mtu: Maximum transmission unit. Default value is 1500. - :paramtype mtu: int - """ - super().__init__(tags=tags, **kwargs) - self.annotation = annotation - self.mtu = mtu - - -class L2IsolationDomainPatchProperties(AnnotationResource): - """L2 Isolation Domain Patch Properties defines the patchable properties of the resource. - - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar mtu: Maximum transmission unit. Default value is 1500. - :vartype mtu: int - """ - - _validation = { - "mtu": {"maximum": 9200, "minimum": 64}, - } - - _attribute_map = { - "annotation": {"key": "annotation", "type": "str"}, - "mtu": {"key": "mtu", "type": "int"}, - } - - def __init__(self, *, annotation: Optional[str] = None, mtu: int = 1500, **kwargs: Any) -> None: - """ - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword mtu: Maximum transmission unit. Default value is 1500. - :paramtype mtu: int - """ - super().__init__(annotation=annotation, **kwargs) - self.mtu = mtu - - -class L2IsolationDomainProperties(AnnotationResource): - """L2Isolation Domain Properties defines the properties of the 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 Azure. - - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar network_fabric_id: ARM Resource ID of the Network Fabric. Required. - :vartype network_fabric_id: str - :ivar vlan_id: Vlan Identifier of the Network Fabric. Example: 501. Required. - :vartype vlan_id: int - :ivar mtu: Maximum transmission unit. Default value is 1500. - :vartype mtu: int - :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", - "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", - "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", - "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.AdministrativeState - """ - - _validation = { - "network_fabric_id": {"required": True}, - "vlan_id": {"required": True, "maximum": 4094, "minimum": 100}, - "mtu": {"maximum": 9200, "minimum": 64}, - "configuration_state": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "administrative_state": {"readonly": True}, - } - - _attribute_map = { - "annotation": {"key": "annotation", "type": "str"}, - "network_fabric_id": {"key": "networkFabricId", "type": "str"}, - "vlan_id": {"key": "vlanId", "type": "int"}, - "mtu": {"key": "mtu", "type": "int"}, - "configuration_state": {"key": "configurationState", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "administrative_state": {"key": "administrativeState", "type": "str"}, - } - - def __init__( - self, *, network_fabric_id: str, vlan_id: int, annotation: Optional[str] = None, mtu: int = 1500, **kwargs: Any - ) -> None: - """ - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword network_fabric_id: ARM Resource ID of the Network Fabric. Required. - :paramtype network_fabric_id: str - :keyword vlan_id: Vlan Identifier of the Network Fabric. Example: 501. Required. - :paramtype vlan_id: int - :keyword mtu: Maximum transmission unit. Default value is 1500. - :paramtype mtu: int - """ - super().__init__(annotation=annotation, **kwargs) - self.network_fabric_id = network_fabric_id - self.vlan_id = vlan_id - self.mtu = mtu - self.configuration_state = None - self.provisioning_state = None - self.administrative_state = None - - -class L2IsolationDomainsListResult(_serialization.Model): - """List of L2 Isolation Domains. - - :ivar value: Displays list of L2 Isolation Domain resources. - :vartype value: list[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] - :ivar next_link: Url to follow for getting next page of resources. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[L2IsolationDomain]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, - *, - value: Optional[List["_models.L2IsolationDomain"]] = None, - next_link: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword value: Displays list of L2 Isolation Domain resources. - :paramtype value: list[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] - :keyword next_link: Url to follow for getting next page of resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class L3ExportRoutePolicy(_serialization.Model): - """Array of ARM Resource ID of the RoutePolicies. - - :ivar export_ipv4_route_policy_id: ARM Resource ID of the RoutePolicy. - :vartype export_ipv4_route_policy_id: str - :ivar export_ipv6_route_policy_id: ARM Resource ID of the RoutePolicy. - :vartype export_ipv6_route_policy_id: str - """ - - _attribute_map = { - "export_ipv4_route_policy_id": {"key": "exportIpv4RoutePolicyId", "type": "str"}, - "export_ipv6_route_policy_id": {"key": "exportIpv6RoutePolicyId", "type": "str"}, - } - - def __init__( - self, - *, - export_ipv4_route_policy_id: Optional[str] = None, - export_ipv6_route_policy_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword export_ipv4_route_policy_id: ARM Resource ID of the RoutePolicy. - :paramtype export_ipv4_route_policy_id: str - :keyword export_ipv6_route_policy_id: ARM Resource ID of the RoutePolicy. - :paramtype export_ipv6_route_policy_id: str - """ - super().__init__(**kwargs) - self.export_ipv4_route_policy_id = export_ipv4_route_policy_id - self.export_ipv6_route_policy_id = export_ipv6_route_policy_id - - -class L3IsolationDomain(TrackedResource): # pylint: disable=too-many-instance-attributes - """The L3 Isolation Domain resource definition. - - 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 Azure. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar redistribute_connected_subnets: Advertise Connected Subnets. Ex: "True" | "False". Known - values are: "True" and "False". - :vartype redistribute_connected_subnets: str or - ~azure.mgmt.managednetworkfabric.models.RedistributeConnectedSubnets - :ivar redistribute_static_routes: Advertise Static Routes. Ex: "True" | "False". Known values - are: "True" and "False". - :vartype redistribute_static_routes: str or - ~azure.mgmt.managednetworkfabric.models.RedistributeStaticRoutes - :ivar aggregate_route_configuration: Aggregate route configurations. - :vartype aggregate_route_configuration: - ~azure.mgmt.managednetworkfabric.models.AggregateRouteConfiguration - :ivar connected_subnet_route_policy: Connected Subnet RoutePolicy. - :vartype connected_subnet_route_policy: - ~azure.mgmt.managednetworkfabric.models.ConnectedSubnetRoutePolicy - :ivar network_fabric_id: ARM Resource ID of the Network Fabric. Required. - :vartype network_fabric_id: str - :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", - "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", - "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", - "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.AdministrativeState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "network_fabric_id": {"required": True}, - "configuration_state": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "administrative_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "annotation": {"key": "properties.annotation", "type": "str"}, - "redistribute_connected_subnets": {"key": "properties.redistributeConnectedSubnets", "type": "str"}, - "redistribute_static_routes": {"key": "properties.redistributeStaticRoutes", "type": "str"}, - "aggregate_route_configuration": { - "key": "properties.aggregateRouteConfiguration", - "type": "AggregateRouteConfiguration", - }, - "connected_subnet_route_policy": { - "key": "properties.connectedSubnetRoutePolicy", - "type": "ConnectedSubnetRoutePolicy", - }, - "network_fabric_id": {"key": "properties.networkFabricId", "type": "str"}, - "configuration_state": {"key": "properties.configurationState", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "administrative_state": {"key": "properties.administrativeState", "type": "str"}, - } - - def __init__( - self, - *, - location: str, - network_fabric_id: str, - tags: Optional[Dict[str, str]] = None, - annotation: Optional[str] = None, - redistribute_connected_subnets: Union[str, "_models.RedistributeConnectedSubnets"] = "True", - redistribute_static_routes: Union[str, "_models.RedistributeStaticRoutes"] = "False", - aggregate_route_configuration: Optional["_models.AggregateRouteConfiguration"] = None, - connected_subnet_route_policy: Optional["_models.ConnectedSubnetRoutePolicy"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword redistribute_connected_subnets: Advertise Connected Subnets. Ex: "True" | "False". - Known values are: "True" and "False". - :paramtype redistribute_connected_subnets: str or - ~azure.mgmt.managednetworkfabric.models.RedistributeConnectedSubnets - :keyword redistribute_static_routes: Advertise Static Routes. Ex: "True" | "False". Known - values are: "True" and "False". - :paramtype redistribute_static_routes: str or - ~azure.mgmt.managednetworkfabric.models.RedistributeStaticRoutes - :keyword aggregate_route_configuration: Aggregate route configurations. - :paramtype aggregate_route_configuration: - ~azure.mgmt.managednetworkfabric.models.AggregateRouteConfiguration - :keyword connected_subnet_route_policy: Connected Subnet RoutePolicy. - :paramtype connected_subnet_route_policy: - ~azure.mgmt.managednetworkfabric.models.ConnectedSubnetRoutePolicy - :keyword network_fabric_id: ARM Resource ID of the Network Fabric. Required. - :paramtype network_fabric_id: str - """ - super().__init__(tags=tags, location=location, **kwargs) - self.annotation = annotation - self.redistribute_connected_subnets = redistribute_connected_subnets - self.redistribute_static_routes = redistribute_static_routes - self.aggregate_route_configuration = aggregate_route_configuration - self.connected_subnet_route_policy = connected_subnet_route_policy - self.network_fabric_id = network_fabric_id - self.configuration_state = None - self.provisioning_state = None - self.administrative_state = None - - -class L3IsolationDomainPatch(TagsUpdate): - """The L3 Isolation Domain patch resource definition. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar redistribute_connected_subnets: Advertise Connected Subnets. Ex: "True" | "False". Known - values are: "True" and "False". - :vartype redistribute_connected_subnets: str or - ~azure.mgmt.managednetworkfabric.models.RedistributeConnectedSubnets - :ivar redistribute_static_routes: Advertise Static Routes. Ex: "True" | "False". Known values - are: "True" and "False". - :vartype redistribute_static_routes: str or - ~azure.mgmt.managednetworkfabric.models.RedistributeStaticRoutes - :ivar aggregate_route_configuration: Aggregate route configurations. - :vartype aggregate_route_configuration: - ~azure.mgmt.managednetworkfabric.models.AggregateRouteConfiguration - :ivar connected_subnet_route_policy: Connected Subnet RoutePolicy. - :vartype connected_subnet_route_policy: - ~azure.mgmt.managednetworkfabric.models.ConnectedSubnetRoutePolicy - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "annotation": {"key": "properties.annotation", "type": "str"}, - "redistribute_connected_subnets": {"key": "properties.redistributeConnectedSubnets", "type": "str"}, - "redistribute_static_routes": {"key": "properties.redistributeStaticRoutes", "type": "str"}, - "aggregate_route_configuration": { - "key": "properties.aggregateRouteConfiguration", - "type": "AggregateRouteConfiguration", - }, - "connected_subnet_route_policy": { - "key": "properties.connectedSubnetRoutePolicy", - "type": "ConnectedSubnetRoutePolicy", - }, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - annotation: Optional[str] = None, - redistribute_connected_subnets: Union[str, "_models.RedistributeConnectedSubnets"] = "True", - redistribute_static_routes: Union[str, "_models.RedistributeStaticRoutes"] = "False", - aggregate_route_configuration: Optional["_models.AggregateRouteConfiguration"] = None, - connected_subnet_route_policy: Optional["_models.ConnectedSubnetRoutePolicy"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword redistribute_connected_subnets: Advertise Connected Subnets. Ex: "True" | "False". - Known values are: "True" and "False". - :paramtype redistribute_connected_subnets: str or - ~azure.mgmt.managednetworkfabric.models.RedistributeConnectedSubnets - :keyword redistribute_static_routes: Advertise Static Routes. Ex: "True" | "False". Known - values are: "True" and "False". - :paramtype redistribute_static_routes: str or - ~azure.mgmt.managednetworkfabric.models.RedistributeStaticRoutes - :keyword aggregate_route_configuration: Aggregate route configurations. - :paramtype aggregate_route_configuration: - ~azure.mgmt.managednetworkfabric.models.AggregateRouteConfiguration - :keyword connected_subnet_route_policy: Connected Subnet RoutePolicy. - :paramtype connected_subnet_route_policy: - ~azure.mgmt.managednetworkfabric.models.ConnectedSubnetRoutePolicy - """ - super().__init__(tags=tags, **kwargs) - self.annotation = annotation - self.redistribute_connected_subnets = redistribute_connected_subnets - self.redistribute_static_routes = redistribute_static_routes - self.aggregate_route_configuration = aggregate_route_configuration - self.connected_subnet_route_policy = connected_subnet_route_policy - - -class L3IsolationDomainPatchableProperties(_serialization.Model): - """L3 Isolation Domain Patch Properties defines the patchable properties of the resource. - - :ivar redistribute_connected_subnets: Advertise Connected Subnets. Ex: "True" | "False". Known - values are: "True" and "False". - :vartype redistribute_connected_subnets: str or - ~azure.mgmt.managednetworkfabric.models.RedistributeConnectedSubnets - :ivar redistribute_static_routes: Advertise Static Routes. Ex: "True" | "False". Known values - are: "True" and "False". - :vartype redistribute_static_routes: str or - ~azure.mgmt.managednetworkfabric.models.RedistributeStaticRoutes - :ivar aggregate_route_configuration: Aggregate route configurations. - :vartype aggregate_route_configuration: - ~azure.mgmt.managednetworkfabric.models.AggregateRouteConfiguration - :ivar connected_subnet_route_policy: Connected Subnet RoutePolicy. - :vartype connected_subnet_route_policy: - ~azure.mgmt.managednetworkfabric.models.ConnectedSubnetRoutePolicy - """ - - _attribute_map = { - "redistribute_connected_subnets": {"key": "redistributeConnectedSubnets", "type": "str"}, - "redistribute_static_routes": {"key": "redistributeStaticRoutes", "type": "str"}, - "aggregate_route_configuration": {"key": "aggregateRouteConfiguration", "type": "AggregateRouteConfiguration"}, - "connected_subnet_route_policy": {"key": "connectedSubnetRoutePolicy", "type": "ConnectedSubnetRoutePolicy"}, - } - - def __init__( - self, - *, - redistribute_connected_subnets: Union[str, "_models.RedistributeConnectedSubnets"] = "True", - redistribute_static_routes: Union[str, "_models.RedistributeStaticRoutes"] = "False", - aggregate_route_configuration: Optional["_models.AggregateRouteConfiguration"] = None, - connected_subnet_route_policy: Optional["_models.ConnectedSubnetRoutePolicy"] = None, - **kwargs: Any - ) -> None: - """ - :keyword redistribute_connected_subnets: Advertise Connected Subnets. Ex: "True" | "False". - Known values are: "True" and "False". - :paramtype redistribute_connected_subnets: str or - ~azure.mgmt.managednetworkfabric.models.RedistributeConnectedSubnets - :keyword redistribute_static_routes: Advertise Static Routes. Ex: "True" | "False". Known - values are: "True" and "False". - :paramtype redistribute_static_routes: str or - ~azure.mgmt.managednetworkfabric.models.RedistributeStaticRoutes - :keyword aggregate_route_configuration: Aggregate route configurations. - :paramtype aggregate_route_configuration: - ~azure.mgmt.managednetworkfabric.models.AggregateRouteConfiguration - :keyword connected_subnet_route_policy: Connected Subnet RoutePolicy. - :paramtype connected_subnet_route_policy: - ~azure.mgmt.managednetworkfabric.models.ConnectedSubnetRoutePolicy - """ - super().__init__(**kwargs) - self.redistribute_connected_subnets = redistribute_connected_subnets - self.redistribute_static_routes = redistribute_static_routes - self.aggregate_route_configuration = aggregate_route_configuration - self.connected_subnet_route_policy = connected_subnet_route_policy - - -class L3IsolationDomainPatchProperties(AnnotationResource, L3IsolationDomainPatchableProperties): - """Resource properties. - - :ivar redistribute_connected_subnets: Advertise Connected Subnets. Ex: "True" | "False". Known - values are: "True" and "False". - :vartype redistribute_connected_subnets: str or - ~azure.mgmt.managednetworkfabric.models.RedistributeConnectedSubnets - :ivar redistribute_static_routes: Advertise Static Routes. Ex: "True" | "False". Known values - are: "True" and "False". - :vartype redistribute_static_routes: str or - ~azure.mgmt.managednetworkfabric.models.RedistributeStaticRoutes - :ivar aggregate_route_configuration: Aggregate route configurations. - :vartype aggregate_route_configuration: - ~azure.mgmt.managednetworkfabric.models.AggregateRouteConfiguration - :ivar connected_subnet_route_policy: Connected Subnet RoutePolicy. - :vartype connected_subnet_route_policy: - ~azure.mgmt.managednetworkfabric.models.ConnectedSubnetRoutePolicy - :ivar annotation: Switch configuration description. - :vartype annotation: str - """ - - _attribute_map = { - "redistribute_connected_subnets": {"key": "redistributeConnectedSubnets", "type": "str"}, - "redistribute_static_routes": {"key": "redistributeStaticRoutes", "type": "str"}, - "aggregate_route_configuration": {"key": "aggregateRouteConfiguration", "type": "AggregateRouteConfiguration"}, - "connected_subnet_route_policy": {"key": "connectedSubnetRoutePolicy", "type": "ConnectedSubnetRoutePolicy"}, - "annotation": {"key": "annotation", "type": "str"}, - } - - def __init__( - self, - *, - redistribute_connected_subnets: Union[str, "_models.RedistributeConnectedSubnets"] = "True", - redistribute_static_routes: Union[str, "_models.RedistributeStaticRoutes"] = "False", - aggregate_route_configuration: Optional["_models.AggregateRouteConfiguration"] = None, - connected_subnet_route_policy: Optional["_models.ConnectedSubnetRoutePolicy"] = None, - annotation: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword redistribute_connected_subnets: Advertise Connected Subnets. Ex: "True" | "False". - Known values are: "True" and "False". - :paramtype redistribute_connected_subnets: str or - ~azure.mgmt.managednetworkfabric.models.RedistributeConnectedSubnets - :keyword redistribute_static_routes: Advertise Static Routes. Ex: "True" | "False". Known - values are: "True" and "False". - :paramtype redistribute_static_routes: str or - ~azure.mgmt.managednetworkfabric.models.RedistributeStaticRoutes - :keyword aggregate_route_configuration: Aggregate route configurations. - :paramtype aggregate_route_configuration: - ~azure.mgmt.managednetworkfabric.models.AggregateRouteConfiguration - :keyword connected_subnet_route_policy: Connected Subnet RoutePolicy. - :paramtype connected_subnet_route_policy: - ~azure.mgmt.managednetworkfabric.models.ConnectedSubnetRoutePolicy - :keyword annotation: Switch configuration description. - :paramtype annotation: str - """ - super().__init__( - annotation=annotation, - redistribute_connected_subnets=redistribute_connected_subnets, - redistribute_static_routes=redistribute_static_routes, - aggregate_route_configuration=aggregate_route_configuration, - connected_subnet_route_policy=connected_subnet_route_policy, - **kwargs - ) - self.redistribute_connected_subnets = redistribute_connected_subnets - self.redistribute_static_routes = redistribute_static_routes - self.aggregate_route_configuration = aggregate_route_configuration - self.connected_subnet_route_policy = connected_subnet_route_policy - self.annotation = annotation - - -class L3IsolationDomainProperties(AnnotationResource, L3IsolationDomainPatchableProperties): - """L3 Isolation Domain Properties defines the properties of the 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 Azure. - - :ivar redistribute_connected_subnets: Advertise Connected Subnets. Ex: "True" | "False". Known - values are: "True" and "False". - :vartype redistribute_connected_subnets: str or - ~azure.mgmt.managednetworkfabric.models.RedistributeConnectedSubnets - :ivar redistribute_static_routes: Advertise Static Routes. Ex: "True" | "False". Known values - are: "True" and "False". - :vartype redistribute_static_routes: str or - ~azure.mgmt.managednetworkfabric.models.RedistributeStaticRoutes - :ivar aggregate_route_configuration: Aggregate route configurations. - :vartype aggregate_route_configuration: - ~azure.mgmt.managednetworkfabric.models.AggregateRouteConfiguration - :ivar connected_subnet_route_policy: Connected Subnet RoutePolicy. - :vartype connected_subnet_route_policy: - ~azure.mgmt.managednetworkfabric.models.ConnectedSubnetRoutePolicy - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar network_fabric_id: ARM Resource ID of the Network Fabric. Required. - :vartype network_fabric_id: str - :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", - "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", - "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", - "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.AdministrativeState - """ - - _validation = { - "network_fabric_id": {"required": True}, - "configuration_state": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "administrative_state": {"readonly": True}, - } - - _attribute_map = { - "redistribute_connected_subnets": {"key": "redistributeConnectedSubnets", "type": "str"}, - "redistribute_static_routes": {"key": "redistributeStaticRoutes", "type": "str"}, - "aggregate_route_configuration": {"key": "aggregateRouteConfiguration", "type": "AggregateRouteConfiguration"}, - "connected_subnet_route_policy": {"key": "connectedSubnetRoutePolicy", "type": "ConnectedSubnetRoutePolicy"}, - "annotation": {"key": "annotation", "type": "str"}, - "network_fabric_id": {"key": "networkFabricId", "type": "str"}, - "configuration_state": {"key": "configurationState", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "administrative_state": {"key": "administrativeState", "type": "str"}, - } - - def __init__( - self, - *, - network_fabric_id: str, - redistribute_connected_subnets: Union[str, "_models.RedistributeConnectedSubnets"] = "True", - redistribute_static_routes: Union[str, "_models.RedistributeStaticRoutes"] = "False", - aggregate_route_configuration: Optional["_models.AggregateRouteConfiguration"] = None, - connected_subnet_route_policy: Optional["_models.ConnectedSubnetRoutePolicy"] = None, - annotation: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword redistribute_connected_subnets: Advertise Connected Subnets. Ex: "True" | "False". - Known values are: "True" and "False". - :paramtype redistribute_connected_subnets: str or - ~azure.mgmt.managednetworkfabric.models.RedistributeConnectedSubnets - :keyword redistribute_static_routes: Advertise Static Routes. Ex: "True" | "False". Known - values are: "True" and "False". - :paramtype redistribute_static_routes: str or - ~azure.mgmt.managednetworkfabric.models.RedistributeStaticRoutes - :keyword aggregate_route_configuration: Aggregate route configurations. - :paramtype aggregate_route_configuration: - ~azure.mgmt.managednetworkfabric.models.AggregateRouteConfiguration - :keyword connected_subnet_route_policy: Connected Subnet RoutePolicy. - :paramtype connected_subnet_route_policy: - ~azure.mgmt.managednetworkfabric.models.ConnectedSubnetRoutePolicy - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword network_fabric_id: ARM Resource ID of the Network Fabric. Required. - :paramtype network_fabric_id: str - """ - super().__init__( - annotation=annotation, - redistribute_connected_subnets=redistribute_connected_subnets, - redistribute_static_routes=redistribute_static_routes, - aggregate_route_configuration=aggregate_route_configuration, - connected_subnet_route_policy=connected_subnet_route_policy, - **kwargs - ) - self.redistribute_connected_subnets = redistribute_connected_subnets - self.redistribute_static_routes = redistribute_static_routes - self.aggregate_route_configuration = aggregate_route_configuration - self.connected_subnet_route_policy = connected_subnet_route_policy - self.network_fabric_id = network_fabric_id - self.configuration_state = None - self.provisioning_state = None - self.administrative_state = None - self.annotation = annotation - - -class L3IsolationDomainsListResult(_serialization.Model): - """List of L3 Isolation Domains. - - :ivar value: List of L3 Isolation Domain resources. - :vartype value: list[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] - :ivar next_link: Url to follow for getting next page of resources. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[L3IsolationDomain]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, - *, - value: Optional[List["_models.L3IsolationDomain"]] = None, - next_link: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword value: List of L3 Isolation Domain resources. - :paramtype value: list[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] - :keyword next_link: Url to follow for getting next page of resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class L3OptionBProperties(_serialization.Model): - """Option B configuration. - - :ivar import_route_targets: RouteTargets to be applied. This is used for the backward - compatibility. - :vartype import_route_targets: list[str] - :ivar export_route_targets: RouteTargets to be applied. This is used for the backward - compatibility. - :vartype export_route_targets: list[str] - :ivar route_targets: RouteTargets to be applied. - :vartype route_targets: ~azure.mgmt.managednetworkfabric.models.RouteTargetInformation - """ - - _attribute_map = { - "import_route_targets": {"key": "importRouteTargets", "type": "[str]"}, - "export_route_targets": {"key": "exportRouteTargets", "type": "[str]"}, - "route_targets": {"key": "routeTargets", "type": "RouteTargetInformation"}, - } - - def __init__( - self, - *, - import_route_targets: Optional[List[str]] = None, - export_route_targets: Optional[List[str]] = None, - route_targets: Optional["_models.RouteTargetInformation"] = None, - **kwargs: Any - ) -> None: - """ - :keyword import_route_targets: RouteTargets to be applied. This is used for the backward - compatibility. - :paramtype import_route_targets: list[str] - :keyword export_route_targets: RouteTargets to be applied. This is used for the backward - compatibility. - :paramtype export_route_targets: list[str] - :keyword route_targets: RouteTargets to be applied. - :paramtype route_targets: ~azure.mgmt.managednetworkfabric.models.RouteTargetInformation - """ - super().__init__(**kwargs) - self.import_route_targets = import_route_targets - self.export_route_targets = export_route_targets - self.route_targets = route_targets - - -class Layer2Configuration(_serialization.Model): - """Common properties for Layer2 Configuration. - - :ivar mtu: MTU of the packets between PE & CE. - :vartype mtu: int - :ivar interfaces: List of network device interfaces resource IDs. - :vartype interfaces: list[str] - """ - - _validation = { - "mtu": {"maximum": 9200, "minimum": 64}, - "interfaces": {"min_items": 1}, - } - - _attribute_map = { - "mtu": {"key": "mtu", "type": "int"}, - "interfaces": {"key": "interfaces", "type": "[str]"}, - } - - def __init__(self, *, mtu: int = 1500, interfaces: Optional[List[str]] = None, **kwargs: Any) -> None: - """ - :keyword mtu: MTU of the packets between PE & CE. - :paramtype mtu: int - :keyword interfaces: List of network device interfaces resource IDs. - :paramtype interfaces: list[str] - """ - super().__init__(**kwargs) - self.mtu = mtu - self.interfaces = interfaces - - -class ManagedResourceGroupConfiguration(_serialization.Model): - """Managed Resource Group configuration properties. - - :ivar name: The NFC service will be hosted in a Managed resource group. - :vartype name: str - :ivar location: Managed resource group location. - :vartype location: str - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "location": {"key": "location", "type": "str"}, - } - - def __init__(self, *, name: Optional[str] = None, location: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword name: The NFC service will be hosted in a Managed resource group. - :paramtype name: str - :keyword location: Managed resource group location. - :paramtype location: str - """ - super().__init__(**kwargs) - self.name = name - self.location = location - - -class ManagementNetworkConfigurationPatchableProperties(_serialization.Model): - """Configuration to be used to setup the management network. - - :ivar infrastructure_vpn_configuration: VPN Configuration properties. - :vartype infrastructure_vpn_configuration: - ~azure.mgmt.managednetworkfabric.models.VpnConfigurationPatchableProperties - :ivar workload_vpn_configuration: VPN Configuration properties. - :vartype workload_vpn_configuration: - ~azure.mgmt.managednetworkfabric.models.VpnConfigurationPatchableProperties - """ - - _attribute_map = { - "infrastructure_vpn_configuration": { - "key": "infrastructureVpnConfiguration", - "type": "VpnConfigurationPatchableProperties", - }, - "workload_vpn_configuration": { - "key": "workloadVpnConfiguration", - "type": "VpnConfigurationPatchableProperties", - }, - } - - def __init__( - self, - *, - infrastructure_vpn_configuration: Optional["_models.VpnConfigurationPatchableProperties"] = None, - workload_vpn_configuration: Optional["_models.VpnConfigurationPatchableProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword infrastructure_vpn_configuration: VPN Configuration properties. - :paramtype infrastructure_vpn_configuration: - ~azure.mgmt.managednetworkfabric.models.VpnConfigurationPatchableProperties - :keyword workload_vpn_configuration: VPN Configuration properties. - :paramtype workload_vpn_configuration: - ~azure.mgmt.managednetworkfabric.models.VpnConfigurationPatchableProperties - """ - super().__init__(**kwargs) - self.infrastructure_vpn_configuration = infrastructure_vpn_configuration - self.workload_vpn_configuration = workload_vpn_configuration - - -class ManagementNetworkConfigurationProperties(_serialization.Model): - """Configuration to be used to setup the management network. - - All required parameters must be populated in order to send to Azure. - - :ivar infrastructure_vpn_configuration: VPN Configuration properties. Required. - :vartype infrastructure_vpn_configuration: - ~azure.mgmt.managednetworkfabric.models.VpnConfigurationProperties - :ivar workload_vpn_configuration: VPN Configuration properties. Required. - :vartype workload_vpn_configuration: - ~azure.mgmt.managednetworkfabric.models.VpnConfigurationProperties - """ - - _validation = { - "infrastructure_vpn_configuration": {"required": True}, - "workload_vpn_configuration": {"required": True}, - } - - _attribute_map = { - "infrastructure_vpn_configuration": { - "key": "infrastructureVpnConfiguration", - "type": "VpnConfigurationProperties", - }, - "workload_vpn_configuration": {"key": "workloadVpnConfiguration", "type": "VpnConfigurationProperties"}, - } - - def __init__( - self, - *, - infrastructure_vpn_configuration: "_models.VpnConfigurationProperties", - workload_vpn_configuration: "_models.VpnConfigurationProperties", - **kwargs: Any - ) -> None: - """ - :keyword infrastructure_vpn_configuration: VPN Configuration properties. Required. - :paramtype infrastructure_vpn_configuration: - ~azure.mgmt.managednetworkfabric.models.VpnConfigurationProperties - :keyword workload_vpn_configuration: VPN Configuration properties. Required. - :paramtype workload_vpn_configuration: - ~azure.mgmt.managednetworkfabric.models.VpnConfigurationProperties - """ - super().__init__(**kwargs) - self.infrastructure_vpn_configuration = infrastructure_vpn_configuration - self.workload_vpn_configuration = workload_vpn_configuration - - -class NeighborAddress(_serialization.Model): - """Neighbor Address properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar address: IP Address. - :vartype address: str - :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", - "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", - "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - """ - - _validation = { - "address": {"min_length": 1}, - "configuration_state": {"readonly": True}, - } - - _attribute_map = { - "address": {"key": "address", "type": "str"}, - "configuration_state": {"key": "configurationState", "type": "str"}, - } - - def __init__(self, *, address: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword address: IP Address. - :paramtype address: str - """ - super().__init__(**kwargs) - self.address = address - self.configuration_state = None - - -class NeighborGroup(TrackedResource): # pylint: disable=too-many-instance-attributes - """Defines the Neighbor Group. - - 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 Azure. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar destination: An array of destination IPv4 Addresses or IPv6 Addresses. - :vartype destination: ~azure.mgmt.managednetworkfabric.models.NeighborGroupDestination - :ivar network_tap_ids: List of NetworkTap IDs where neighbor group is associated. - :vartype network_tap_ids: list[str] - :ivar network_tap_rule_ids: List of Network Tap Rule IDs where neighbor group is associated. - :vartype network_tap_rule_ids: list[str] - :ivar provisioning_state: The provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "network_tap_ids": {"readonly": True}, - "network_tap_rule_ids": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "annotation": {"key": "properties.annotation", "type": "str"}, - "destination": {"key": "properties.destination", "type": "NeighborGroupDestination"}, - "network_tap_ids": {"key": "properties.networkTapIds", "type": "[str]"}, - "network_tap_rule_ids": {"key": "properties.networkTapRuleIds", "type": "[str]"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - annotation: Optional[str] = None, - destination: Optional["_models.NeighborGroupDestination"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword destination: An array of destination IPv4 Addresses or IPv6 Addresses. - :paramtype destination: ~azure.mgmt.managednetworkfabric.models.NeighborGroupDestination - """ - super().__init__(tags=tags, location=location, **kwargs) - self.annotation = annotation - self.destination = destination - self.network_tap_ids = None - self.network_tap_rule_ids = None - self.provisioning_state = None - - -class NeighborGroupDestination(_serialization.Model): - """An array of destination IPv4 Addresses or IPv6 Addresses. - - :ivar ipv4_addresses: Array of IPv4 Addresses. - :vartype ipv4_addresses: list[str] - :ivar ipv6_addresses: Array of IPv6 Addresses. - :vartype ipv6_addresses: list[str] - """ - - _validation = { - "ipv4_addresses": {"max_items": 16, "min_items": 0}, - "ipv6_addresses": {"max_items": 16, "min_items": 0}, - } - - _attribute_map = { - "ipv4_addresses": {"key": "ipv4Addresses", "type": "[str]"}, - "ipv6_addresses": {"key": "ipv6Addresses", "type": "[str]"}, - } - - def __init__( - self, *, ipv4_addresses: Optional[List[str]] = None, ipv6_addresses: Optional[List[str]] = None, **kwargs: Any - ) -> None: - """ - :keyword ipv4_addresses: Array of IPv4 Addresses. - :paramtype ipv4_addresses: list[str] - :keyword ipv6_addresses: Array of IPv6 Addresses. - :paramtype ipv6_addresses: list[str] - """ - super().__init__(**kwargs) - self.ipv4_addresses = ipv4_addresses - self.ipv6_addresses = ipv6_addresses - - -class NeighborGroupPatch(TagsUpdate): - """The Neighbor Group Patch definition. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar destination: An array of destination IPv4 Addresses or IPv6 Addresses. - :vartype destination: ~azure.mgmt.managednetworkfabric.models.NeighborGroupDestination - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "annotation": {"key": "properties.annotation", "type": "str"}, - "destination": {"key": "properties.destination", "type": "NeighborGroupDestination"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - annotation: Optional[str] = None, - destination: Optional["_models.NeighborGroupDestination"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword destination: An array of destination IPv4 Addresses or IPv6 Addresses. - :paramtype destination: ~azure.mgmt.managednetworkfabric.models.NeighborGroupDestination - """ - super().__init__(tags=tags, **kwargs) - self.annotation = annotation - self.destination = destination - - -class NeighborGroupPatchableProperties(_serialization.Model): - """Neighbor Group Patchable Properties defines the patchable properties of the resource. - - :ivar destination: An array of destination IPv4 Addresses or IPv6 Addresses. - :vartype destination: ~azure.mgmt.managednetworkfabric.models.NeighborGroupDestination - """ - - _attribute_map = { - "destination": {"key": "destination", "type": "NeighborGroupDestination"}, - } - - def __init__(self, *, destination: Optional["_models.NeighborGroupDestination"] = None, **kwargs: Any) -> None: - """ - :keyword destination: An array of destination IPv4 Addresses or IPv6 Addresses. - :paramtype destination: ~azure.mgmt.managednetworkfabric.models.NeighborGroupDestination - """ - super().__init__(**kwargs) - self.destination = destination - - -class NeighborGroupPatchProperties(AnnotationResource, NeighborGroupPatchableProperties): - """Neighbor Group Patch properties. - - :ivar destination: An array of destination IPv4 Addresses or IPv6 Addresses. - :vartype destination: ~azure.mgmt.managednetworkfabric.models.NeighborGroupDestination - :ivar annotation: Switch configuration description. - :vartype annotation: str - """ - - _attribute_map = { - "destination": {"key": "destination", "type": "NeighborGroupDestination"}, - "annotation": {"key": "annotation", "type": "str"}, - } - - def __init__( - self, - *, - destination: Optional["_models.NeighborGroupDestination"] = None, - annotation: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword destination: An array of destination IPv4 Addresses or IPv6 Addresses. - :paramtype destination: ~azure.mgmt.managednetworkfabric.models.NeighborGroupDestination - :keyword annotation: Switch configuration description. - :paramtype annotation: str - """ - super().__init__(annotation=annotation, destination=destination, **kwargs) - self.destination = destination - self.annotation = annotation - - -class NeighborGroupProperties(AnnotationResource, NeighborGroupPatchableProperties): - """Neighbor Group Properties defines the properties of the resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar destination: An array of destination IPv4 Addresses or IPv6 Addresses. - :vartype destination: ~azure.mgmt.managednetworkfabric.models.NeighborGroupDestination - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar network_tap_ids: List of NetworkTap IDs where neighbor group is associated. - :vartype network_tap_ids: list[str] - :ivar network_tap_rule_ids: List of Network Tap Rule IDs where neighbor group is associated. - :vartype network_tap_rule_ids: list[str] - :ivar provisioning_state: The provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - """ - - _validation = { - "network_tap_ids": {"readonly": True}, - "network_tap_rule_ids": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "destination": {"key": "destination", "type": "NeighborGroupDestination"}, - "annotation": {"key": "annotation", "type": "str"}, - "network_tap_ids": {"key": "networkTapIds", "type": "[str]"}, - "network_tap_rule_ids": {"key": "networkTapRuleIds", "type": "[str]"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - } - - def __init__( - self, - *, - destination: Optional["_models.NeighborGroupDestination"] = None, - annotation: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword destination: An array of destination IPv4 Addresses or IPv6 Addresses. - :paramtype destination: ~azure.mgmt.managednetworkfabric.models.NeighborGroupDestination - :keyword annotation: Switch configuration description. - :paramtype annotation: str - """ - super().__init__(annotation=annotation, destination=destination, **kwargs) - self.destination = destination - self.network_tap_ids = None - self.network_tap_rule_ids = None - self.provisioning_state = None - self.annotation = annotation - - -class NeighborGroupsListResult(_serialization.Model): - """List of Neighbor Group. - - :ivar value: List of Neighbor Group resources. - :vartype value: list[~azure.mgmt.managednetworkfabric.models.NeighborGroup] - :ivar next_link: Url to follow for getting next page of resources. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[NeighborGroup]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: Optional[List["_models.NeighborGroup"]] = None, next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: List of Neighbor Group resources. - :paramtype value: list[~azure.mgmt.managednetworkfabric.models.NeighborGroup] - :keyword next_link: Url to follow for getting next page of resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class NetworkDevice(TrackedResource): # pylint: disable=too-many-instance-attributes - """The Network Device resource definition. - - 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 Azure. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar host_name: The host name of the device. - :vartype host_name: str - :ivar serial_number: Serial number of the device. Format of serial Number - - Make;Model;HardwareRevisionId;SerialNumber. - :vartype serial_number: str - :ivar version: Current version of the device as defined in SKU. - :vartype version: str - :ivar network_device_sku: Network Device SKU name. - :vartype network_device_sku: str - :ivar network_device_role: NetworkDeviceRole is the device role: Example: CE | ToR. Known - values are: "CE", "ToR", "NPB", "TS", and "Management". - :vartype network_device_role: str or ~azure.mgmt.managednetworkfabric.models.NetworkDeviceRole - :ivar network_rack_id: Reference to network rack resource id. - :vartype network_rack_id: str - :ivar management_ipv4_address: Management IPv4 Address. - :vartype management_ipv4_address: str - :ivar management_ipv6_address: Management IPv6 Address. - :vartype management_ipv6_address: str - :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", - "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", - "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", - "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.AdministrativeState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "host_name": {"min_length": 1}, - "serial_number": {"min_length": 1}, - "version": {"readonly": True}, - "network_device_role": {"readonly": True}, - "network_rack_id": {"readonly": True}, - "management_ipv4_address": {"readonly": True}, - "management_ipv6_address": {"readonly": True}, - "configuration_state": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "administrative_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "annotation": {"key": "properties.annotation", "type": "str"}, - "host_name": {"key": "properties.hostName", "type": "str"}, - "serial_number": {"key": "properties.serialNumber", "type": "str"}, - "version": {"key": "properties.version", "type": "str"}, - "network_device_sku": {"key": "properties.networkDeviceSku", "type": "str"}, - "network_device_role": {"key": "properties.networkDeviceRole", "type": "str"}, - "network_rack_id": {"key": "properties.networkRackId", "type": "str"}, - "management_ipv4_address": {"key": "properties.managementIpv4Address", "type": "str"}, - "management_ipv6_address": {"key": "properties.managementIpv6Address", "type": "str"}, - "configuration_state": {"key": "properties.configurationState", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "administrative_state": {"key": "properties.administrativeState", "type": "str"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - annotation: Optional[str] = None, - host_name: Optional[str] = None, - serial_number: Optional[str] = None, - network_device_sku: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword host_name: The host name of the device. - :paramtype host_name: str - :keyword serial_number: Serial number of the device. Format of serial Number - - Make;Model;HardwareRevisionId;SerialNumber. - :paramtype serial_number: str - :keyword network_device_sku: Network Device SKU name. - :paramtype network_device_sku: str - """ - super().__init__(tags=tags, location=location, **kwargs) - self.annotation = annotation - self.host_name = host_name - self.serial_number = serial_number - self.version = None - self.network_device_sku = network_device_sku - self.network_device_role = None - self.network_rack_id = None - self.management_ipv4_address = None - self.management_ipv6_address = None - self.configuration_state = None - self.provisioning_state = None - self.administrative_state = None - - -class NetworkDevicePatchableProperties(_serialization.Model): - """Network Device updatable properties. - - :ivar host_name: The host name of the device. - :vartype host_name: str - :ivar serial_number: Serial number of the device. Format of serial Number - - Make;Model;HardwareRevisionId;SerialNumber. - :vartype serial_number: str - """ - - _validation = { - "host_name": {"min_length": 1}, - "serial_number": {"min_length": 1}, - } - - _attribute_map = { - "host_name": {"key": "hostName", "type": "str"}, - "serial_number": {"key": "serialNumber", "type": "str"}, - } - - def __init__(self, *, host_name: Optional[str] = None, serial_number: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword host_name: The host name of the device. - :paramtype host_name: str - :keyword serial_number: Serial number of the device. Format of serial Number - - Make;Model;HardwareRevisionId;SerialNumber. - :paramtype serial_number: str - """ - super().__init__(**kwargs) - self.host_name = host_name - self.serial_number = serial_number - - -class NetworkDevicePatchParameters(TagsUpdate): - """The Network Device Patch Parameters defines the patch parameters of the resource. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar host_name: The host name of the device. - :vartype host_name: str - :ivar serial_number: Serial number of the device. Format of serial Number - - Make;Model;HardwareRevisionId;SerialNumber. - :vartype serial_number: str - """ - - _validation = { - "host_name": {"min_length": 1}, - "serial_number": {"min_length": 1}, - } - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "annotation": {"key": "properties.annotation", "type": "str"}, - "host_name": {"key": "properties.hostName", "type": "str"}, - "serial_number": {"key": "properties.serialNumber", "type": "str"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - annotation: Optional[str] = None, - host_name: Optional[str] = None, - serial_number: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword host_name: The host name of the device. - :paramtype host_name: str - :keyword serial_number: Serial number of the device. Format of serial Number - - Make;Model;HardwareRevisionId;SerialNumber. - :paramtype serial_number: str - """ - super().__init__(tags=tags, **kwargs) - self.annotation = annotation - self.host_name = host_name - self.serial_number = serial_number - - -class NetworkDevicePatchParametersProperties(AnnotationResource, NetworkDevicePatchableProperties): - """Network Device Patch properties. - - :ivar host_name: The host name of the device. - :vartype host_name: str - :ivar serial_number: Serial number of the device. Format of serial Number - - Make;Model;HardwareRevisionId;SerialNumber. - :vartype serial_number: str - :ivar annotation: Switch configuration description. - :vartype annotation: str - """ - - _validation = { - "host_name": {"min_length": 1}, - "serial_number": {"min_length": 1}, - } - - _attribute_map = { - "host_name": {"key": "hostName", "type": "str"}, - "serial_number": {"key": "serialNumber", "type": "str"}, - "annotation": {"key": "annotation", "type": "str"}, - } - - def __init__( - self, - *, - host_name: Optional[str] = None, - serial_number: Optional[str] = None, - annotation: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword host_name: The host name of the device. - :paramtype host_name: str - :keyword serial_number: Serial number of the device. Format of serial Number - - Make;Model;HardwareRevisionId;SerialNumber. - :paramtype serial_number: str - :keyword annotation: Switch configuration description. - :paramtype annotation: str - """ - super().__init__(annotation=annotation, host_name=host_name, serial_number=serial_number, **kwargs) - self.host_name = host_name - self.serial_number = serial_number - self.annotation = annotation - - -class NetworkDeviceProperties( - AnnotationResource, NetworkDevicePatchableProperties -): # pylint: disable=too-many-instance-attributes - """Network Device Properties defines the properties of the resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar host_name: The host name of the device. - :vartype host_name: str - :ivar serial_number: Serial number of the device. Format of serial Number - - Make;Model;HardwareRevisionId;SerialNumber. - :vartype serial_number: str - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar version: Current version of the device as defined in SKU. - :vartype version: str - :ivar network_device_sku: Network Device SKU name. - :vartype network_device_sku: str - :ivar network_device_role: NetworkDeviceRole is the device role: Example: CE | ToR. Known - values are: "CE", "ToR", "NPB", "TS", and "Management". - :vartype network_device_role: str or ~azure.mgmt.managednetworkfabric.models.NetworkDeviceRole - :ivar network_rack_id: Reference to network rack resource id. - :vartype network_rack_id: str - :ivar management_ipv4_address: Management IPv4 Address. - :vartype management_ipv4_address: str - :ivar management_ipv6_address: Management IPv6 Address. - :vartype management_ipv6_address: str - :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", - "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", - "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", - "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.AdministrativeState - """ - - _validation = { - "host_name": {"min_length": 1}, - "serial_number": {"min_length": 1}, - "version": {"readonly": True}, - "network_device_role": {"readonly": True}, - "network_rack_id": {"readonly": True}, - "management_ipv4_address": {"readonly": True}, - "management_ipv6_address": {"readonly": True}, - "configuration_state": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "administrative_state": {"readonly": True}, - } - - _attribute_map = { - "host_name": {"key": "hostName", "type": "str"}, - "serial_number": {"key": "serialNumber", "type": "str"}, - "annotation": {"key": "annotation", "type": "str"}, - "version": {"key": "version", "type": "str"}, - "network_device_sku": {"key": "networkDeviceSku", "type": "str"}, - "network_device_role": {"key": "networkDeviceRole", "type": "str"}, - "network_rack_id": {"key": "networkRackId", "type": "str"}, - "management_ipv4_address": {"key": "managementIpv4Address", "type": "str"}, - "management_ipv6_address": {"key": "managementIpv6Address", "type": "str"}, - "configuration_state": {"key": "configurationState", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "administrative_state": {"key": "administrativeState", "type": "str"}, - } - - def __init__( - self, - *, - host_name: Optional[str] = None, - serial_number: Optional[str] = None, - annotation: Optional[str] = None, - network_device_sku: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword host_name: The host name of the device. - :paramtype host_name: str - :keyword serial_number: Serial number of the device. Format of serial Number - - Make;Model;HardwareRevisionId;SerialNumber. - :paramtype serial_number: str - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword network_device_sku: Network Device SKU name. - :paramtype network_device_sku: str - """ - super().__init__(annotation=annotation, host_name=host_name, serial_number=serial_number, **kwargs) - self.host_name = host_name - self.serial_number = serial_number - self.version = None - self.network_device_sku = network_device_sku - self.network_device_role = None - self.network_rack_id = None - self.management_ipv4_address = None - self.management_ipv6_address = None - self.configuration_state = None - self.provisioning_state = None - self.administrative_state = None - self.annotation = annotation - - -class NetworkDeviceSku(ProxyResource): - """The NetworkDeviceSku resource definition. - - 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 Azure. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData - :ivar model: Model of the network device. Required. - :vartype model: str - :ivar manufacturer: Manufacturer of the network device. - :vartype manufacturer: str - :ivar supported_versions: List of supported version details of network device. - :vartype supported_versions: - list[~azure.mgmt.managednetworkfabric.models.SupportedVersionProperties] - :ivar supported_role_types: Available roles for the network device. - :vartype supported_role_types: list[str or - ~azure.mgmt.managednetworkfabric.models.NetworkDeviceRoleName] - :ivar interfaces: List of network device interfaces. - :vartype interfaces: list[~azure.mgmt.managednetworkfabric.models.DeviceInterfaceProperties] - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "model": {"required": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "model": {"key": "properties.model", "type": "str"}, - "manufacturer": {"key": "properties.manufacturer", "type": "str"}, - "supported_versions": {"key": "properties.supportedVersions", "type": "[SupportedVersionProperties]"}, - "supported_role_types": {"key": "properties.supportedRoleTypes", "type": "[str]"}, - "interfaces": {"key": "properties.interfaces", "type": "[DeviceInterfaceProperties]"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - } - - def __init__( - self, - *, - model: str, - manufacturer: Optional[str] = None, - supported_versions: Optional[List["_models.SupportedVersionProperties"]] = None, - supported_role_types: Optional[List[Union[str, "_models.NetworkDeviceRoleName"]]] = None, - interfaces: Optional[List["_models.DeviceInterfaceProperties"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword model: Model of the network device. Required. - :paramtype model: str - :keyword manufacturer: Manufacturer of the network device. - :paramtype manufacturer: str - :keyword supported_versions: List of supported version details of network device. - :paramtype supported_versions: - list[~azure.mgmt.managednetworkfabric.models.SupportedVersionProperties] - :keyword supported_role_types: Available roles for the network device. - :paramtype supported_role_types: list[str or - ~azure.mgmt.managednetworkfabric.models.NetworkDeviceRoleName] - :keyword interfaces: List of network device interfaces. - :paramtype interfaces: list[~azure.mgmt.managednetworkfabric.models.DeviceInterfaceProperties] - """ - super().__init__(**kwargs) - self.model = model - self.manufacturer = manufacturer - self.supported_versions = supported_versions - self.supported_role_types = supported_role_types - self.interfaces = interfaces - self.provisioning_state = None - - -class NetworkDeviceSkusListResult(_serialization.Model): - """List of Network Device SKUs. - - :ivar value: List of Network Device SKU resources. - :vartype value: list[~azure.mgmt.managednetworkfabric.models.NetworkDeviceSku] - :ivar next_link: Url to follow for getting next page of resources. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[NetworkDeviceSku]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, - *, - value: Optional[List["_models.NetworkDeviceSku"]] = None, - next_link: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword value: List of Network Device SKU resources. - :paramtype value: list[~azure.mgmt.managednetworkfabric.models.NetworkDeviceSku] - :keyword next_link: Url to follow for getting next page of resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class NetworkDevicesListResult(_serialization.Model): - """List of NetworkDevices. - - :ivar value: List of NetworkDevice resources. - :vartype value: list[~azure.mgmt.managednetworkfabric.models.NetworkDevice] - :ivar next_link: Url to follow for getting next page of resources. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[NetworkDevice]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: Optional[List["_models.NetworkDevice"]] = None, next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: List of NetworkDevice resources. - :paramtype value: list[~azure.mgmt.managednetworkfabric.models.NetworkDevice] - :keyword next_link: Url to follow for getting next page of resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class NetworkFabric(TrackedResource): # pylint: disable=too-many-instance-attributes - """The Network Fabric resource definition. - - 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 Azure. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar network_fabric_sku: Supported Network Fabric SKU.Example: Compute / Aggregate racks. Once - the user chooses a particular SKU, only supported racks can be added to the Network Fabric. The - SKU determines whether it is a single / multi rack Network Fabric. Required. - :vartype network_fabric_sku: str - :ivar fabric_version: The version of Network Fabric. - :vartype fabric_version: str - :ivar router_ids: Array of router IDs. - :vartype router_ids: list[str] - :ivar network_fabric_controller_id: Azure resource ID for the NetworkFabricController the - NetworkFabric belongs. Required. - :vartype network_fabric_controller_id: str - :ivar rack_count: Number of compute racks associated to Network Fabric. - :vartype rack_count: int - :ivar server_count_per_rack: Number of servers.Possible values are from 1-16. Required. - :vartype server_count_per_rack: int - :ivar ipv4_prefix: IPv4Prefix for Management Network. Example: 10.1.0.0/19. Required. - :vartype ipv4_prefix: str - :ivar ipv6_prefix: IPv6Prefix for Management Network. Example: 3FFE:FFFF:0:CD40::/59. - :vartype ipv6_prefix: str - :ivar fabric_asn: ASN of CE devices for CE/PE connectivity. Required. - :vartype fabric_asn: int - :ivar terminal_server_configuration: Network and credentials configuration currently applied to - terminal server. Required. - :vartype terminal_server_configuration: - ~azure.mgmt.managednetworkfabric.models.TerminalServerConfiguration - :ivar management_network_configuration: Configuration to be used to setup the management - network. Required. - :vartype management_network_configuration: - ~azure.mgmt.managednetworkfabric.models.ManagementNetworkConfigurationProperties - :ivar racks: List of NetworkRack resource IDs under the Network Fabric. The number of racks - allowed depends on the Network Fabric SKU. - :vartype racks: list[str] - :ivar l2_isolation_domains: List of L2 Isolation Domain resource IDs under the Network Fabric. - :vartype l2_isolation_domains: list[str] - :ivar l3_isolation_domains: List of L3 Isolation Domain resource IDs under the Network Fabric. - :vartype l3_isolation_domains: list[str] - :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", - "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", - "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - :ivar provisioning_state: Provides you the latest status of the NFC service, whether it is - Accepted, updating, Succeeded or Failed. During this process, the states keep changing based on - the status of NFC provisioning. Known values are: "Accepted", "Succeeded", "Updating", - "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", - "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.AdministrativeState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "network_fabric_sku": {"required": True, "min_length": 1}, - "fabric_version": {"readonly": True}, - "router_ids": {"readonly": True}, - "network_fabric_controller_id": {"required": True}, - "rack_count": {"maximum": 8, "minimum": 1}, - "server_count_per_rack": {"required": True, "maximum": 16, "minimum": 1}, - "ipv4_prefix": {"required": True, "min_length": 1}, - "ipv6_prefix": {"min_length": 1}, - "fabric_asn": {"required": True, "maximum": 4294967295, "minimum": 1}, - "terminal_server_configuration": {"required": True}, - "management_network_configuration": {"required": True}, - "racks": {"readonly": True}, - "l2_isolation_domains": {"readonly": True}, - "l3_isolation_domains": {"readonly": True}, - "configuration_state": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "administrative_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "annotation": {"key": "properties.annotation", "type": "str"}, - "network_fabric_sku": {"key": "properties.networkFabricSku", "type": "str"}, - "fabric_version": {"key": "properties.fabricVersion", "type": "str"}, - "router_ids": {"key": "properties.routerIds", "type": "[str]"}, - "network_fabric_controller_id": {"key": "properties.networkFabricControllerId", "type": "str"}, - "rack_count": {"key": "properties.rackCount", "type": "int"}, - "server_count_per_rack": {"key": "properties.serverCountPerRack", "type": "int"}, - "ipv4_prefix": {"key": "properties.ipv4Prefix", "type": "str"}, - "ipv6_prefix": {"key": "properties.ipv6Prefix", "type": "str"}, - "fabric_asn": {"key": "properties.fabricASN", "type": "int"}, - "terminal_server_configuration": { - "key": "properties.terminalServerConfiguration", - "type": "TerminalServerConfiguration", - }, - "management_network_configuration": { - "key": "properties.managementNetworkConfiguration", - "type": "ManagementNetworkConfigurationProperties", - }, - "racks": {"key": "properties.racks", "type": "[str]"}, - "l2_isolation_domains": {"key": "properties.l2IsolationDomains", "type": "[str]"}, - "l3_isolation_domains": {"key": "properties.l3IsolationDomains", "type": "[str]"}, - "configuration_state": {"key": "properties.configurationState", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "administrative_state": {"key": "properties.administrativeState", "type": "str"}, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - location: str, - network_fabric_sku: str, - network_fabric_controller_id: str, - server_count_per_rack: int, - ipv4_prefix: str, - fabric_asn: int, - terminal_server_configuration: "_models.TerminalServerConfiguration", - management_network_configuration: "_models.ManagementNetworkConfigurationProperties", - tags: Optional[Dict[str, str]] = None, - annotation: Optional[str] = None, - rack_count: Optional[int] = None, - ipv6_prefix: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword network_fabric_sku: Supported Network Fabric SKU.Example: Compute / Aggregate racks. - Once the user chooses a particular SKU, only supported racks can be added to the Network - Fabric. The SKU determines whether it is a single / multi rack Network Fabric. Required. - :paramtype network_fabric_sku: str - :keyword network_fabric_controller_id: Azure resource ID for the NetworkFabricController the - NetworkFabric belongs. Required. - :paramtype network_fabric_controller_id: str - :keyword rack_count: Number of compute racks associated to Network Fabric. - :paramtype rack_count: int - :keyword server_count_per_rack: Number of servers.Possible values are from 1-16. Required. - :paramtype server_count_per_rack: int - :keyword ipv4_prefix: IPv4Prefix for Management Network. Example: 10.1.0.0/19. Required. - :paramtype ipv4_prefix: str - :keyword ipv6_prefix: IPv6Prefix for Management Network. Example: 3FFE:FFFF:0:CD40::/59. - :paramtype ipv6_prefix: str - :keyword fabric_asn: ASN of CE devices for CE/PE connectivity. Required. - :paramtype fabric_asn: int - :keyword terminal_server_configuration: Network and credentials configuration currently applied - to terminal server. Required. - :paramtype terminal_server_configuration: - ~azure.mgmt.managednetworkfabric.models.TerminalServerConfiguration - :keyword management_network_configuration: Configuration to be used to setup the management - network. Required. - :paramtype management_network_configuration: - ~azure.mgmt.managednetworkfabric.models.ManagementNetworkConfigurationProperties - """ - super().__init__(tags=tags, location=location, **kwargs) - self.annotation = annotation - self.network_fabric_sku = network_fabric_sku - self.fabric_version = None - self.router_ids = None - self.network_fabric_controller_id = network_fabric_controller_id - self.rack_count = rack_count - self.server_count_per_rack = server_count_per_rack - self.ipv4_prefix = ipv4_prefix - self.ipv6_prefix = ipv6_prefix - self.fabric_asn = fabric_asn - self.terminal_server_configuration = terminal_server_configuration - self.management_network_configuration = management_network_configuration - self.racks = None - self.l2_isolation_domains = None - self.l3_isolation_domains = None - self.configuration_state = None - self.provisioning_state = None - self.administrative_state = None - - -class NetworkFabricController(TrackedResource): # pylint: disable=too-many-instance-attributes - """The Network Fabric Controller resource definition. - - 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 Azure. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar infrastructure_express_route_connections: As part of an update, the Infrastructure - ExpressRoute CircuitID should be provided to create and Provision a NFC. This Express route is - dedicated for Infrastructure services. (This is a Mandatory attribute). - :vartype infrastructure_express_route_connections: - list[~azure.mgmt.managednetworkfabric.models.ExpressRouteConnectionInformation] - :ivar workload_express_route_connections: As part of an update, the workload ExpressRoute - CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for - Workload services. (This is a Mandatory attribute). - :vartype workload_express_route_connections: - list[~azure.mgmt.managednetworkfabric.models.ExpressRouteConnectionInformation] - :ivar infrastructure_services: InfrastructureServices IP ranges. - :vartype infrastructure_services: ~azure.mgmt.managednetworkfabric.models.ControllerServices - :ivar workload_services: WorkloadServices IP ranges. - :vartype workload_services: ~azure.mgmt.managednetworkfabric.models.ControllerServices - :ivar managed_resource_group_configuration: Managed Resource Group configuration properties. - :vartype managed_resource_group_configuration: - ~azure.mgmt.managednetworkfabric.models.ManagedResourceGroupConfiguration - :ivar network_fabric_ids: The NF-ID will be an input parameter used by the NF to link and get - associated with the parent NFC Service. - :vartype network_fabric_ids: list[str] - :ivar workload_management_network: A workload management network is required for all the tenant - (workload) traffic. This traffic is only dedicated for Tenant workloads which are required to - access internet or any other MSFT/Public endpoints. This is used for the backward - compatibility. - :vartype workload_management_network: bool - :ivar is_workload_management_network_enabled: A workload management network is required for all - the tenant (workload) traffic. This traffic is only dedicated for Tenant workloads which are - required to access internet or any other MSFT/Public endpoints. Known values are: "True" and - "False". - :vartype is_workload_management_network_enabled: str or - ~azure.mgmt.managednetworkfabric.models.IsWorkloadManagementNetworkEnabled - :ivar tenant_internet_gateway_ids: List of tenant InternetGateway resource IDs. - :vartype tenant_internet_gateway_ids: list[str] - :ivar ipv4_address_space: IPv4 Network Fabric Controller Address Space. - :vartype ipv4_address_space: str - :ivar ipv6_address_space: IPv6 Network Fabric Controller Address Space. - :vartype ipv6_address_space: str - :ivar nfc_sku: Network Fabric Controller SKU. Known values are: "Basic", "Standard", and - "HighPerformance". - :vartype nfc_sku: str or ~azure.mgmt.managednetworkfabric.models.NfcSku - :ivar provisioning_state: Provides you the latest status of the NFC service, whether it is - Accepted, updating, Succeeded or Failed. During this process, the states keep changing based on - the status of NFC provisioning. Known values are: "Accepted", "Succeeded", "Updating", - "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "infrastructure_services": {"readonly": True}, - "workload_services": {"readonly": True}, - "network_fabric_ids": {"readonly": True}, - "workload_management_network": {"readonly": True}, - "tenant_internet_gateway_ids": {"readonly": True}, - "ipv4_address_space": {"min_length": 1}, - "ipv6_address_space": {"min_length": 1}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "annotation": {"key": "properties.annotation", "type": "str"}, - "infrastructure_express_route_connections": { - "key": "properties.infrastructureExpressRouteConnections", - "type": "[ExpressRouteConnectionInformation]", - }, - "workload_express_route_connections": { - "key": "properties.workloadExpressRouteConnections", - "type": "[ExpressRouteConnectionInformation]", - }, - "infrastructure_services": {"key": "properties.infrastructureServices", "type": "ControllerServices"}, - "workload_services": {"key": "properties.workloadServices", "type": "ControllerServices"}, - "managed_resource_group_configuration": { - "key": "properties.managedResourceGroupConfiguration", - "type": "ManagedResourceGroupConfiguration", - }, - "network_fabric_ids": {"key": "properties.networkFabricIds", "type": "[str]"}, - "workload_management_network": {"key": "properties.workloadManagementNetwork", "type": "bool"}, - "is_workload_management_network_enabled": { - "key": "properties.isWorkloadManagementNetworkEnabled", - "type": "str", - }, - "tenant_internet_gateway_ids": {"key": "properties.tenantInternetGatewayIds", "type": "[str]"}, - "ipv4_address_space": {"key": "properties.ipv4AddressSpace", "type": "str"}, - "ipv6_address_space": {"key": "properties.ipv6AddressSpace", "type": "str"}, - "nfc_sku": {"key": "properties.nfcSku", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - annotation: Optional[str] = None, - infrastructure_express_route_connections: Optional[List["_models.ExpressRouteConnectionInformation"]] = None, - workload_express_route_connections: Optional[List["_models.ExpressRouteConnectionInformation"]] = None, - managed_resource_group_configuration: Optional["_models.ManagedResourceGroupConfiguration"] = None, - is_workload_management_network_enabled: Union[str, "_models.IsWorkloadManagementNetworkEnabled"] = "True", - ipv4_address_space: str = "10.0.0.0/19", - ipv6_address_space: str = "FC00::/59", - nfc_sku: Union[str, "_models.NfcSku"] = "Standard", - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword infrastructure_express_route_connections: As part of an update, the Infrastructure - ExpressRoute CircuitID should be provided to create and Provision a NFC. This Express route is - dedicated for Infrastructure services. (This is a Mandatory attribute). - :paramtype infrastructure_express_route_connections: - list[~azure.mgmt.managednetworkfabric.models.ExpressRouteConnectionInformation] - :keyword workload_express_route_connections: As part of an update, the workload ExpressRoute - CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for - Workload services. (This is a Mandatory attribute). - :paramtype workload_express_route_connections: - list[~azure.mgmt.managednetworkfabric.models.ExpressRouteConnectionInformation] - :keyword managed_resource_group_configuration: Managed Resource Group configuration properties. - :paramtype managed_resource_group_configuration: - ~azure.mgmt.managednetworkfabric.models.ManagedResourceGroupConfiguration - :keyword is_workload_management_network_enabled: A workload management network is required for - all the tenant (workload) traffic. This traffic is only dedicated for Tenant workloads which - are required to access internet or any other MSFT/Public endpoints. Known values are: "True" - and "False". - :paramtype is_workload_management_network_enabled: str or - ~azure.mgmt.managednetworkfabric.models.IsWorkloadManagementNetworkEnabled - :keyword ipv4_address_space: IPv4 Network Fabric Controller Address Space. - :paramtype ipv4_address_space: str - :keyword ipv6_address_space: IPv6 Network Fabric Controller Address Space. - :paramtype ipv6_address_space: str - :keyword nfc_sku: Network Fabric Controller SKU. Known values are: "Basic", "Standard", and - "HighPerformance". - :paramtype nfc_sku: str or ~azure.mgmt.managednetworkfabric.models.NfcSku - """ - super().__init__(tags=tags, location=location, **kwargs) - self.annotation = annotation - self.infrastructure_express_route_connections = infrastructure_express_route_connections - self.workload_express_route_connections = workload_express_route_connections - self.infrastructure_services = None - self.workload_services = None - self.managed_resource_group_configuration = managed_resource_group_configuration - self.network_fabric_ids = None - self.workload_management_network = None - self.is_workload_management_network_enabled = is_workload_management_network_enabled - self.tenant_internet_gateway_ids = None - self.ipv4_address_space = ipv4_address_space - self.ipv6_address_space = ipv6_address_space - self.nfc_sku = nfc_sku - self.provisioning_state = None - - -class NetworkFabricControllerPatch(TagsUpdate): - """The Network Fabric Controller Patch payload definition. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar infrastructure_express_route_connections: As part of an update, the Infrastructure - ExpressRoute CircuitID should be provided to create and Provision a NFC. This Express route is - dedicated for Infrastructure services. (This is a Mandatory attribute). - :vartype infrastructure_express_route_connections: - list[~azure.mgmt.managednetworkfabric.models.ExpressRouteConnectionInformation] - :ivar workload_express_route_connections: As part of an update, the workload ExpressRoute - CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for - Workload services. (This is a Mandatory attribute). - :vartype workload_express_route_connections: - list[~azure.mgmt.managednetworkfabric.models.ExpressRouteConnectionInformation] - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "infrastructure_express_route_connections": { - "key": "properties.infrastructureExpressRouteConnections", - "type": "[ExpressRouteConnectionInformation]", - }, - "workload_express_route_connections": { - "key": "properties.workloadExpressRouteConnections", - "type": "[ExpressRouteConnectionInformation]", - }, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - infrastructure_express_route_connections: Optional[List["_models.ExpressRouteConnectionInformation"]] = None, - workload_express_route_connections: Optional[List["_models.ExpressRouteConnectionInformation"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword infrastructure_express_route_connections: As part of an update, the Infrastructure - ExpressRoute CircuitID should be provided to create and Provision a NFC. This Express route is - dedicated for Infrastructure services. (This is a Mandatory attribute). - :paramtype infrastructure_express_route_connections: - list[~azure.mgmt.managednetworkfabric.models.ExpressRouteConnectionInformation] - :keyword workload_express_route_connections: As part of an update, the workload ExpressRoute - CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for - Workload services. (This is a Mandatory attribute). - :paramtype workload_express_route_connections: - list[~azure.mgmt.managednetworkfabric.models.ExpressRouteConnectionInformation] - """ - super().__init__(tags=tags, **kwargs) - self.infrastructure_express_route_connections = infrastructure_express_route_connections - self.workload_express_route_connections = workload_express_route_connections - - -class NetworkFabricControllerPatchableProperties(_serialization.Model): - """Network Fabric Controller updatable properties. - - :ivar infrastructure_express_route_connections: As part of an update, the Infrastructure - ExpressRoute CircuitID should be provided to create and Provision a NFC. This Express route is - dedicated for Infrastructure services. (This is a Mandatory attribute). - :vartype infrastructure_express_route_connections: - list[~azure.mgmt.managednetworkfabric.models.ExpressRouteConnectionInformation] - :ivar workload_express_route_connections: As part of an update, the workload ExpressRoute - CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for - Workload services. (This is a Mandatory attribute). - :vartype workload_express_route_connections: - list[~azure.mgmt.managednetworkfabric.models.ExpressRouteConnectionInformation] - """ - - _attribute_map = { - "infrastructure_express_route_connections": { - "key": "infrastructureExpressRouteConnections", - "type": "[ExpressRouteConnectionInformation]", - }, - "workload_express_route_connections": { - "key": "workloadExpressRouteConnections", - "type": "[ExpressRouteConnectionInformation]", - }, - } - - def __init__( - self, - *, - infrastructure_express_route_connections: Optional[List["_models.ExpressRouteConnectionInformation"]] = None, - workload_express_route_connections: Optional[List["_models.ExpressRouteConnectionInformation"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword infrastructure_express_route_connections: As part of an update, the Infrastructure - ExpressRoute CircuitID should be provided to create and Provision a NFC. This Express route is - dedicated for Infrastructure services. (This is a Mandatory attribute). - :paramtype infrastructure_express_route_connections: - list[~azure.mgmt.managednetworkfabric.models.ExpressRouteConnectionInformation] - :keyword workload_express_route_connections: As part of an update, the workload ExpressRoute - CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for - Workload services. (This is a Mandatory attribute). - :paramtype workload_express_route_connections: - list[~azure.mgmt.managednetworkfabric.models.ExpressRouteConnectionInformation] - """ - super().__init__(**kwargs) - self.infrastructure_express_route_connections = infrastructure_express_route_connections - self.workload_express_route_connections = workload_express_route_connections - - -class NetworkFabricControllerProperties( - AnnotationResource, NetworkFabricControllerPatchableProperties -): # pylint: disable=too-many-instance-attributes - """NetworkFabricControllerProperties defines the resource properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar infrastructure_express_route_connections: As part of an update, the Infrastructure - ExpressRoute CircuitID should be provided to create and Provision a NFC. This Express route is - dedicated for Infrastructure services. (This is a Mandatory attribute). - :vartype infrastructure_express_route_connections: - list[~azure.mgmt.managednetworkfabric.models.ExpressRouteConnectionInformation] - :ivar workload_express_route_connections: As part of an update, the workload ExpressRoute - CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for - Workload services. (This is a Mandatory attribute). - :vartype workload_express_route_connections: - list[~azure.mgmt.managednetworkfabric.models.ExpressRouteConnectionInformation] - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar infrastructure_services: InfrastructureServices IP ranges. - :vartype infrastructure_services: ~azure.mgmt.managednetworkfabric.models.ControllerServices - :ivar workload_services: WorkloadServices IP ranges. - :vartype workload_services: ~azure.mgmt.managednetworkfabric.models.ControllerServices - :ivar managed_resource_group_configuration: Managed Resource Group configuration properties. - :vartype managed_resource_group_configuration: - ~azure.mgmt.managednetworkfabric.models.ManagedResourceGroupConfiguration - :ivar network_fabric_ids: The NF-ID will be an input parameter used by the NF to link and get - associated with the parent NFC Service. - :vartype network_fabric_ids: list[str] - :ivar workload_management_network: A workload management network is required for all the tenant - (workload) traffic. This traffic is only dedicated for Tenant workloads which are required to - access internet or any other MSFT/Public endpoints. This is used for the backward - compatibility. - :vartype workload_management_network: bool - :ivar is_workload_management_network_enabled: A workload management network is required for all - the tenant (workload) traffic. This traffic is only dedicated for Tenant workloads which are - required to access internet or any other MSFT/Public endpoints. Known values are: "True" and - "False". - :vartype is_workload_management_network_enabled: str or - ~azure.mgmt.managednetworkfabric.models.IsWorkloadManagementNetworkEnabled - :ivar tenant_internet_gateway_ids: List of tenant InternetGateway resource IDs. - :vartype tenant_internet_gateway_ids: list[str] - :ivar ipv4_address_space: IPv4 Network Fabric Controller Address Space. - :vartype ipv4_address_space: str - :ivar ipv6_address_space: IPv6 Network Fabric Controller Address Space. - :vartype ipv6_address_space: str - :ivar nfc_sku: Network Fabric Controller SKU. Known values are: "Basic", "Standard", and - "HighPerformance". - :vartype nfc_sku: str or ~azure.mgmt.managednetworkfabric.models.NfcSku - :ivar provisioning_state: Provides you the latest status of the NFC service, whether it is - Accepted, updating, Succeeded or Failed. During this process, the states keep changing based on - the status of NFC provisioning. Known values are: "Accepted", "Succeeded", "Updating", - "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - """ - - _validation = { - "infrastructure_services": {"readonly": True}, - "workload_services": {"readonly": True}, - "network_fabric_ids": {"readonly": True}, - "workload_management_network": {"readonly": True}, - "tenant_internet_gateway_ids": {"readonly": True}, - "ipv4_address_space": {"min_length": 1}, - "ipv6_address_space": {"min_length": 1}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "infrastructure_express_route_connections": { - "key": "infrastructureExpressRouteConnections", - "type": "[ExpressRouteConnectionInformation]", - }, - "workload_express_route_connections": { - "key": "workloadExpressRouteConnections", - "type": "[ExpressRouteConnectionInformation]", - }, - "annotation": {"key": "annotation", "type": "str"}, - "infrastructure_services": {"key": "infrastructureServices", "type": "ControllerServices"}, - "workload_services": {"key": "workloadServices", "type": "ControllerServices"}, - "managed_resource_group_configuration": { - "key": "managedResourceGroupConfiguration", - "type": "ManagedResourceGroupConfiguration", - }, - "network_fabric_ids": {"key": "networkFabricIds", "type": "[str]"}, - "workload_management_network": {"key": "workloadManagementNetwork", "type": "bool"}, - "is_workload_management_network_enabled": {"key": "isWorkloadManagementNetworkEnabled", "type": "str"}, - "tenant_internet_gateway_ids": {"key": "tenantInternetGatewayIds", "type": "[str]"}, - "ipv4_address_space": {"key": "ipv4AddressSpace", "type": "str"}, - "ipv6_address_space": {"key": "ipv6AddressSpace", "type": "str"}, - "nfc_sku": {"key": "nfcSku", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - } - - def __init__( - self, - *, - infrastructure_express_route_connections: Optional[List["_models.ExpressRouteConnectionInformation"]] = None, - workload_express_route_connections: Optional[List["_models.ExpressRouteConnectionInformation"]] = None, - annotation: Optional[str] = None, - managed_resource_group_configuration: Optional["_models.ManagedResourceGroupConfiguration"] = None, - is_workload_management_network_enabled: Union[str, "_models.IsWorkloadManagementNetworkEnabled"] = "True", - ipv4_address_space: str = "10.0.0.0/19", - ipv6_address_space: str = "FC00::/59", - nfc_sku: Union[str, "_models.NfcSku"] = "Standard", - **kwargs: Any - ) -> None: - """ - :keyword infrastructure_express_route_connections: As part of an update, the Infrastructure - ExpressRoute CircuitID should be provided to create and Provision a NFC. This Express route is - dedicated for Infrastructure services. (This is a Mandatory attribute). - :paramtype infrastructure_express_route_connections: - list[~azure.mgmt.managednetworkfabric.models.ExpressRouteConnectionInformation] - :keyword workload_express_route_connections: As part of an update, the workload ExpressRoute - CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for - Workload services. (This is a Mandatory attribute). - :paramtype workload_express_route_connections: - list[~azure.mgmt.managednetworkfabric.models.ExpressRouteConnectionInformation] - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword managed_resource_group_configuration: Managed Resource Group configuration properties. - :paramtype managed_resource_group_configuration: - ~azure.mgmt.managednetworkfabric.models.ManagedResourceGroupConfiguration - :keyword is_workload_management_network_enabled: A workload management network is required for - all the tenant (workload) traffic. This traffic is only dedicated for Tenant workloads which - are required to access internet or any other MSFT/Public endpoints. Known values are: "True" - and "False". - :paramtype is_workload_management_network_enabled: str or - ~azure.mgmt.managednetworkfabric.models.IsWorkloadManagementNetworkEnabled - :keyword ipv4_address_space: IPv4 Network Fabric Controller Address Space. - :paramtype ipv4_address_space: str - :keyword ipv6_address_space: IPv6 Network Fabric Controller Address Space. - :paramtype ipv6_address_space: str - :keyword nfc_sku: Network Fabric Controller SKU. Known values are: "Basic", "Standard", and - "HighPerformance". - :paramtype nfc_sku: str or ~azure.mgmt.managednetworkfabric.models.NfcSku - """ - super().__init__( - annotation=annotation, - infrastructure_express_route_connections=infrastructure_express_route_connections, - workload_express_route_connections=workload_express_route_connections, - **kwargs - ) - self.infrastructure_express_route_connections = infrastructure_express_route_connections - self.workload_express_route_connections = workload_express_route_connections - self.infrastructure_services = None - self.workload_services = None - self.managed_resource_group_configuration = managed_resource_group_configuration - self.network_fabric_ids = None - self.workload_management_network = None - self.is_workload_management_network_enabled = is_workload_management_network_enabled - self.tenant_internet_gateway_ids = None - self.ipv4_address_space = ipv4_address_space - self.ipv6_address_space = ipv6_address_space - self.nfc_sku = nfc_sku - self.provisioning_state = None - self.annotation = annotation - - -class NetworkFabricControllersListResult(_serialization.Model): - """List of Network Fabric Controllers. - - :ivar value: List of Network Fabric Controller resources. - :vartype value: list[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] - :ivar next_link: Url to follow for getting next page of resources. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[NetworkFabricController]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, - *, - value: Optional[List["_models.NetworkFabricController"]] = None, - next_link: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword value: List of Network Fabric Controller resources. - :paramtype value: list[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] - :keyword next_link: Url to follow for getting next page of resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class NetworkFabricPatch(TagsUpdate): - """The Network Fabric resource definition. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar rack_count: Number of compute racks associated to Network Fabric. - :vartype rack_count: int - :ivar server_count_per_rack: Number of servers.Possible values are from 1-16. - :vartype server_count_per_rack: int - :ivar ipv4_prefix: IPv4Prefix for Management Network. Example: 10.1.0.0/19. - :vartype ipv4_prefix: str - :ivar ipv6_prefix: IPv6Prefix for Management Network. Example: 3FFE:FFFF:0:CD40::/59. - :vartype ipv6_prefix: str - :ivar fabric_asn: ASN of CE devices for CE/PE connectivity. - :vartype fabric_asn: int - :ivar terminal_server_configuration: Network and credentials configuration already applied to - terminal server. - :vartype terminal_server_configuration: - ~azure.mgmt.managednetworkfabric.models.NetworkFabricPatchablePropertiesTerminalServerConfiguration - :ivar management_network_configuration: Configuration to be used to setup the management - network. - :vartype management_network_configuration: - ~azure.mgmt.managednetworkfabric.models.ManagementNetworkConfigurationPatchableProperties - """ - - _validation = { - "rack_count": {"maximum": 8, "minimum": 1}, - "server_count_per_rack": {"maximum": 16, "minimum": 1}, - "ipv4_prefix": {"min_length": 1}, - "ipv6_prefix": {"min_length": 1}, - "fabric_asn": {"maximum": 4294967295, "minimum": 1}, - } - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "annotation": {"key": "properties.annotation", "type": "str"}, - "rack_count": {"key": "properties.rackCount", "type": "int"}, - "server_count_per_rack": {"key": "properties.serverCountPerRack", "type": "int"}, - "ipv4_prefix": {"key": "properties.ipv4Prefix", "type": "str"}, - "ipv6_prefix": {"key": "properties.ipv6Prefix", "type": "str"}, - "fabric_asn": {"key": "properties.fabricASN", "type": "int"}, - "terminal_server_configuration": { - "key": "properties.terminalServerConfiguration", - "type": "NetworkFabricPatchablePropertiesTerminalServerConfiguration", - }, - "management_network_configuration": { - "key": "properties.managementNetworkConfiguration", - "type": "ManagementNetworkConfigurationPatchableProperties", - }, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - annotation: Optional[str] = None, - rack_count: Optional[int] = None, - server_count_per_rack: Optional[int] = None, - ipv4_prefix: Optional[str] = None, - ipv6_prefix: Optional[str] = None, - fabric_asn: Optional[int] = None, - terminal_server_configuration: Optional[ - "_models.NetworkFabricPatchablePropertiesTerminalServerConfiguration" - ] = None, - management_network_configuration: Optional["_models.ManagementNetworkConfigurationPatchableProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword rack_count: Number of compute racks associated to Network Fabric. - :paramtype rack_count: int - :keyword server_count_per_rack: Number of servers.Possible values are from 1-16. - :paramtype server_count_per_rack: int - :keyword ipv4_prefix: IPv4Prefix for Management Network. Example: 10.1.0.0/19. - :paramtype ipv4_prefix: str - :keyword ipv6_prefix: IPv6Prefix for Management Network. Example: 3FFE:FFFF:0:CD40::/59. - :paramtype ipv6_prefix: str - :keyword fabric_asn: ASN of CE devices for CE/PE connectivity. - :paramtype fabric_asn: int - :keyword terminal_server_configuration: Network and credentials configuration already applied - to terminal server. - :paramtype terminal_server_configuration: - ~azure.mgmt.managednetworkfabric.models.NetworkFabricPatchablePropertiesTerminalServerConfiguration - :keyword management_network_configuration: Configuration to be used to setup the management - network. - :paramtype management_network_configuration: - ~azure.mgmt.managednetworkfabric.models.ManagementNetworkConfigurationPatchableProperties - """ - super().__init__(tags=tags, **kwargs) - self.annotation = annotation - self.rack_count = rack_count - self.server_count_per_rack = server_count_per_rack - self.ipv4_prefix = ipv4_prefix - self.ipv6_prefix = ipv6_prefix - self.fabric_asn = fabric_asn - self.terminal_server_configuration = terminal_server_configuration - self.management_network_configuration = management_network_configuration - - -class NetworkFabricPatchableProperties(_serialization.Model): - """Network Fabric updatable properties. - - :ivar rack_count: Number of compute racks associated to Network Fabric. - :vartype rack_count: int - :ivar server_count_per_rack: Number of servers.Possible values are from 1-16. - :vartype server_count_per_rack: int - :ivar ipv4_prefix: IPv4Prefix for Management Network. Example: 10.1.0.0/19. - :vartype ipv4_prefix: str - :ivar ipv6_prefix: IPv6Prefix for Management Network. Example: 3FFE:FFFF:0:CD40::/59. - :vartype ipv6_prefix: str - :ivar fabric_asn: ASN of CE devices for CE/PE connectivity. - :vartype fabric_asn: int - :ivar terminal_server_configuration: Network and credentials configuration already applied to - terminal server. - :vartype terminal_server_configuration: - ~azure.mgmt.managednetworkfabric.models.NetworkFabricPatchablePropertiesTerminalServerConfiguration - :ivar management_network_configuration: Configuration to be used to setup the management - network. - :vartype management_network_configuration: - ~azure.mgmt.managednetworkfabric.models.ManagementNetworkConfigurationPatchableProperties - """ - - _validation = { - "rack_count": {"maximum": 8, "minimum": 1}, - "server_count_per_rack": {"maximum": 16, "minimum": 1}, - "ipv4_prefix": {"min_length": 1}, - "ipv6_prefix": {"min_length": 1}, - "fabric_asn": {"maximum": 4294967295, "minimum": 1}, - } - - _attribute_map = { - "rack_count": {"key": "rackCount", "type": "int"}, - "server_count_per_rack": {"key": "serverCountPerRack", "type": "int"}, - "ipv4_prefix": {"key": "ipv4Prefix", "type": "str"}, - "ipv6_prefix": {"key": "ipv6Prefix", "type": "str"}, - "fabric_asn": {"key": "fabricASN", "type": "int"}, - "terminal_server_configuration": { - "key": "terminalServerConfiguration", - "type": "NetworkFabricPatchablePropertiesTerminalServerConfiguration", - }, - "management_network_configuration": { - "key": "managementNetworkConfiguration", - "type": "ManagementNetworkConfigurationPatchableProperties", - }, - } - - def __init__( - self, - *, - rack_count: Optional[int] = None, - server_count_per_rack: Optional[int] = None, - ipv4_prefix: Optional[str] = None, - ipv6_prefix: Optional[str] = None, - fabric_asn: Optional[int] = None, - terminal_server_configuration: Optional[ - "_models.NetworkFabricPatchablePropertiesTerminalServerConfiguration" - ] = None, - management_network_configuration: Optional["_models.ManagementNetworkConfigurationPatchableProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword rack_count: Number of compute racks associated to Network Fabric. - :paramtype rack_count: int - :keyword server_count_per_rack: Number of servers.Possible values are from 1-16. - :paramtype server_count_per_rack: int - :keyword ipv4_prefix: IPv4Prefix for Management Network. Example: 10.1.0.0/19. - :paramtype ipv4_prefix: str - :keyword ipv6_prefix: IPv6Prefix for Management Network. Example: 3FFE:FFFF:0:CD40::/59. - :paramtype ipv6_prefix: str - :keyword fabric_asn: ASN of CE devices for CE/PE connectivity. - :paramtype fabric_asn: int - :keyword terminal_server_configuration: Network and credentials configuration already applied - to terminal server. - :paramtype terminal_server_configuration: - ~azure.mgmt.managednetworkfabric.models.NetworkFabricPatchablePropertiesTerminalServerConfiguration - :keyword management_network_configuration: Configuration to be used to setup the management - network. - :paramtype management_network_configuration: - ~azure.mgmt.managednetworkfabric.models.ManagementNetworkConfigurationPatchableProperties - """ - super().__init__(**kwargs) - self.rack_count = rack_count - self.server_count_per_rack = server_count_per_rack - self.ipv4_prefix = ipv4_prefix - self.ipv6_prefix = ipv6_prefix - self.fabric_asn = fabric_asn - self.terminal_server_configuration = terminal_server_configuration - self.management_network_configuration = management_network_configuration - - -class TerminalServerPatchableProperties(_serialization.Model): - """Network and credential configuration currently applied on terminal server. - - :ivar username: Username for the terminal server connection. - :vartype username: str - :ivar password: Password for the terminal server connection. - :vartype password: str - :ivar serial_number: Serial Number of Terminal server. - :vartype serial_number: str - """ - - _validation = { - "username": {"min_length": 1}, - "password": {"min_length": 1}, - "serial_number": {"min_length": 1}, - } - - _attribute_map = { - "username": {"key": "username", "type": "str"}, - "password": {"key": "password", "type": "str"}, - "serial_number": {"key": "serialNumber", "type": "str"}, - } - - def __init__( - self, - *, - username: Optional[str] = None, - password: Optional[str] = None, - serial_number: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword username: Username for the terminal server connection. - :paramtype username: str - :keyword password: Password for the terminal server connection. - :paramtype password: str - :keyword serial_number: Serial Number of Terminal server. - :paramtype serial_number: str - """ - super().__init__(**kwargs) - self.username = username - self.password = password - self.serial_number = serial_number - - -class NetworkFabricPatchablePropertiesTerminalServerConfiguration( - TerminalServerPatchableProperties, Layer3IpPrefixProperties -): - """Network and credentials configuration already applied to terminal server. - - :ivar primary_ipv4_prefix: IPv4 Address Prefix. - :vartype primary_ipv4_prefix: str - :ivar primary_ipv6_prefix: IPv6 Address Prefix. - :vartype primary_ipv6_prefix: str - :ivar secondary_ipv4_prefix: Secondary IPv4 Address Prefix. - :vartype secondary_ipv4_prefix: str - :ivar secondary_ipv6_prefix: Secondary IPv6 Address Prefix. - :vartype secondary_ipv6_prefix: str - :ivar username: Username for the terminal server connection. - :vartype username: str - :ivar password: Password for the terminal server connection. - :vartype password: str - :ivar serial_number: Serial Number of Terminal server. - :vartype serial_number: str - """ - - _validation = { - "username": {"min_length": 1}, - "password": {"min_length": 1}, - "serial_number": {"min_length": 1}, - } - - _attribute_map = { - "primary_ipv4_prefix": {"key": "primaryIpv4Prefix", "type": "str"}, - "primary_ipv6_prefix": {"key": "primaryIpv6Prefix", "type": "str"}, - "secondary_ipv4_prefix": {"key": "secondaryIpv4Prefix", "type": "str"}, - "secondary_ipv6_prefix": {"key": "secondaryIpv6Prefix", "type": "str"}, - "username": {"key": "username", "type": "str"}, - "password": {"key": "password", "type": "str"}, - "serial_number": {"key": "serialNumber", "type": "str"}, - } - - def __init__( - self, - *, - primary_ipv4_prefix: Optional[str] = None, - primary_ipv6_prefix: Optional[str] = None, - secondary_ipv4_prefix: Optional[str] = None, - secondary_ipv6_prefix: Optional[str] = None, - username: Optional[str] = None, - password: Optional[str] = None, - serial_number: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword primary_ipv4_prefix: IPv4 Address Prefix. - :paramtype primary_ipv4_prefix: str - :keyword primary_ipv6_prefix: IPv6 Address Prefix. - :paramtype primary_ipv6_prefix: str - :keyword secondary_ipv4_prefix: Secondary IPv4 Address Prefix. - :paramtype secondary_ipv4_prefix: str - :keyword secondary_ipv6_prefix: Secondary IPv6 Address Prefix. - :paramtype secondary_ipv6_prefix: str - :keyword username: Username for the terminal server connection. - :paramtype username: str - :keyword password: Password for the terminal server connection. - :paramtype password: str - :keyword serial_number: Serial Number of Terminal server. - :paramtype serial_number: str - """ - super().__init__( - username=username, - password=password, - serial_number=serial_number, - primary_ipv4_prefix=primary_ipv4_prefix, - primary_ipv6_prefix=primary_ipv6_prefix, - secondary_ipv4_prefix=secondary_ipv4_prefix, - secondary_ipv6_prefix=secondary_ipv6_prefix, - **kwargs - ) - self.primary_ipv4_prefix = primary_ipv4_prefix - self.primary_ipv6_prefix = primary_ipv6_prefix - self.secondary_ipv4_prefix = secondary_ipv4_prefix - self.secondary_ipv6_prefix = secondary_ipv6_prefix - self.username = username - self.password = password - self.serial_number = serial_number - - -class NetworkFabricPatchProperties(AnnotationResource, NetworkFabricPatchableProperties): - """Network Fabric Patch properties. - - :ivar rack_count: Number of compute racks associated to Network Fabric. - :vartype rack_count: int - :ivar server_count_per_rack: Number of servers.Possible values are from 1-16. - :vartype server_count_per_rack: int - :ivar ipv4_prefix: IPv4Prefix for Management Network. Example: 10.1.0.0/19. - :vartype ipv4_prefix: str - :ivar ipv6_prefix: IPv6Prefix for Management Network. Example: 3FFE:FFFF:0:CD40::/59. - :vartype ipv6_prefix: str - :ivar fabric_asn: ASN of CE devices for CE/PE connectivity. - :vartype fabric_asn: int - :ivar terminal_server_configuration: Network and credentials configuration already applied to - terminal server. - :vartype terminal_server_configuration: - ~azure.mgmt.managednetworkfabric.models.NetworkFabricPatchablePropertiesTerminalServerConfiguration - :ivar management_network_configuration: Configuration to be used to setup the management - network. - :vartype management_network_configuration: - ~azure.mgmt.managednetworkfabric.models.ManagementNetworkConfigurationPatchableProperties - :ivar annotation: Switch configuration description. - :vartype annotation: str - """ - - _validation = { - "rack_count": {"maximum": 8, "minimum": 1}, - "server_count_per_rack": {"maximum": 16, "minimum": 1}, - "ipv4_prefix": {"min_length": 1}, - "ipv6_prefix": {"min_length": 1}, - "fabric_asn": {"maximum": 4294967295, "minimum": 1}, - } - - _attribute_map = { - "rack_count": {"key": "rackCount", "type": "int"}, - "server_count_per_rack": {"key": "serverCountPerRack", "type": "int"}, - "ipv4_prefix": {"key": "ipv4Prefix", "type": "str"}, - "ipv6_prefix": {"key": "ipv6Prefix", "type": "str"}, - "fabric_asn": {"key": "fabricASN", "type": "int"}, - "terminal_server_configuration": { - "key": "terminalServerConfiguration", - "type": "NetworkFabricPatchablePropertiesTerminalServerConfiguration", - }, - "management_network_configuration": { - "key": "managementNetworkConfiguration", - "type": "ManagementNetworkConfigurationPatchableProperties", - }, - "annotation": {"key": "annotation", "type": "str"}, - } - - def __init__( - self, - *, - rack_count: Optional[int] = None, - server_count_per_rack: Optional[int] = None, - ipv4_prefix: Optional[str] = None, - ipv6_prefix: Optional[str] = None, - fabric_asn: Optional[int] = None, - terminal_server_configuration: Optional[ - "_models.NetworkFabricPatchablePropertiesTerminalServerConfiguration" - ] = None, - management_network_configuration: Optional["_models.ManagementNetworkConfigurationPatchableProperties"] = None, - annotation: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword rack_count: Number of compute racks associated to Network Fabric. - :paramtype rack_count: int - :keyword server_count_per_rack: Number of servers.Possible values are from 1-16. - :paramtype server_count_per_rack: int - :keyword ipv4_prefix: IPv4Prefix for Management Network. Example: 10.1.0.0/19. - :paramtype ipv4_prefix: str - :keyword ipv6_prefix: IPv6Prefix for Management Network. Example: 3FFE:FFFF:0:CD40::/59. - :paramtype ipv6_prefix: str - :keyword fabric_asn: ASN of CE devices for CE/PE connectivity. - :paramtype fabric_asn: int - :keyword terminal_server_configuration: Network and credentials configuration already applied - to terminal server. - :paramtype terminal_server_configuration: - ~azure.mgmt.managednetworkfabric.models.NetworkFabricPatchablePropertiesTerminalServerConfiguration - :keyword management_network_configuration: Configuration to be used to setup the management - network. - :paramtype management_network_configuration: - ~azure.mgmt.managednetworkfabric.models.ManagementNetworkConfigurationPatchableProperties - :keyword annotation: Switch configuration description. - :paramtype annotation: str - """ - super().__init__( - annotation=annotation, - rack_count=rack_count, - server_count_per_rack=server_count_per_rack, - ipv4_prefix=ipv4_prefix, - ipv6_prefix=ipv6_prefix, - fabric_asn=fabric_asn, - terminal_server_configuration=terminal_server_configuration, - management_network_configuration=management_network_configuration, - **kwargs - ) - self.rack_count = rack_count - self.server_count_per_rack = server_count_per_rack - self.ipv4_prefix = ipv4_prefix - self.ipv6_prefix = ipv6_prefix - self.fabric_asn = fabric_asn - self.terminal_server_configuration = terminal_server_configuration - self.management_network_configuration = management_network_configuration - self.annotation = annotation - - -class NetworkFabricProperties(AnnotationResource): # pylint: disable=too-many-instance-attributes - """Network Fabric Properties defines the properties of the 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 Azure. - - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar network_fabric_sku: Supported Network Fabric SKU.Example: Compute / Aggregate racks. Once - the user chooses a particular SKU, only supported racks can be added to the Network Fabric. The - SKU determines whether it is a single / multi rack Network Fabric. Required. - :vartype network_fabric_sku: str - :ivar fabric_version: The version of Network Fabric. - :vartype fabric_version: str - :ivar router_ids: Array of router IDs. - :vartype router_ids: list[str] - :ivar network_fabric_controller_id: Azure resource ID for the NetworkFabricController the - NetworkFabric belongs. Required. - :vartype network_fabric_controller_id: str - :ivar rack_count: Number of compute racks associated to Network Fabric. - :vartype rack_count: int - :ivar server_count_per_rack: Number of servers.Possible values are from 1-16. Required. - :vartype server_count_per_rack: int - :ivar ipv4_prefix: IPv4Prefix for Management Network. Example: 10.1.0.0/19. Required. - :vartype ipv4_prefix: str - :ivar ipv6_prefix: IPv6Prefix for Management Network. Example: 3FFE:FFFF:0:CD40::/59. - :vartype ipv6_prefix: str - :ivar fabric_asn: ASN of CE devices for CE/PE connectivity. Required. - :vartype fabric_asn: int - :ivar terminal_server_configuration: Network and credentials configuration currently applied to - terminal server. Required. - :vartype terminal_server_configuration: - ~azure.mgmt.managednetworkfabric.models.TerminalServerConfiguration - :ivar management_network_configuration: Configuration to be used to setup the management - network. Required. - :vartype management_network_configuration: - ~azure.mgmt.managednetworkfabric.models.ManagementNetworkConfigurationProperties - :ivar racks: List of NetworkRack resource IDs under the Network Fabric. The number of racks - allowed depends on the Network Fabric SKU. - :vartype racks: list[str] - :ivar l2_isolation_domains: List of L2 Isolation Domain resource IDs under the Network Fabric. - :vartype l2_isolation_domains: list[str] - :ivar l3_isolation_domains: List of L3 Isolation Domain resource IDs under the Network Fabric. - :vartype l3_isolation_domains: list[str] - :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", - "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", - "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - :ivar provisioning_state: Provides you the latest status of the NFC service, whether it is - Accepted, updating, Succeeded or Failed. During this process, the states keep changing based on - the status of NFC provisioning. Known values are: "Accepted", "Succeeded", "Updating", - "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", - "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.AdministrativeState - """ - - _validation = { - "network_fabric_sku": {"required": True, "min_length": 1}, - "fabric_version": {"readonly": True}, - "router_ids": {"readonly": True}, - "network_fabric_controller_id": {"required": True}, - "rack_count": {"maximum": 8, "minimum": 1}, - "server_count_per_rack": {"required": True, "maximum": 16, "minimum": 1}, - "ipv4_prefix": {"required": True, "min_length": 1}, - "ipv6_prefix": {"min_length": 1}, - "fabric_asn": {"required": True, "maximum": 4294967295, "minimum": 1}, - "terminal_server_configuration": {"required": True}, - "management_network_configuration": {"required": True}, - "racks": {"readonly": True}, - "l2_isolation_domains": {"readonly": True}, - "l3_isolation_domains": {"readonly": True}, - "configuration_state": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "administrative_state": {"readonly": True}, - } - - _attribute_map = { - "annotation": {"key": "annotation", "type": "str"}, - "network_fabric_sku": {"key": "networkFabricSku", "type": "str"}, - "fabric_version": {"key": "fabricVersion", "type": "str"}, - "router_ids": {"key": "routerIds", "type": "[str]"}, - "network_fabric_controller_id": {"key": "networkFabricControllerId", "type": "str"}, - "rack_count": {"key": "rackCount", "type": "int"}, - "server_count_per_rack": {"key": "serverCountPerRack", "type": "int"}, - "ipv4_prefix": {"key": "ipv4Prefix", "type": "str"}, - "ipv6_prefix": {"key": "ipv6Prefix", "type": "str"}, - "fabric_asn": {"key": "fabricASN", "type": "int"}, - "terminal_server_configuration": {"key": "terminalServerConfiguration", "type": "TerminalServerConfiguration"}, - "management_network_configuration": { - "key": "managementNetworkConfiguration", - "type": "ManagementNetworkConfigurationProperties", - }, - "racks": {"key": "racks", "type": "[str]"}, - "l2_isolation_domains": {"key": "l2IsolationDomains", "type": "[str]"}, - "l3_isolation_domains": {"key": "l3IsolationDomains", "type": "[str]"}, - "configuration_state": {"key": "configurationState", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "administrative_state": {"key": "administrativeState", "type": "str"}, - } - - def __init__( - self, - *, - network_fabric_sku: str, - network_fabric_controller_id: str, - server_count_per_rack: int, - ipv4_prefix: str, - fabric_asn: int, - terminal_server_configuration: "_models.TerminalServerConfiguration", - management_network_configuration: "_models.ManagementNetworkConfigurationProperties", - annotation: Optional[str] = None, - rack_count: Optional[int] = None, - ipv6_prefix: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword network_fabric_sku: Supported Network Fabric SKU.Example: Compute / Aggregate racks. - Once the user chooses a particular SKU, only supported racks can be added to the Network - Fabric. The SKU determines whether it is a single / multi rack Network Fabric. Required. - :paramtype network_fabric_sku: str - :keyword network_fabric_controller_id: Azure resource ID for the NetworkFabricController the - NetworkFabric belongs. Required. - :paramtype network_fabric_controller_id: str - :keyword rack_count: Number of compute racks associated to Network Fabric. - :paramtype rack_count: int - :keyword server_count_per_rack: Number of servers.Possible values are from 1-16. Required. - :paramtype server_count_per_rack: int - :keyword ipv4_prefix: IPv4Prefix for Management Network. Example: 10.1.0.0/19. Required. - :paramtype ipv4_prefix: str - :keyword ipv6_prefix: IPv6Prefix for Management Network. Example: 3FFE:FFFF:0:CD40::/59. - :paramtype ipv6_prefix: str - :keyword fabric_asn: ASN of CE devices for CE/PE connectivity. Required. - :paramtype fabric_asn: int - :keyword terminal_server_configuration: Network and credentials configuration currently applied - to terminal server. Required. - :paramtype terminal_server_configuration: - ~azure.mgmt.managednetworkfabric.models.TerminalServerConfiguration - :keyword management_network_configuration: Configuration to be used to setup the management - network. Required. - :paramtype management_network_configuration: - ~azure.mgmt.managednetworkfabric.models.ManagementNetworkConfigurationProperties - """ - super().__init__(annotation=annotation, **kwargs) - self.network_fabric_sku = network_fabric_sku - self.fabric_version = None - self.router_ids = None - self.network_fabric_controller_id = network_fabric_controller_id - self.rack_count = rack_count - self.server_count_per_rack = server_count_per_rack - self.ipv4_prefix = ipv4_prefix - self.ipv6_prefix = ipv6_prefix - self.fabric_asn = fabric_asn - self.terminal_server_configuration = terminal_server_configuration - self.management_network_configuration = management_network_configuration - self.racks = None - self.l2_isolation_domains = None - self.l3_isolation_domains = None - self.configuration_state = None - self.provisioning_state = None - self.administrative_state = None - - -class NetworkFabricSku(ProxyResource): - """The Network Fabric SKU resource definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData - :ivar type_properties_type: Type of Network Fabric SKU. Known values are: "SingleRack" and - "MultiRack". - :vartype type_properties_type: str or ~azure.mgmt.managednetworkfabric.models.FabricSkuType - :ivar max_compute_racks: Maximum number of compute racks available for this Network Fabric SKU. - The value of max count racks is 4 for 4 rack SKU and 8 for 8 rack SKU. - :vartype max_compute_racks: int - :ivar maximum_server_count: Maximum number of servers available for this Network Fabric SKU. - :vartype maximum_server_count: int - :ivar supported_versions: List of supported Network Fabric SKU versions. - :vartype supported_versions: list[str] - :ivar details: URL providing detailed configuration of the fabric SKU. - :vartype details: str - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "type_properties_type": {"readonly": True}, - "supported_versions": {"readonly": True}, - "details": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "type_properties_type": {"key": "properties.type", "type": "str"}, - "max_compute_racks": {"key": "properties.maxComputeRacks", "type": "int"}, - "maximum_server_count": {"key": "properties.maximumServerCount", "type": "int"}, - "supported_versions": {"key": "properties.supportedVersions", "type": "[str]"}, - "details": {"key": "properties.details", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - } - - def __init__( - self, *, max_compute_racks: Optional[int] = None, maximum_server_count: Optional[int] = None, **kwargs: Any - ) -> None: - """ - :keyword max_compute_racks: Maximum number of compute racks available for this Network Fabric - SKU. The value of max count racks is 4 for 4 rack SKU and 8 for 8 rack SKU. - :paramtype max_compute_racks: int - :keyword maximum_server_count: Maximum number of servers available for this Network Fabric SKU. - :paramtype maximum_server_count: int - """ - super().__init__(**kwargs) - self.type_properties_type = None - self.max_compute_racks = max_compute_racks - self.maximum_server_count = maximum_server_count - self.supported_versions = None - self.details = None - self.provisioning_state = None - - -class NetworkFabricSkusListResult(_serialization.Model): - """List of Network Fabric SKUs. - - :ivar value: List of Network Fabric SKU resources. - :vartype value: list[~azure.mgmt.managednetworkfabric.models.NetworkFabricSku] - :ivar next_link: Url to follow for getting next page of resources. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[NetworkFabricSku]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, - *, - value: Optional[List["_models.NetworkFabricSku"]] = None, - next_link: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword value: List of Network Fabric SKU resources. - :paramtype value: list[~azure.mgmt.managednetworkfabric.models.NetworkFabricSku] - :keyword next_link: Url to follow for getting next page of resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class NetworkFabricsListResult(_serialization.Model): - """List of Network Fabrics. - - :ivar value: List of Network Fabric resources. - :vartype value: list[~azure.mgmt.managednetworkfabric.models.NetworkFabric] - :ivar next_link: Url to follow for getting next page of resources. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[NetworkFabric]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: Optional[List["_models.NetworkFabric"]] = None, next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: List of Network Fabric resources. - :paramtype value: list[~azure.mgmt.managednetworkfabric.models.NetworkFabric] - :keyword next_link: Url to follow for getting next page of resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class NetworkInterface(ProxyResource): # pylint: disable=too-many-instance-attributes - """Defines the NetworkInterface resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar physical_identifier: Physical Identifier of the network interface. - :vartype physical_identifier: str - :ivar connected_to: The ARM resource id of the interface or compute server its connected to. - :vartype connected_to: str - :ivar interface_type: The Interface Type. Example: Management/Data. Known values are: - "Management" and "Data". - :vartype interface_type: str or ~azure.mgmt.managednetworkfabric.models.InterfaceType - :ivar ipv4_address: IPv4Address of the interface. - :vartype ipv4_address: str - :ivar ipv6_address: IPv6Address of the interface. - :vartype ipv6_address: str - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", - "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.AdministrativeState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "physical_identifier": {"readonly": True}, - "connected_to": {"readonly": True}, - "interface_type": {"readonly": True}, - "ipv4_address": {"readonly": True}, - "ipv6_address": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "administrative_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "annotation": {"key": "properties.annotation", "type": "str"}, - "physical_identifier": {"key": "properties.physicalIdentifier", "type": "str"}, - "connected_to": {"key": "properties.connectedTo", "type": "str"}, - "interface_type": {"key": "properties.interfaceType", "type": "str"}, - "ipv4_address": {"key": "properties.ipv4Address", "type": "str"}, - "ipv6_address": {"key": "properties.ipv6Address", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "administrative_state": {"key": "properties.administrativeState", "type": "str"}, - } - - def __init__(self, *, annotation: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword annotation: Switch configuration description. - :paramtype annotation: str - """ - super().__init__(**kwargs) - self.annotation = annotation - self.physical_identifier = None - self.connected_to = None - self.interface_type = None - self.ipv4_address = None - self.ipv6_address = None - self.provisioning_state = None - self.administrative_state = None - - -class NetworkInterfacePatch(_serialization.Model): - """The NetworkInterfacePatch resource definition. - - :ivar annotation: Switch configuration description. - :vartype annotation: str - """ - - _attribute_map = { - "annotation": {"key": "properties.annotation", "type": "str"}, - } - - def __init__(self, *, annotation: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword annotation: Switch configuration description. - :paramtype annotation: str - """ - super().__init__(**kwargs) - self.annotation = annotation - - -class NetworkInterfacePatchProperties(AnnotationResource): - """Network Interface Patch properties. - - :ivar annotation: Switch configuration description. - :vartype annotation: str - """ - - _attribute_map = { - "annotation": {"key": "annotation", "type": "str"}, - } - - def __init__(self, *, annotation: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword annotation: Switch configuration description. - :paramtype annotation: str - """ - super().__init__(annotation=annotation, **kwargs) - - -class NetworkInterfaceProperties(AnnotationResource): - """Network Interface Properties defines the properties of the resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar physical_identifier: Physical Identifier of the network interface. - :vartype physical_identifier: str - :ivar connected_to: The ARM resource id of the interface or compute server its connected to. - :vartype connected_to: str - :ivar interface_type: The Interface Type. Example: Management/Data. Known values are: - "Management" and "Data". - :vartype interface_type: str or ~azure.mgmt.managednetworkfabric.models.InterfaceType - :ivar ipv4_address: IPv4Address of the interface. - :vartype ipv4_address: str - :ivar ipv6_address: IPv6Address of the interface. - :vartype ipv6_address: str - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", - "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.AdministrativeState - """ - - _validation = { - "physical_identifier": {"readonly": True}, - "connected_to": {"readonly": True}, - "interface_type": {"readonly": True}, - "ipv4_address": {"readonly": True}, - "ipv6_address": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "administrative_state": {"readonly": True}, - } - - _attribute_map = { - "annotation": {"key": "annotation", "type": "str"}, - "physical_identifier": {"key": "physicalIdentifier", "type": "str"}, - "connected_to": {"key": "connectedTo", "type": "str"}, - "interface_type": {"key": "interfaceType", "type": "str"}, - "ipv4_address": {"key": "ipv4Address", "type": "str"}, - "ipv6_address": {"key": "ipv6Address", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "administrative_state": {"key": "administrativeState", "type": "str"}, - } - - def __init__(self, *, annotation: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword annotation: Switch configuration description. - :paramtype annotation: str - """ - super().__init__(annotation=annotation, **kwargs) - self.physical_identifier = None - self.connected_to = None - self.interface_type = None - self.ipv4_address = None - self.ipv6_address = None - self.provisioning_state = None - self.administrative_state = None - - -class NetworkInterfacesList(_serialization.Model): - """List of NetworkInterfaces. - - :ivar value: List of NetworkInterfaces resources. - :vartype value: list[~azure.mgmt.managednetworkfabric.models.NetworkInterface] - :ivar next_link: Url to follow for getting next page of resources. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[NetworkInterface]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, - *, - value: Optional[List["_models.NetworkInterface"]] = None, - next_link: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword value: List of NetworkInterfaces resources. - :paramtype value: list[~azure.mgmt.managednetworkfabric.models.NetworkInterface] - :keyword next_link: Url to follow for getting next page of resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class NetworkPacketBroker(TrackedResource): # pylint: disable=too-many-instance-attributes - """The NetworkPacketBroker resource definition. - - 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 Azure. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar network_fabric_id: ARM resource ID of the Network Fabric. Required. - :vartype network_fabric_id: str - :ivar network_device_ids: List of ARM resource IDs of Network Devices [NPB]. - :vartype network_device_ids: list[str] - :ivar source_interface_ids: List of network interfaces across NPB devices that are used to - mirror source traffic. - :vartype source_interface_ids: list[str] - :ivar network_tap_ids: List of network Tap IDs configured on NPB. - :vartype network_tap_ids: list[str] - :ivar neighbor_group_ids: List of neighbor group IDs configured on NPB. - :vartype neighbor_group_ids: list[str] - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "network_fabric_id": {"required": True}, - "network_device_ids": {"readonly": True}, - "source_interface_ids": {"readonly": True}, - "network_tap_ids": {"readonly": True}, - "neighbor_group_ids": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "network_fabric_id": {"key": "properties.networkFabricId", "type": "str"}, - "network_device_ids": {"key": "properties.networkDeviceIds", "type": "[str]"}, - "source_interface_ids": {"key": "properties.sourceInterfaceIds", "type": "[str]"}, - "network_tap_ids": {"key": "properties.networkTapIds", "type": "[str]"}, - "neighbor_group_ids": {"key": "properties.neighborGroupIds", "type": "[str]"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - } - - def __init__( - self, *, location: str, network_fabric_id: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword network_fabric_id: ARM resource ID of the Network Fabric. Required. - :paramtype network_fabric_id: str - """ - super().__init__(tags=tags, location=location, **kwargs) - self.network_fabric_id = network_fabric_id - self.network_device_ids = None - self.source_interface_ids = None - self.network_tap_ids = None - self.neighbor_group_ids = None - self.provisioning_state = None - - -class NetworkPacketBrokerPatch(TagsUpdate): - """The NetworkPacketBroker patch resource definition. - - :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__(tags=tags, **kwargs) - - -class NetworkPacketBrokersListResult(_serialization.Model): - """List of NetworkPacketBrokers. - - :ivar value: List of NetworkPacketBroker resources. - :vartype value: list[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] - :ivar next_link: Url to follow for getting next page of resources. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[NetworkPacketBroker]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, - *, - value: Optional[List["_models.NetworkPacketBroker"]] = None, - next_link: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword value: List of NetworkPacketBroker resources. - :paramtype value: list[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] - :keyword next_link: Url to follow for getting next page of resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class NetworkRack(TrackedResource): # pylint: disable=too-many-instance-attributes - """The Network Rack resource definition. - - 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 Azure. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar network_rack_type: Network Rack SKU name. Known values are: "Aggregate", "Compute", and - "Combined". - :vartype network_rack_type: str or ~azure.mgmt.managednetworkfabric.models.NetworkRackType - :ivar network_fabric_id: ARM resource ID of the Network Fabric. Required. - :vartype network_fabric_id: str - :ivar network_devices: List of network device ARM resource IDs. - :vartype network_devices: list[str] - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "network_fabric_id": {"required": True}, - "network_devices": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "annotation": {"key": "properties.annotation", "type": "str"}, - "network_rack_type": {"key": "properties.networkRackType", "type": "str"}, - "network_fabric_id": {"key": "properties.networkFabricId", "type": "str"}, - "network_devices": {"key": "properties.networkDevices", "type": "[str]"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - } - - def __init__( - self, - *, - location: str, - network_fabric_id: str, - tags: Optional[Dict[str, str]] = None, - annotation: Optional[str] = None, - network_rack_type: Optional[Union[str, "_models.NetworkRackType"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword network_rack_type: Network Rack SKU name. Known values are: "Aggregate", "Compute", - and "Combined". - :paramtype network_rack_type: str or ~azure.mgmt.managednetworkfabric.models.NetworkRackType - :keyword network_fabric_id: ARM resource ID of the Network Fabric. Required. - :paramtype network_fabric_id: str - """ - super().__init__(tags=tags, location=location, **kwargs) - self.annotation = annotation - self.network_rack_type = network_rack_type - self.network_fabric_id = network_fabric_id - self.network_devices = None - self.provisioning_state = None - - -class NetworkRackProperties(AnnotationResource): - """Network Rack Properties defines the properties of the 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 Azure. - - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar network_rack_type: Network Rack SKU name. Known values are: "Aggregate", "Compute", and - "Combined". - :vartype network_rack_type: str or ~azure.mgmt.managednetworkfabric.models.NetworkRackType - :ivar network_fabric_id: ARM resource ID of the Network Fabric. Required. - :vartype network_fabric_id: str - :ivar network_devices: List of network device ARM resource IDs. - :vartype network_devices: list[str] - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - """ - - _validation = { - "network_fabric_id": {"required": True}, - "network_devices": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "annotation": {"key": "annotation", "type": "str"}, - "network_rack_type": {"key": "networkRackType", "type": "str"}, - "network_fabric_id": {"key": "networkFabricId", "type": "str"}, - "network_devices": {"key": "networkDevices", "type": "[str]"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - } - - def __init__( - self, - *, - network_fabric_id: str, - annotation: Optional[str] = None, - network_rack_type: Optional[Union[str, "_models.NetworkRackType"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword network_rack_type: Network Rack SKU name. Known values are: "Aggregate", "Compute", - and "Combined". - :paramtype network_rack_type: str or ~azure.mgmt.managednetworkfabric.models.NetworkRackType - :keyword network_fabric_id: ARM resource ID of the Network Fabric. Required. - :paramtype network_fabric_id: str - """ - super().__init__(annotation=annotation, **kwargs) - self.network_rack_type = network_rack_type - self.network_fabric_id = network_fabric_id - self.network_devices = None - self.provisioning_state = None - - -class NetworkRacksListResult(_serialization.Model): - """List of Network Racks. - - :ivar value: List of Network Rack resources. - :vartype value: list[~azure.mgmt.managednetworkfabric.models.NetworkRack] - :ivar next_link: Url to follow for getting next page of resources. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[NetworkRack]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: Optional[List["_models.NetworkRack"]] = None, next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: List of Network Rack resources. - :paramtype value: list[~azure.mgmt.managednetworkfabric.models.NetworkRack] - :keyword next_link: Url to follow for getting next page of resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class NetworkTap(TrackedResource): # pylint: disable=too-many-instance-attributes - """The Network Tap resource definition. - - 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 Azure. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar network_packet_broker_id: ARM resource ID of the Network Packet Broker. Required. - :vartype network_packet_broker_id: str - :ivar source_tap_rule_id: Source Tap Rule Id. ARM Resource ID of the Network Tap Rule. - :vartype source_tap_rule_id: str - :ivar destinations: List of destinations to send the filter traffic. Required. - :vartype destinations: - list[~azure.mgmt.managednetworkfabric.models.NetworkTapPropertiesDestinationsItem] - :ivar polling_type: Polling type. Known values are: "Pull" and "Push". - :vartype polling_type: str or ~azure.mgmt.managednetworkfabric.models.PollingType - :ivar configuration_state: Gets the configurations state of the resource. Known values are: - "Succeeded", "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", - "Deprovisioning", "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - :ivar provisioning_state: Provides you the latest status of the NFC service, whether it is - Accepted, updating, Succeeded or Failed. During this process, the states keep changing based on - the status of Network Tap provisioning. Known values are: "Accepted", "Succeeded", "Updating", - "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar administrative_state: Administrative state of the resource. Example -Enabled/Disabled. - Known values are: "Enabled", "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.AdministrativeState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "network_packet_broker_id": {"required": True}, - "source_tap_rule_id": {"readonly": True}, - "destinations": {"required": True, "min_items": 1}, - "configuration_state": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "administrative_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "annotation": {"key": "properties.annotation", "type": "str"}, - "network_packet_broker_id": {"key": "properties.networkPacketBrokerId", "type": "str"}, - "source_tap_rule_id": {"key": "properties.sourceTapRuleId", "type": "str"}, - "destinations": {"key": "properties.destinations", "type": "[NetworkTapPropertiesDestinationsItem]"}, - "polling_type": {"key": "properties.pollingType", "type": "str"}, - "configuration_state": {"key": "properties.configurationState", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "administrative_state": {"key": "properties.administrativeState", "type": "str"}, - } - - def __init__( - self, - *, - location: str, - network_packet_broker_id: str, - destinations: List["_models.NetworkTapPropertiesDestinationsItem"], - tags: Optional[Dict[str, str]] = None, - annotation: Optional[str] = None, - polling_type: Optional[Union[str, "_models.PollingType"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword network_packet_broker_id: ARM resource ID of the Network Packet Broker. Required. - :paramtype network_packet_broker_id: str - :keyword destinations: List of destinations to send the filter traffic. Required. - :paramtype destinations: - list[~azure.mgmt.managednetworkfabric.models.NetworkTapPropertiesDestinationsItem] - :keyword polling_type: Polling type. Known values are: "Pull" and "Push". - :paramtype polling_type: str or ~azure.mgmt.managednetworkfabric.models.PollingType - """ - super().__init__(tags=tags, location=location, **kwargs) - self.annotation = annotation - self.network_packet_broker_id = network_packet_broker_id - self.source_tap_rule_id = None - self.destinations = destinations - self.polling_type = polling_type - self.configuration_state = None - self.provisioning_state = None - self.administrative_state = None - - -class NetworkTapPatch(TagsUpdate): - """The NetworkFabric resource definition. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar polling_type: Polling type. Known values are: "Pull" and "Push". - :vartype polling_type: str or ~azure.mgmt.managednetworkfabric.models.PollingType - :ivar destinations: List of destination properties to send the filter traffic. - :vartype destinations: - list[~azure.mgmt.managednetworkfabric.models.NetworkTapPatchableParametersDestinationsItem] - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "annotation": {"key": "properties.annotation", "type": "str"}, - "polling_type": {"key": "properties.pollingType", "type": "str"}, - "destinations": {"key": "properties.destinations", "type": "[NetworkTapPatchableParametersDestinationsItem]"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - annotation: Optional[str] = None, - polling_type: Optional[Union[str, "_models.PollingType"]] = None, - destinations: Optional[List["_models.NetworkTapPatchableParametersDestinationsItem"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword polling_type: Polling type. Known values are: "Pull" and "Push". - :paramtype polling_type: str or ~azure.mgmt.managednetworkfabric.models.PollingType - :keyword destinations: List of destination properties to send the filter traffic. - :paramtype destinations: - list[~azure.mgmt.managednetworkfabric.models.NetworkTapPatchableParametersDestinationsItem] - """ - super().__init__(tags=tags, **kwargs) - self.annotation = annotation - self.polling_type = polling_type - self.destinations = destinations - - -class NetworkTapPatchableParameters(AnnotationResource): - """The Network Tap resource patch definition. - - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar polling_type: Polling type. Known values are: "Pull" and "Push". - :vartype polling_type: str or ~azure.mgmt.managednetworkfabric.models.PollingType - :ivar destinations: List of destination properties to send the filter traffic. - :vartype destinations: - list[~azure.mgmt.managednetworkfabric.models.NetworkTapPatchableParametersDestinationsItem] - """ - - _attribute_map = { - "annotation": {"key": "annotation", "type": "str"}, - "polling_type": {"key": "pollingType", "type": "str"}, - "destinations": {"key": "destinations", "type": "[NetworkTapPatchableParametersDestinationsItem]"}, - } - - def __init__( - self, - *, - annotation: Optional[str] = None, - polling_type: Optional[Union[str, "_models.PollingType"]] = None, - destinations: Optional[List["_models.NetworkTapPatchableParametersDestinationsItem"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword polling_type: Polling type. Known values are: "Pull" and "Push". - :paramtype polling_type: str or ~azure.mgmt.managednetworkfabric.models.PollingType - :keyword destinations: List of destination properties to send the filter traffic. - :paramtype destinations: - list[~azure.mgmt.managednetworkfabric.models.NetworkTapPatchableParametersDestinationsItem] - """ - super().__init__(annotation=annotation, **kwargs) - self.polling_type = polling_type - self.destinations = destinations - - -class NetworkTapPatchableParametersDestinationsItem(DestinationProperties): - """Destination. - - :ivar name: Destination name. - :vartype name: str - :ivar destination_type: Type of destination. Input can be IsolationDomain or Direct. Known - values are: "IsolationDomain" and "Direct". - :vartype destination_type: str or ~azure.mgmt.managednetworkfabric.models.DestinationType - :ivar destination_id: The destination Id. ARM Resource ID of either NNI or Internal Networks. - :vartype destination_id: str - :ivar isolation_domain_properties: Isolation Domain Properties. - :vartype isolation_domain_properties: - ~azure.mgmt.managednetworkfabric.models.IsolationDomainProperties - :ivar destination_tap_rule_id: ARM Resource ID of destination Tap Rule that contains match - configurations. - :vartype destination_tap_rule_id: str - """ - - _validation = { - "name": {"min_length": 1}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "destination_type": {"key": "destinationType", "type": "str"}, - "destination_id": {"key": "destinationId", "type": "str"}, - "isolation_domain_properties": {"key": "isolationDomainProperties", "type": "IsolationDomainProperties"}, - "destination_tap_rule_id": {"key": "destinationTapRuleId", "type": "str"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - destination_type: Optional[Union[str, "_models.DestinationType"]] = None, - destination_id: Optional[str] = None, - isolation_domain_properties: Optional["_models.IsolationDomainProperties"] = None, - destination_tap_rule_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: Destination name. - :paramtype name: str - :keyword destination_type: Type of destination. Input can be IsolationDomain or Direct. Known - values are: "IsolationDomain" and "Direct". - :paramtype destination_type: str or ~azure.mgmt.managednetworkfabric.models.DestinationType - :keyword destination_id: The destination Id. ARM Resource ID of either NNI or Internal - Networks. - :paramtype destination_id: str - :keyword isolation_domain_properties: Isolation Domain Properties. - :paramtype isolation_domain_properties: - ~azure.mgmt.managednetworkfabric.models.IsolationDomainProperties - :keyword destination_tap_rule_id: ARM Resource ID of destination Tap Rule that contains match - configurations. - :paramtype destination_tap_rule_id: str - """ - super().__init__( - name=name, - destination_type=destination_type, - destination_id=destination_id, - isolation_domain_properties=isolation_domain_properties, - destination_tap_rule_id=destination_tap_rule_id, - **kwargs - ) - - -class NetworkTapProperties(AnnotationResource): - """Network Tap Properties defines the properties of the 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 Azure. - - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar network_packet_broker_id: ARM resource ID of the Network Packet Broker. Required. - :vartype network_packet_broker_id: str - :ivar source_tap_rule_id: Source Tap Rule Id. ARM Resource ID of the Network Tap Rule. - :vartype source_tap_rule_id: str - :ivar destinations: List of destinations to send the filter traffic. Required. - :vartype destinations: - list[~azure.mgmt.managednetworkfabric.models.NetworkTapPropertiesDestinationsItem] - :ivar polling_type: Polling type. Known values are: "Pull" and "Push". - :vartype polling_type: str or ~azure.mgmt.managednetworkfabric.models.PollingType - :ivar configuration_state: Gets the configurations state of the resource. Known values are: - "Succeeded", "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", - "Deprovisioning", "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - :ivar provisioning_state: Provides you the latest status of the NFC service, whether it is - Accepted, updating, Succeeded or Failed. During this process, the states keep changing based on - the status of Network Tap provisioning. Known values are: "Accepted", "Succeeded", "Updating", - "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar administrative_state: Administrative state of the resource. Example -Enabled/Disabled. - Known values are: "Enabled", "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.AdministrativeState - """ - - _validation = { - "network_packet_broker_id": {"required": True}, - "source_tap_rule_id": {"readonly": True}, - "destinations": {"required": True, "min_items": 1}, - "configuration_state": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "administrative_state": {"readonly": True}, - } - - _attribute_map = { - "annotation": {"key": "annotation", "type": "str"}, - "network_packet_broker_id": {"key": "networkPacketBrokerId", "type": "str"}, - "source_tap_rule_id": {"key": "sourceTapRuleId", "type": "str"}, - "destinations": {"key": "destinations", "type": "[NetworkTapPropertiesDestinationsItem]"}, - "polling_type": {"key": "pollingType", "type": "str"}, - "configuration_state": {"key": "configurationState", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "administrative_state": {"key": "administrativeState", "type": "str"}, - } - - def __init__( - self, - *, - network_packet_broker_id: str, - destinations: List["_models.NetworkTapPropertiesDestinationsItem"], - annotation: Optional[str] = None, - polling_type: Optional[Union[str, "_models.PollingType"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword network_packet_broker_id: ARM resource ID of the Network Packet Broker. Required. - :paramtype network_packet_broker_id: str - :keyword destinations: List of destinations to send the filter traffic. Required. - :paramtype destinations: - list[~azure.mgmt.managednetworkfabric.models.NetworkTapPropertiesDestinationsItem] - :keyword polling_type: Polling type. Known values are: "Pull" and "Push". - :paramtype polling_type: str or ~azure.mgmt.managednetworkfabric.models.PollingType - """ - super().__init__(annotation=annotation, **kwargs) - self.network_packet_broker_id = network_packet_broker_id - self.source_tap_rule_id = None - self.destinations = destinations - self.polling_type = polling_type - self.configuration_state = None - self.provisioning_state = None - self.administrative_state = None - - -class NetworkTapPropertiesDestinationsItem(DestinationProperties): - """Destination. - - :ivar name: Destination name. - :vartype name: str - :ivar destination_type: Type of destination. Input can be IsolationDomain or Direct. Known - values are: "IsolationDomain" and "Direct". - :vartype destination_type: str or ~azure.mgmt.managednetworkfabric.models.DestinationType - :ivar destination_id: The destination Id. ARM Resource ID of either NNI or Internal Networks. - :vartype destination_id: str - :ivar isolation_domain_properties: Isolation Domain Properties. - :vartype isolation_domain_properties: - ~azure.mgmt.managednetworkfabric.models.IsolationDomainProperties - :ivar destination_tap_rule_id: ARM Resource ID of destination Tap Rule that contains match - configurations. - :vartype destination_tap_rule_id: str - """ - - _validation = { - "name": {"min_length": 1}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "destination_type": {"key": "destinationType", "type": "str"}, - "destination_id": {"key": "destinationId", "type": "str"}, - "isolation_domain_properties": {"key": "isolationDomainProperties", "type": "IsolationDomainProperties"}, - "destination_tap_rule_id": {"key": "destinationTapRuleId", "type": "str"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - destination_type: Optional[Union[str, "_models.DestinationType"]] = None, - destination_id: Optional[str] = None, - isolation_domain_properties: Optional["_models.IsolationDomainProperties"] = None, - destination_tap_rule_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: Destination name. - :paramtype name: str - :keyword destination_type: Type of destination. Input can be IsolationDomain or Direct. Known - values are: "IsolationDomain" and "Direct". - :paramtype destination_type: str or ~azure.mgmt.managednetworkfabric.models.DestinationType - :keyword destination_id: The destination Id. ARM Resource ID of either NNI or Internal - Networks. - :paramtype destination_id: str - :keyword isolation_domain_properties: Isolation Domain Properties. - :paramtype isolation_domain_properties: - ~azure.mgmt.managednetworkfabric.models.IsolationDomainProperties - :keyword destination_tap_rule_id: ARM Resource ID of destination Tap Rule that contains match - configurations. - :paramtype destination_tap_rule_id: str - """ - super().__init__( - name=name, - destination_type=destination_type, - destination_id=destination_id, - isolation_domain_properties=isolation_domain_properties, - destination_tap_rule_id=destination_tap_rule_id, - **kwargs - ) - - -class NetworkTapRule(TrackedResource): # pylint: disable=too-many-instance-attributes - """The NetworkTapRule resource definition. - - 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 Azure. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar configuration_type: Input method to configure Network Tap Rule. Known values are: "File" - and "Inline". - :vartype configuration_type: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationType - :ivar tap_rules_url: Network Tap Rules file URL. - :vartype tap_rules_url: str - :ivar match_configurations: List of match configurations. - :vartype match_configurations: - list[~azure.mgmt.managednetworkfabric.models.NetworkTapRuleMatchConfiguration] - :ivar dynamic_match_configurations: List of dynamic match configurations. - :vartype dynamic_match_configurations: - list[~azure.mgmt.managednetworkfabric.models.CommonDynamicMatchConfiguration] - :ivar network_tap_id: The ARM resource Id of the NetworkTap. - :vartype network_tap_id: str - :ivar polling_interval_in_seconds: Polling interval in seconds. Known values are: 30, 60, 90, - and 120. - :vartype polling_interval_in_seconds: int or - ~azure.mgmt.managednetworkfabric.models.PollingIntervalInSeconds - :ivar last_synced_time: The last sync timestamp. - :vartype last_synced_time: ~datetime.datetime - :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", - "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", - "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", - "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.AdministrativeState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "tap_rules_url": {"min_length": 1}, - "match_configurations": {"min_items": 1}, - "dynamic_match_configurations": {"min_items": 1}, - "network_tap_id": {"readonly": True}, - "last_synced_time": {"readonly": True}, - "configuration_state": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "administrative_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "annotation": {"key": "properties.annotation", "type": "str"}, - "configuration_type": {"key": "properties.configurationType", "type": "str"}, - "tap_rules_url": {"key": "properties.tapRulesUrl", "type": "str"}, - "match_configurations": {"key": "properties.matchConfigurations", "type": "[NetworkTapRuleMatchConfiguration]"}, - "dynamic_match_configurations": { - "key": "properties.dynamicMatchConfigurations", - "type": "[CommonDynamicMatchConfiguration]", - }, - "network_tap_id": {"key": "properties.networkTapId", "type": "str"}, - "polling_interval_in_seconds": {"key": "properties.pollingIntervalInSeconds", "type": "int"}, - "last_synced_time": {"key": "properties.lastSyncedTime", "type": "iso-8601"}, - "configuration_state": {"key": "properties.configurationState", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "administrative_state": {"key": "properties.administrativeState", "type": "str"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - annotation: Optional[str] = None, - configuration_type: Optional[Union[str, "_models.ConfigurationType"]] = None, - tap_rules_url: Optional[str] = None, - match_configurations: Optional[List["_models.NetworkTapRuleMatchConfiguration"]] = None, - dynamic_match_configurations: Optional[List["_models.CommonDynamicMatchConfiguration"]] = None, - polling_interval_in_seconds: Union[int, "_models.PollingIntervalInSeconds"] = 30, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword configuration_type: Input method to configure Network Tap Rule. Known values are: - "File" and "Inline". - :paramtype configuration_type: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationType - :keyword tap_rules_url: Network Tap Rules file URL. - :paramtype tap_rules_url: str - :keyword match_configurations: List of match configurations. - :paramtype match_configurations: - list[~azure.mgmt.managednetworkfabric.models.NetworkTapRuleMatchConfiguration] - :keyword dynamic_match_configurations: List of dynamic match configurations. - :paramtype dynamic_match_configurations: - list[~azure.mgmt.managednetworkfabric.models.CommonDynamicMatchConfiguration] - :keyword polling_interval_in_seconds: Polling interval in seconds. Known values are: 30, 60, - 90, and 120. - :paramtype polling_interval_in_seconds: int or - ~azure.mgmt.managednetworkfabric.models.PollingIntervalInSeconds - """ - super().__init__(tags=tags, location=location, **kwargs) - self.annotation = annotation - self.configuration_type = configuration_type - self.tap_rules_url = tap_rules_url - self.match_configurations = match_configurations - self.dynamic_match_configurations = dynamic_match_configurations - self.network_tap_id = None - self.polling_interval_in_seconds = polling_interval_in_seconds - self.last_synced_time = None - self.configuration_state = None - self.provisioning_state = None - self.administrative_state = None - - -class NetworkTapRuleAction(_serialization.Model): - """Action that need to performed. - - :ivar type: Type of actions that can be performed. Known values are: "Drop", "Count", "Log", - "Replicate", "Goto", "Redirect", and "Mirror". - :vartype type: str or ~azure.mgmt.managednetworkfabric.models.TapRuleActionType - :ivar truncate: Truncate. 0 indicates do not truncate. - :vartype truncate: str - :ivar is_timestamp_enabled: The parameter to enable or disable the timestamp. Known values are: - "True" and "False". - :vartype is_timestamp_enabled: str or - ~azure.mgmt.managednetworkfabric.models.BooleanEnumProperty - :ivar destination_id: Destination Id. The ARM resource Id may be either Network To Network - Interconnect or NeighborGroup. - :vartype destination_id: str - :ivar match_configuration_name: The name of the match configuration. This is used when Goto - type is provided. If Goto type is selected and no match configuration name is provided. It goes - to next configuration. - :vartype match_configuration_name: str - """ - - _validation = { - "truncate": {"min_length": 1}, - "match_configuration_name": {"min_length": 1}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "truncate": {"key": "truncate", "type": "str"}, - "is_timestamp_enabled": {"key": "isTimestampEnabled", "type": "str"}, - "destination_id": {"key": "destinationId", "type": "str"}, - "match_configuration_name": {"key": "matchConfigurationName", "type": "str"}, - } - - def __init__( - self, - *, - type: Optional[Union[str, "_models.TapRuleActionType"]] = None, - truncate: Optional[str] = None, - is_timestamp_enabled: Optional[Union[str, "_models.BooleanEnumProperty"]] = None, - destination_id: Optional[str] = None, - match_configuration_name: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword type: Type of actions that can be performed. Known values are: "Drop", "Count", "Log", - "Replicate", "Goto", "Redirect", and "Mirror". - :paramtype type: str or ~azure.mgmt.managednetworkfabric.models.TapRuleActionType - :keyword truncate: Truncate. 0 indicates do not truncate. - :paramtype truncate: str - :keyword is_timestamp_enabled: The parameter to enable or disable the timestamp. Known values - are: "True" and "False". - :paramtype is_timestamp_enabled: str or - ~azure.mgmt.managednetworkfabric.models.BooleanEnumProperty - :keyword destination_id: Destination Id. The ARM resource Id may be either Network To Network - Interconnect or NeighborGroup. - :paramtype destination_id: str - :keyword match_configuration_name: The name of the match configuration. This is used when Goto - type is provided. If Goto type is selected and no match configuration name is provided. It goes - to next configuration. - :paramtype match_configuration_name: str - """ - super().__init__(**kwargs) - self.type = type - self.truncate = truncate - self.is_timestamp_enabled = is_timestamp_enabled - self.destination_id = destination_id - self.match_configuration_name = match_configuration_name - - -class NetworkTapRuleMatchCondition(CommonMatchConditions): - """Defines the match condition that is supported to filter the traffic. - - :ivar protocol_types: List of the protocols that need to be matched. - :vartype protocol_types: list[str] - :ivar vlan_match_condition: Vlan match condition that needs to be matched. - :vartype vlan_match_condition: ~azure.mgmt.managednetworkfabric.models.VlanMatchCondition - :ivar ip_condition: IP condition that needs to be matched. - :vartype ip_condition: ~azure.mgmt.managednetworkfabric.models.IpMatchCondition - :ivar encapsulation_type: Encapsulation Type. Known values are: "None" and "GTPv1". - :vartype encapsulation_type: str or ~azure.mgmt.managednetworkfabric.models.EncapsulationType - :ivar port_condition: Defines the port condition that needs to be matched. - :vartype port_condition: ~azure.mgmt.managednetworkfabric.models.PortCondition - """ - - _validation = { - "protocol_types": {"min_items": 1}, - } - - _attribute_map = { - "protocol_types": {"key": "protocolTypes", "type": "[str]"}, - "vlan_match_condition": {"key": "vlanMatchCondition", "type": "VlanMatchCondition"}, - "ip_condition": {"key": "ipCondition", "type": "IpMatchCondition"}, - "encapsulation_type": {"key": "encapsulationType", "type": "str"}, - "port_condition": {"key": "portCondition", "type": "PortCondition"}, - } - - def __init__( - self, - *, - protocol_types: Optional[List[str]] = None, - vlan_match_condition: Optional["_models.VlanMatchCondition"] = None, - ip_condition: Optional["_models.IpMatchCondition"] = None, - encapsulation_type: Union[str, "_models.EncapsulationType"] = "None", - port_condition: Optional["_models.PortCondition"] = None, - **kwargs: Any - ) -> None: - """ - :keyword protocol_types: List of the protocols that need to be matched. - :paramtype protocol_types: list[str] - :keyword vlan_match_condition: Vlan match condition that needs to be matched. - :paramtype vlan_match_condition: ~azure.mgmt.managednetworkfabric.models.VlanMatchCondition - :keyword ip_condition: IP condition that needs to be matched. - :paramtype ip_condition: ~azure.mgmt.managednetworkfabric.models.IpMatchCondition - :keyword encapsulation_type: Encapsulation Type. Known values are: "None" and "GTPv1". - :paramtype encapsulation_type: str or ~azure.mgmt.managednetworkfabric.models.EncapsulationType - :keyword port_condition: Defines the port condition that needs to be matched. - :paramtype port_condition: ~azure.mgmt.managednetworkfabric.models.PortCondition - """ - super().__init__( - protocol_types=protocol_types, - vlan_match_condition=vlan_match_condition, - ip_condition=ip_condition, - **kwargs - ) - self.encapsulation_type = encapsulation_type - self.port_condition = port_condition - - -class NetworkTapRuleMatchConfiguration(_serialization.Model): - """Defines the match configuration that are supported to filter the traffic. - - :ivar match_configuration_name: The name of the match configuration. - :vartype match_configuration_name: str - :ivar sequence_number: Sequence Number of the match configuration.. - :vartype sequence_number: int - :ivar ip_address_type: Type of IP Address. IPv4 or IPv6. Known values are: "IPv4" and "IPv6". - :vartype ip_address_type: str or ~azure.mgmt.managednetworkfabric.models.IPAddressType - :ivar match_conditions: List of the match conditions. - :vartype match_conditions: - list[~azure.mgmt.managednetworkfabric.models.NetworkTapRuleMatchCondition] - :ivar actions: List of actions that need to be performed for the matched conditions. - :vartype actions: list[~azure.mgmt.managednetworkfabric.models.NetworkTapRuleAction] - """ - - _validation = { - "match_configuration_name": {"min_length": 1}, - "sequence_number": {"maximum": 4294967295, "minimum": 1}, - "match_conditions": {"min_items": 1}, - "actions": {"min_items": 1}, - } - - _attribute_map = { - "match_configuration_name": {"key": "matchConfigurationName", "type": "str"}, - "sequence_number": {"key": "sequenceNumber", "type": "int"}, - "ip_address_type": {"key": "ipAddressType", "type": "str"}, - "match_conditions": {"key": "matchConditions", "type": "[NetworkTapRuleMatchCondition]"}, - "actions": {"key": "actions", "type": "[NetworkTapRuleAction]"}, - } - - def __init__( - self, - *, - match_configuration_name: Optional[str] = None, - sequence_number: Optional[int] = None, - ip_address_type: Optional[Union[str, "_models.IPAddressType"]] = None, - match_conditions: Optional[List["_models.NetworkTapRuleMatchCondition"]] = None, - actions: Optional[List["_models.NetworkTapRuleAction"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword match_configuration_name: The name of the match configuration. - :paramtype match_configuration_name: str - :keyword sequence_number: Sequence Number of the match configuration.. - :paramtype sequence_number: int - :keyword ip_address_type: Type of IP Address. IPv4 or IPv6. Known values are: "IPv4" and - "IPv6". - :paramtype ip_address_type: str or ~azure.mgmt.managednetworkfabric.models.IPAddressType - :keyword match_conditions: List of the match conditions. - :paramtype match_conditions: - list[~azure.mgmt.managednetworkfabric.models.NetworkTapRuleMatchCondition] - :keyword actions: List of actions that need to be performed for the matched conditions. - :paramtype actions: list[~azure.mgmt.managednetworkfabric.models.NetworkTapRuleAction] - """ - super().__init__(**kwargs) - self.match_configuration_name = match_configuration_name - self.sequence_number = sequence_number - self.ip_address_type = ip_address_type - self.match_conditions = match_conditions - self.actions = actions - - -class NetworkTapRulePatch(TagsUpdate): - """The NetworkTapRule resource definition. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar configuration_type: Input method to configure Network Tap Rule. Known values are: "File" - and "Inline". - :vartype configuration_type: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationType - :ivar tap_rules_url: Network Tap Rules file URL. - :vartype tap_rules_url: str - :ivar match_configurations: List of match configurations. - :vartype match_configurations: - list[~azure.mgmt.managednetworkfabric.models.NetworkTapRuleMatchConfiguration] - :ivar dynamic_match_configurations: List of dynamic match configurations. - :vartype dynamic_match_configurations: - list[~azure.mgmt.managednetworkfabric.models.CommonDynamicMatchConfiguration] - """ - - _validation = { - "tap_rules_url": {"min_length": 1}, - "match_configurations": {"min_items": 1}, - "dynamic_match_configurations": {"min_items": 1}, - } - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "annotation": {"key": "properties.annotation", "type": "str"}, - "configuration_type": {"key": "properties.configurationType", "type": "str"}, - "tap_rules_url": {"key": "properties.tapRulesUrl", "type": "str"}, - "match_configurations": {"key": "properties.matchConfigurations", "type": "[NetworkTapRuleMatchConfiguration]"}, - "dynamic_match_configurations": { - "key": "properties.dynamicMatchConfigurations", - "type": "[CommonDynamicMatchConfiguration]", - }, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - annotation: Optional[str] = None, - configuration_type: Optional[Union[str, "_models.ConfigurationType"]] = None, - tap_rules_url: Optional[str] = None, - match_configurations: Optional[List["_models.NetworkTapRuleMatchConfiguration"]] = None, - dynamic_match_configurations: Optional[List["_models.CommonDynamicMatchConfiguration"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword configuration_type: Input method to configure Network Tap Rule. Known values are: - "File" and "Inline". - :paramtype configuration_type: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationType - :keyword tap_rules_url: Network Tap Rules file URL. - :paramtype tap_rules_url: str - :keyword match_configurations: List of match configurations. - :paramtype match_configurations: - list[~azure.mgmt.managednetworkfabric.models.NetworkTapRuleMatchConfiguration] - :keyword dynamic_match_configurations: List of dynamic match configurations. - :paramtype dynamic_match_configurations: - list[~azure.mgmt.managednetworkfabric.models.CommonDynamicMatchConfiguration] - """ - super().__init__(tags=tags, **kwargs) - self.annotation = annotation - self.configuration_type = configuration_type - self.tap_rules_url = tap_rules_url - self.match_configurations = match_configurations - self.dynamic_match_configurations = dynamic_match_configurations - - -class NetworkTapRulePatchableProperties(_serialization.Model): - """Network Tap Rule updatable properties. - - :ivar configuration_type: Input method to configure Network Tap Rule. Known values are: "File" - and "Inline". - :vartype configuration_type: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationType - :ivar tap_rules_url: Network Tap Rules file URL. - :vartype tap_rules_url: str - :ivar match_configurations: List of match configurations. - :vartype match_configurations: - list[~azure.mgmt.managednetworkfabric.models.NetworkTapRuleMatchConfiguration] - :ivar dynamic_match_configurations: List of dynamic match configurations. - :vartype dynamic_match_configurations: - list[~azure.mgmt.managednetworkfabric.models.CommonDynamicMatchConfiguration] - """ - - _validation = { - "tap_rules_url": {"min_length": 1}, - "match_configurations": {"min_items": 1}, - "dynamic_match_configurations": {"min_items": 1}, - } - - _attribute_map = { - "configuration_type": {"key": "configurationType", "type": "str"}, - "tap_rules_url": {"key": "tapRulesUrl", "type": "str"}, - "match_configurations": {"key": "matchConfigurations", "type": "[NetworkTapRuleMatchConfiguration]"}, - "dynamic_match_configurations": { - "key": "dynamicMatchConfigurations", - "type": "[CommonDynamicMatchConfiguration]", - }, - } - - def __init__( - self, - *, - configuration_type: Optional[Union[str, "_models.ConfigurationType"]] = None, - tap_rules_url: Optional[str] = None, - match_configurations: Optional[List["_models.NetworkTapRuleMatchConfiguration"]] = None, - dynamic_match_configurations: Optional[List["_models.CommonDynamicMatchConfiguration"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword configuration_type: Input method to configure Network Tap Rule. Known values are: - "File" and "Inline". - :paramtype configuration_type: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationType - :keyword tap_rules_url: Network Tap Rules file URL. - :paramtype tap_rules_url: str - :keyword match_configurations: List of match configurations. - :paramtype match_configurations: - list[~azure.mgmt.managednetworkfabric.models.NetworkTapRuleMatchConfiguration] - :keyword dynamic_match_configurations: List of dynamic match configurations. - :paramtype dynamic_match_configurations: - list[~azure.mgmt.managednetworkfabric.models.CommonDynamicMatchConfiguration] - """ - super().__init__(**kwargs) - self.configuration_type = configuration_type - self.tap_rules_url = tap_rules_url - self.match_configurations = match_configurations - self.dynamic_match_configurations = dynamic_match_configurations - - -class NetworkTapRulePatchProperties(AnnotationResource, NetworkTapRulePatchableProperties): - """Network Tap Rule Patch properties. - - :ivar configuration_type: Input method to configure Network Tap Rule. Known values are: "File" - and "Inline". - :vartype configuration_type: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationType - :ivar tap_rules_url: Network Tap Rules file URL. - :vartype tap_rules_url: str - :ivar match_configurations: List of match configurations. - :vartype match_configurations: - list[~azure.mgmt.managednetworkfabric.models.NetworkTapRuleMatchConfiguration] - :ivar dynamic_match_configurations: List of dynamic match configurations. - :vartype dynamic_match_configurations: - list[~azure.mgmt.managednetworkfabric.models.CommonDynamicMatchConfiguration] - :ivar annotation: Switch configuration description. - :vartype annotation: str - """ - - _validation = { - "tap_rules_url": {"min_length": 1}, - "match_configurations": {"min_items": 1}, - "dynamic_match_configurations": {"min_items": 1}, - } - - _attribute_map = { - "configuration_type": {"key": "configurationType", "type": "str"}, - "tap_rules_url": {"key": "tapRulesUrl", "type": "str"}, - "match_configurations": {"key": "matchConfigurations", "type": "[NetworkTapRuleMatchConfiguration]"}, - "dynamic_match_configurations": { - "key": "dynamicMatchConfigurations", - "type": "[CommonDynamicMatchConfiguration]", - }, - "annotation": {"key": "annotation", "type": "str"}, - } - - def __init__( - self, - *, - configuration_type: Optional[Union[str, "_models.ConfigurationType"]] = None, - tap_rules_url: Optional[str] = None, - match_configurations: Optional[List["_models.NetworkTapRuleMatchConfiguration"]] = None, - dynamic_match_configurations: Optional[List["_models.CommonDynamicMatchConfiguration"]] = None, - annotation: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword configuration_type: Input method to configure Network Tap Rule. Known values are: - "File" and "Inline". - :paramtype configuration_type: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationType - :keyword tap_rules_url: Network Tap Rules file URL. - :paramtype tap_rules_url: str - :keyword match_configurations: List of match configurations. - :paramtype match_configurations: - list[~azure.mgmt.managednetworkfabric.models.NetworkTapRuleMatchConfiguration] - :keyword dynamic_match_configurations: List of dynamic match configurations. - :paramtype dynamic_match_configurations: - list[~azure.mgmt.managednetworkfabric.models.CommonDynamicMatchConfiguration] - :keyword annotation: Switch configuration description. - :paramtype annotation: str - """ - super().__init__( - annotation=annotation, - configuration_type=configuration_type, - tap_rules_url=tap_rules_url, - match_configurations=match_configurations, - dynamic_match_configurations=dynamic_match_configurations, - **kwargs - ) - self.configuration_type = configuration_type - self.tap_rules_url = tap_rules_url - self.match_configurations = match_configurations - self.dynamic_match_configurations = dynamic_match_configurations - self.annotation = annotation - - -class NetworkTapRuleProperties( - AnnotationResource, NetworkTapRulePatchableProperties -): # pylint: disable=too-many-instance-attributes - """Network Tap Rule Properties defines the resource properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar configuration_type: Input method to configure Network Tap Rule. Known values are: "File" - and "Inline". - :vartype configuration_type: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationType - :ivar tap_rules_url: Network Tap Rules file URL. - :vartype tap_rules_url: str - :ivar match_configurations: List of match configurations. - :vartype match_configurations: - list[~azure.mgmt.managednetworkfabric.models.NetworkTapRuleMatchConfiguration] - :ivar dynamic_match_configurations: List of dynamic match configurations. - :vartype dynamic_match_configurations: - list[~azure.mgmt.managednetworkfabric.models.CommonDynamicMatchConfiguration] - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar network_tap_id: The ARM resource Id of the NetworkTap. - :vartype network_tap_id: str - :ivar polling_interval_in_seconds: Polling interval in seconds. Known values are: 30, 60, 90, - and 120. - :vartype polling_interval_in_seconds: int or - ~azure.mgmt.managednetworkfabric.models.PollingIntervalInSeconds - :ivar last_synced_time: The last sync timestamp. - :vartype last_synced_time: ~datetime.datetime - :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", - "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", - "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", - "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.AdministrativeState - """ - - _validation = { - "tap_rules_url": {"min_length": 1}, - "match_configurations": {"min_items": 1}, - "dynamic_match_configurations": {"min_items": 1}, - "network_tap_id": {"readonly": True}, - "last_synced_time": {"readonly": True}, - "configuration_state": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "administrative_state": {"readonly": True}, - } - - _attribute_map = { - "configuration_type": {"key": "configurationType", "type": "str"}, - "tap_rules_url": {"key": "tapRulesUrl", "type": "str"}, - "match_configurations": {"key": "matchConfigurations", "type": "[NetworkTapRuleMatchConfiguration]"}, - "dynamic_match_configurations": { - "key": "dynamicMatchConfigurations", - "type": "[CommonDynamicMatchConfiguration]", - }, - "annotation": {"key": "annotation", "type": "str"}, - "network_tap_id": {"key": "networkTapId", "type": "str"}, - "polling_interval_in_seconds": {"key": "pollingIntervalInSeconds", "type": "int"}, - "last_synced_time": {"key": "lastSyncedTime", "type": "iso-8601"}, - "configuration_state": {"key": "configurationState", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "administrative_state": {"key": "administrativeState", "type": "str"}, - } - - def __init__( - self, - *, - configuration_type: Optional[Union[str, "_models.ConfigurationType"]] = None, - tap_rules_url: Optional[str] = None, - match_configurations: Optional[List["_models.NetworkTapRuleMatchConfiguration"]] = None, - dynamic_match_configurations: Optional[List["_models.CommonDynamicMatchConfiguration"]] = None, - annotation: Optional[str] = None, - polling_interval_in_seconds: Union[int, "_models.PollingIntervalInSeconds"] = 30, - **kwargs: Any - ) -> None: - """ - :keyword configuration_type: Input method to configure Network Tap Rule. Known values are: - "File" and "Inline". - :paramtype configuration_type: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationType - :keyword tap_rules_url: Network Tap Rules file URL. - :paramtype tap_rules_url: str - :keyword match_configurations: List of match configurations. - :paramtype match_configurations: - list[~azure.mgmt.managednetworkfabric.models.NetworkTapRuleMatchConfiguration] - :keyword dynamic_match_configurations: List of dynamic match configurations. - :paramtype dynamic_match_configurations: - list[~azure.mgmt.managednetworkfabric.models.CommonDynamicMatchConfiguration] - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword polling_interval_in_seconds: Polling interval in seconds. Known values are: 30, 60, - 90, and 120. - :paramtype polling_interval_in_seconds: int or - ~azure.mgmt.managednetworkfabric.models.PollingIntervalInSeconds - """ - super().__init__( - annotation=annotation, - configuration_type=configuration_type, - tap_rules_url=tap_rules_url, - match_configurations=match_configurations, - dynamic_match_configurations=dynamic_match_configurations, - **kwargs - ) - self.configuration_type = configuration_type - self.tap_rules_url = tap_rules_url - self.match_configurations = match_configurations - self.dynamic_match_configurations = dynamic_match_configurations - self.network_tap_id = None - self.polling_interval_in_seconds = polling_interval_in_seconds - self.last_synced_time = None - self.configuration_state = None - self.provisioning_state = None - self.administrative_state = None - self.annotation = annotation - - -class NetworkTapRulesListResult(_serialization.Model): - """List of NetworkTapRules. - - :ivar value: List of NetworkTapRule resources. - :vartype value: list[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] - :ivar next_link: Url to follow for getting next page of resources. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[NetworkTapRule]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: Optional[List["_models.NetworkTapRule"]] = None, next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: List of NetworkTapRule resources. - :paramtype value: list[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] - :keyword next_link: Url to follow for getting next page of resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class NetworkTapsListResult(_serialization.Model): - """List of NetworkTaps. - - :ivar value: List of NetworkTap resources. - :vartype value: list[~azure.mgmt.managednetworkfabric.models.NetworkTap] - :ivar next_link: Url to follow for getting next page of resources. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[NetworkTap]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: Optional[List["_models.NetworkTap"]] = None, next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: List of NetworkTap resources. - :paramtype value: list[~azure.mgmt.managednetworkfabric.models.NetworkTap] - :keyword next_link: Url to follow for getting next page of resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class NetworkToNetworkInterconnect(ProxyResource): # pylint: disable=too-many-instance-attributes - """The Network To Network Interconnect resource definition. - - 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 Azure. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData - :ivar nni_type: Type of NNI used. Example: CE | NPB. Known values are: "CE" and "NPB". - :vartype nni_type: str or ~azure.mgmt.managednetworkfabric.models.NniType - :ivar is_management_type: Configuration to use NNI for Infrastructure Management. Example: - True/False. Known values are: "True" and "False". - :vartype is_management_type: str or ~azure.mgmt.managednetworkfabric.models.IsManagementType - :ivar use_option_b: Based on this option layer3 parameters are mandatory. Example: True/False. - Required. Known values are: "True" and "False". - :vartype use_option_b: str or ~azure.mgmt.managednetworkfabric.models.BooleanEnumProperty - :ivar layer2_configuration: Common properties for Layer2 Configuration. - :vartype layer2_configuration: ~azure.mgmt.managednetworkfabric.models.Layer2Configuration - :ivar option_b_layer3_configuration: Common properties for Layer3Configuration. - :vartype option_b_layer3_configuration: - ~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration - :ivar npb_static_route_configuration: NPB Static Route Configuration properties. - :vartype npb_static_route_configuration: - ~azure.mgmt.managednetworkfabric.models.NpbStaticRouteConfiguration - :ivar import_route_policy: Import Route Policy configuration. - :vartype import_route_policy: - ~azure.mgmt.managednetworkfabric.models.ImportRoutePolicyInformation - :ivar export_route_policy: Export Route Policy configuration. - :vartype export_route_policy: - ~azure.mgmt.managednetworkfabric.models.ExportRoutePolicyInformation - :ivar egress_acl_id: Egress Acl. ARM resource ID of Access Control Lists. - :vartype egress_acl_id: str - :ivar ingress_acl_id: Ingress Acl. ARM resource ID of Access Control Lists. - :vartype ingress_acl_id: str - :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", - "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", - "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", - "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.AdministrativeState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "use_option_b": {"required": True}, - "configuration_state": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "administrative_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "nni_type": {"key": "properties.nniType", "type": "str"}, - "is_management_type": {"key": "properties.isManagementType", "type": "str"}, - "use_option_b": {"key": "properties.useOptionB", "type": "str"}, - "layer2_configuration": {"key": "properties.layer2Configuration", "type": "Layer2Configuration"}, - "option_b_layer3_configuration": { - "key": "properties.optionBLayer3Configuration", - "type": "NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration", - }, - "npb_static_route_configuration": { - "key": "properties.npbStaticRouteConfiguration", - "type": "NpbStaticRouteConfiguration", - }, - "import_route_policy": {"key": "properties.importRoutePolicy", "type": "ImportRoutePolicyInformation"}, - "export_route_policy": {"key": "properties.exportRoutePolicy", "type": "ExportRoutePolicyInformation"}, - "egress_acl_id": {"key": "properties.egressAclId", "type": "str"}, - "ingress_acl_id": {"key": "properties.ingressAclId", "type": "str"}, - "configuration_state": {"key": "properties.configurationState", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "administrative_state": {"key": "properties.administrativeState", "type": "str"}, - } - - def __init__( - self, - *, - use_option_b: Union[str, "_models.BooleanEnumProperty"], - nni_type: Union[str, "_models.NniType"] = "CE", - is_management_type: Union[str, "_models.IsManagementType"] = "True", - layer2_configuration: Optional["_models.Layer2Configuration"] = None, - option_b_layer3_configuration: Optional[ - "_models.NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration" - ] = None, - npb_static_route_configuration: Optional["_models.NpbStaticRouteConfiguration"] = None, - import_route_policy: Optional["_models.ImportRoutePolicyInformation"] = None, - export_route_policy: Optional["_models.ExportRoutePolicyInformation"] = None, - egress_acl_id: Optional[str] = None, - ingress_acl_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword nni_type: Type of NNI used. Example: CE | NPB. Known values are: "CE" and "NPB". - :paramtype nni_type: str or ~azure.mgmt.managednetworkfabric.models.NniType - :keyword is_management_type: Configuration to use NNI for Infrastructure Management. Example: - True/False. Known values are: "True" and "False". - :paramtype is_management_type: str or ~azure.mgmt.managednetworkfabric.models.IsManagementType - :keyword use_option_b: Based on this option layer3 parameters are mandatory. Example: - True/False. Required. Known values are: "True" and "False". - :paramtype use_option_b: str or ~azure.mgmt.managednetworkfabric.models.BooleanEnumProperty - :keyword layer2_configuration: Common properties for Layer2 Configuration. - :paramtype layer2_configuration: ~azure.mgmt.managednetworkfabric.models.Layer2Configuration - :keyword option_b_layer3_configuration: Common properties for Layer3Configuration. - :paramtype option_b_layer3_configuration: - ~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration - :keyword npb_static_route_configuration: NPB Static Route Configuration properties. - :paramtype npb_static_route_configuration: - ~azure.mgmt.managednetworkfabric.models.NpbStaticRouteConfiguration - :keyword import_route_policy: Import Route Policy configuration. - :paramtype import_route_policy: - ~azure.mgmt.managednetworkfabric.models.ImportRoutePolicyInformation - :keyword export_route_policy: Export Route Policy configuration. - :paramtype export_route_policy: - ~azure.mgmt.managednetworkfabric.models.ExportRoutePolicyInformation - :keyword egress_acl_id: Egress Acl. ARM resource ID of Access Control Lists. - :paramtype egress_acl_id: str - :keyword ingress_acl_id: Ingress Acl. ARM resource ID of Access Control Lists. - :paramtype ingress_acl_id: str - """ - super().__init__(**kwargs) - self.nni_type = nni_type - self.is_management_type = is_management_type - self.use_option_b = use_option_b - self.layer2_configuration = layer2_configuration - self.option_b_layer3_configuration = option_b_layer3_configuration - self.npb_static_route_configuration = npb_static_route_configuration - self.import_route_policy = import_route_policy - self.export_route_policy = export_route_policy - self.egress_acl_id = egress_acl_id - self.ingress_acl_id = ingress_acl_id - self.configuration_state = None - self.provisioning_state = None - self.administrative_state = None - - -class NetworkToNetworkInterconnectPatch(ProxyResource): # pylint: disable=too-many-instance-attributes - """The Network To Network Interconnect resource patch definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData - :ivar layer2_configuration: Common properties for Layer2Configuration. - :vartype layer2_configuration: ~azure.mgmt.managednetworkfabric.models.Layer2Configuration - :ivar option_b_layer3_configuration: Common properties for Layer3Configuration. - :vartype option_b_layer3_configuration: - ~azure.mgmt.managednetworkfabric.models.OptionBLayer3Configuration - :ivar npb_static_route_configuration: NPB Static Route Configuration properties. - :vartype npb_static_route_configuration: - ~azure.mgmt.managednetworkfabric.models.NpbStaticRouteConfiguration - :ivar import_route_policy: Import Route Policy information. - :vartype import_route_policy: - ~azure.mgmt.managednetworkfabric.models.ImportRoutePolicyInformation - :ivar export_route_policy: Export Route Policy information. - :vartype export_route_policy: - ~azure.mgmt.managednetworkfabric.models.ExportRoutePolicyInformation - :ivar egress_acl_id: Egress Acl. ARM resource ID of Access Control Lists. - :vartype egress_acl_id: str - :ivar ingress_acl_id: Ingress Acl. ARM resource ID of Access Control Lists. - :vartype ingress_acl_id: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "layer2_configuration": {"key": "properties.layer2Configuration", "type": "Layer2Configuration"}, - "option_b_layer3_configuration": { - "key": "properties.optionBLayer3Configuration", - "type": "OptionBLayer3Configuration", - }, - "npb_static_route_configuration": { - "key": "properties.npbStaticRouteConfiguration", - "type": "NpbStaticRouteConfiguration", - }, - "import_route_policy": {"key": "properties.importRoutePolicy", "type": "ImportRoutePolicyInformation"}, - "export_route_policy": {"key": "properties.exportRoutePolicy", "type": "ExportRoutePolicyInformation"}, - "egress_acl_id": {"key": "properties.egressAclId", "type": "str"}, - "ingress_acl_id": {"key": "properties.ingressAclId", "type": "str"}, - } - - def __init__( - self, - *, - layer2_configuration: Optional["_models.Layer2Configuration"] = None, - option_b_layer3_configuration: Optional["_models.OptionBLayer3Configuration"] = None, - npb_static_route_configuration: Optional["_models.NpbStaticRouteConfiguration"] = None, - import_route_policy: Optional["_models.ImportRoutePolicyInformation"] = None, - export_route_policy: Optional["_models.ExportRoutePolicyInformation"] = None, - egress_acl_id: Optional[str] = None, - ingress_acl_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword layer2_configuration: Common properties for Layer2Configuration. - :paramtype layer2_configuration: ~azure.mgmt.managednetworkfabric.models.Layer2Configuration - :keyword option_b_layer3_configuration: Common properties for Layer3Configuration. - :paramtype option_b_layer3_configuration: - ~azure.mgmt.managednetworkfabric.models.OptionBLayer3Configuration - :keyword npb_static_route_configuration: NPB Static Route Configuration properties. - :paramtype npb_static_route_configuration: - ~azure.mgmt.managednetworkfabric.models.NpbStaticRouteConfiguration - :keyword import_route_policy: Import Route Policy information. - :paramtype import_route_policy: - ~azure.mgmt.managednetworkfabric.models.ImportRoutePolicyInformation - :keyword export_route_policy: Export Route Policy information. - :paramtype export_route_policy: - ~azure.mgmt.managednetworkfabric.models.ExportRoutePolicyInformation - :keyword egress_acl_id: Egress Acl. ARM resource ID of Access Control Lists. - :paramtype egress_acl_id: str - :keyword ingress_acl_id: Ingress Acl. ARM resource ID of Access Control Lists. - :paramtype ingress_acl_id: str - """ - super().__init__(**kwargs) - self.layer2_configuration = layer2_configuration - self.option_b_layer3_configuration = option_b_layer3_configuration - self.npb_static_route_configuration = npb_static_route_configuration - self.import_route_policy = import_route_policy - self.export_route_policy = export_route_policy - self.egress_acl_id = egress_acl_id - self.ingress_acl_id = ingress_acl_id - - -class OptionBLayer3Configuration(Layer3IpPrefixProperties): - """OptionB Layer3 Configuration properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar primary_ipv4_prefix: IPv4 Address Prefix. - :vartype primary_ipv4_prefix: str - :ivar primary_ipv6_prefix: IPv6 Address Prefix. - :vartype primary_ipv6_prefix: str - :ivar secondary_ipv4_prefix: Secondary IPv4 Address Prefix. - :vartype secondary_ipv4_prefix: str - :ivar secondary_ipv6_prefix: Secondary IPv6 Address Prefix. - :vartype secondary_ipv6_prefix: str - :ivar peer_asn: ASN of PE devices for CE/PE connectivity.Example : 28. - :vartype peer_asn: int - :ivar vlan_id: VLAN for CE/PE Layer 3 connectivity.Example : 501. - :vartype vlan_id: int - :ivar fabric_asn: ASN of CE devices for CE/PE connectivity. - :vartype fabric_asn: int - """ - - _validation = { - "peer_asn": {"maximum": 4294967295, "minimum": 1}, - "vlan_id": {"maximum": 4094, "minimum": 100}, - "fabric_asn": {"readonly": True}, - } - - _attribute_map = { - "primary_ipv4_prefix": {"key": "primaryIpv4Prefix", "type": "str"}, - "primary_ipv6_prefix": {"key": "primaryIpv6Prefix", "type": "str"}, - "secondary_ipv4_prefix": {"key": "secondaryIpv4Prefix", "type": "str"}, - "secondary_ipv6_prefix": {"key": "secondaryIpv6Prefix", "type": "str"}, - "peer_asn": {"key": "peerASN", "type": "int"}, - "vlan_id": {"key": "vlanId", "type": "int"}, - "fabric_asn": {"key": "fabricASN", "type": "int"}, - } - - def __init__( - self, - *, - primary_ipv4_prefix: Optional[str] = None, - primary_ipv6_prefix: Optional[str] = None, - secondary_ipv4_prefix: Optional[str] = None, - secondary_ipv6_prefix: Optional[str] = None, - peer_asn: Optional[int] = None, - vlan_id: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword primary_ipv4_prefix: IPv4 Address Prefix. - :paramtype primary_ipv4_prefix: str - :keyword primary_ipv6_prefix: IPv6 Address Prefix. - :paramtype primary_ipv6_prefix: str - :keyword secondary_ipv4_prefix: Secondary IPv4 Address Prefix. - :paramtype secondary_ipv4_prefix: str - :keyword secondary_ipv6_prefix: Secondary IPv6 Address Prefix. - :paramtype secondary_ipv6_prefix: str - :keyword peer_asn: ASN of PE devices for CE/PE connectivity.Example : 28. - :paramtype peer_asn: int - :keyword vlan_id: VLAN for CE/PE Layer 3 connectivity.Example : 501. - :paramtype vlan_id: int - """ - super().__init__( - primary_ipv4_prefix=primary_ipv4_prefix, - primary_ipv6_prefix=primary_ipv6_prefix, - secondary_ipv4_prefix=secondary_ipv4_prefix, - secondary_ipv6_prefix=secondary_ipv6_prefix, - **kwargs - ) - self.peer_asn = peer_asn - self.vlan_id = vlan_id - self.fabric_asn = None - - -class NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration(OptionBLayer3Configuration): - """Common properties for Layer3Configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar primary_ipv4_prefix: IPv4 Address Prefix. - :vartype primary_ipv4_prefix: str - :ivar primary_ipv6_prefix: IPv6 Address Prefix. - :vartype primary_ipv6_prefix: str - :ivar secondary_ipv4_prefix: Secondary IPv4 Address Prefix. - :vartype secondary_ipv4_prefix: str - :ivar secondary_ipv6_prefix: Secondary IPv6 Address Prefix. - :vartype secondary_ipv6_prefix: str - :ivar peer_asn: ASN of PE devices for CE/PE connectivity.Example : 28. - :vartype peer_asn: int - :ivar vlan_id: VLAN for CE/PE Layer 3 connectivity.Example : 501. - :vartype vlan_id: int - :ivar fabric_asn: ASN of CE devices for CE/PE connectivity. - :vartype fabric_asn: int - """ - - _validation = { - "peer_asn": {"maximum": 4294967295, "minimum": 1}, - "vlan_id": {"maximum": 4094, "minimum": 100}, - "fabric_asn": {"readonly": True}, - } - - _attribute_map = { - "primary_ipv4_prefix": {"key": "primaryIpv4Prefix", "type": "str"}, - "primary_ipv6_prefix": {"key": "primaryIpv6Prefix", "type": "str"}, - "secondary_ipv4_prefix": {"key": "secondaryIpv4Prefix", "type": "str"}, - "secondary_ipv6_prefix": {"key": "secondaryIpv6Prefix", "type": "str"}, - "peer_asn": {"key": "peerASN", "type": "int"}, - "vlan_id": {"key": "vlanId", "type": "int"}, - "fabric_asn": {"key": "fabricASN", "type": "int"}, - } - - def __init__( - self, - *, - primary_ipv4_prefix: Optional[str] = None, - primary_ipv6_prefix: Optional[str] = None, - secondary_ipv4_prefix: Optional[str] = None, - secondary_ipv6_prefix: Optional[str] = None, - peer_asn: Optional[int] = None, - vlan_id: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword primary_ipv4_prefix: IPv4 Address Prefix. - :paramtype primary_ipv4_prefix: str - :keyword primary_ipv6_prefix: IPv6 Address Prefix. - :paramtype primary_ipv6_prefix: str - :keyword secondary_ipv4_prefix: Secondary IPv4 Address Prefix. - :paramtype secondary_ipv4_prefix: str - :keyword secondary_ipv6_prefix: Secondary IPv6 Address Prefix. - :paramtype secondary_ipv6_prefix: str - :keyword peer_asn: ASN of PE devices for CE/PE connectivity.Example : 28. - :paramtype peer_asn: int - :keyword vlan_id: VLAN for CE/PE Layer 3 connectivity.Example : 501. - :paramtype vlan_id: int - """ - super().__init__( - primary_ipv4_prefix=primary_ipv4_prefix, - primary_ipv6_prefix=primary_ipv6_prefix, - secondary_ipv4_prefix=secondary_ipv4_prefix, - secondary_ipv6_prefix=secondary_ipv6_prefix, - peer_asn=peer_asn, - vlan_id=vlan_id, - **kwargs - ) - - -class NetworkToNetworkInterconnectsList(_serialization.Model): - """List of Network To Network Interconnects. - - :ivar value: List of NetworkToNetworkInterconnects resources. - :vartype value: list[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] - :ivar next_link: Url to follow for getting next page of resources. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[NetworkToNetworkInterconnect]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, - *, - value: Optional[List["_models.NetworkToNetworkInterconnect"]] = None, - next_link: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword value: List of NetworkToNetworkInterconnects resources. - :paramtype value: list[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] - :keyword next_link: Url to follow for getting next page of resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class NpbStaticRouteConfiguration(_serialization.Model): - """NPB Static Route Configuration properties. - - :ivar bfd_configuration: BFD Configuration properties. - :vartype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdConfiguration - :ivar ipv4_routes: List of IPv4 Routes. - :vartype ipv4_routes: list[~azure.mgmt.managednetworkfabric.models.StaticRouteProperties] - :ivar ipv6_routes: List of IPv6 Routes. - :vartype ipv6_routes: list[~azure.mgmt.managednetworkfabric.models.StaticRouteProperties] - """ - - _validation = { - "ipv4_routes": {"min_items": 1}, - "ipv6_routes": {"min_items": 1}, - } - - _attribute_map = { - "bfd_configuration": {"key": "bfdConfiguration", "type": "BfdConfiguration"}, - "ipv4_routes": {"key": "ipv4Routes", "type": "[StaticRouteProperties]"}, - "ipv6_routes": {"key": "ipv6Routes", "type": "[StaticRouteProperties]"}, - } - - def __init__( - self, - *, - bfd_configuration: Optional["_models.BfdConfiguration"] = None, - ipv4_routes: Optional[List["_models.StaticRouteProperties"]] = None, - ipv6_routes: Optional[List["_models.StaticRouteProperties"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword bfd_configuration: BFD Configuration properties. - :paramtype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdConfiguration - :keyword ipv4_routes: List of IPv4 Routes. - :paramtype ipv4_routes: list[~azure.mgmt.managednetworkfabric.models.StaticRouteProperties] - :keyword ipv6_routes: List of IPv6 Routes. - :paramtype ipv6_routes: list[~azure.mgmt.managednetworkfabric.models.StaticRouteProperties] - """ - super().__init__(**kwargs) - self.bfd_configuration = bfd_configuration - self.ipv4_routes = ipv4_routes - self.ipv6_routes = ipv6_routes - - -class Operation(_serialization.Model): - """Details of a REST API operation, returned from the Resource Provider Operations API. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - :vartype name: str - :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for - data-plane operations and "false" for ARM/control-plane operations. - :vartype is_data_action: bool - :ivar display: Localized display information for this particular operation. - :vartype display: ~azure.mgmt.managednetworkfabric.models.OperationDisplay - :ivar origin: The intended executor of the operation; as in Resource Based Access Control - (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", - and "user,system". - :vartype origin: str or ~azure.mgmt.managednetworkfabric.models.Origin - :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for - internal only APIs. "Internal" - :vartype action_type: str or ~azure.mgmt.managednetworkfabric.models.ActionType - """ - - _validation = { - "name": {"readonly": True}, - "is_data_action": {"readonly": True}, - "origin": {"readonly": True}, - "action_type": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "is_data_action": {"key": "isDataAction", "type": "bool"}, - "display": {"key": "display", "type": "OperationDisplay"}, - "origin": {"key": "origin", "type": "str"}, - "action_type": {"key": "actionType", "type": "str"}, - } - - def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None: - """ - :keyword display: Localized display information for this particular operation. - :paramtype display: ~azure.mgmt.managednetworkfabric.models.OperationDisplay - """ - super().__init__(**kwargs) - self.name = None - self.is_data_action = None - self.display = display - self.origin = None - self.action_type = None - - -class OperationDisplay(_serialization.Model): - """Localized display information for this particular operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft - Monitoring Insights" or "Microsoft Compute". - :vartype provider: str - :ivar resource: The localized friendly name of the resource type related to this operation. - E.g. "Virtual Machines" or "Job Schedule Collections". - :vartype resource: str - :ivar operation: The concise, localized friendly name for the operation; suitable for - dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - :vartype operation: str - :ivar description: The short, localized friendly description of the operation; suitable for - tool tips and detailed views. - :vartype description: str - """ - - _validation = { - "provider": {"readonly": True}, - "resource": {"readonly": True}, - "operation": {"readonly": True}, - "description": {"readonly": True}, - } - - _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, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None - self.description = None - - -class OperationListResult(_serialization.Model): - """A list of REST API operations supported by an Azure Resource Provider. It contains an 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 operations supported by the resource provider. - :vartype value: list[~azure.mgmt.managednetworkfabric.models.Operation] - :ivar next_link: URL to get the next set of operation list results (if there are any). - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Operation]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class OptionAProperties(_serialization.Model): - """Peering optionA properties. - - :ivar mtu: MTU to use for option A peering. - :vartype mtu: int - :ivar vlan_id: Vlan Id.Example : 501. - :vartype vlan_id: int - :ivar peer_asn: Peer ASN number.Example : 28. - :vartype peer_asn: int - :ivar bfd_configuration: BFD Configuration properties. - :vartype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdConfiguration - """ - - _validation = { - "mtu": {"maximum": 9200, "minimum": 64}, - "vlan_id": {"maximum": 4094, "minimum": 501}, - "peer_asn": {"maximum": 4294967295, "minimum": 1}, - } - - _attribute_map = { - "mtu": {"key": "mtu", "type": "int"}, - "vlan_id": {"key": "vlanId", "type": "int"}, - "peer_asn": {"key": "peerASN", "type": "int"}, - "bfd_configuration": {"key": "bfdConfiguration", "type": "BfdConfiguration"}, - } - - def __init__( - self, - *, - mtu: int = 1500, - vlan_id: Optional[int] = None, - peer_asn: Optional[int] = None, - bfd_configuration: Optional["_models.BfdConfiguration"] = None, - **kwargs: Any - ) -> None: - """ - :keyword mtu: MTU to use for option A peering. - :paramtype mtu: int - :keyword vlan_id: Vlan Id.Example : 501. - :paramtype vlan_id: int - :keyword peer_asn: Peer ASN number.Example : 28. - :paramtype peer_asn: int - :keyword bfd_configuration: BFD Configuration properties. - :paramtype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdConfiguration - """ - super().__init__(**kwargs) - self.mtu = mtu - self.vlan_id = vlan_id - self.peer_asn = peer_asn - self.bfd_configuration = bfd_configuration - - -class OptionBProperties(_serialization.Model): - """Option B configuration to be used for Management VPN. - - :ivar import_route_targets: Route Targets to be applied for incoming routes into CE. This is - for backward compatibility. - :vartype import_route_targets: list[str] - :ivar export_route_targets: Route Targets to be applied for outgoing routes from CE. This is - for backward compatibility. - :vartype export_route_targets: list[str] - :ivar route_targets: Route Targets to be applied. - :vartype route_targets: ~azure.mgmt.managednetworkfabric.models.RouteTargetInformation - """ - - _attribute_map = { - "import_route_targets": {"key": "importRouteTargets", "type": "[str]"}, - "export_route_targets": {"key": "exportRouteTargets", "type": "[str]"}, - "route_targets": {"key": "routeTargets", "type": "RouteTargetInformation"}, - } - - def __init__( - self, - *, - import_route_targets: Optional[List[str]] = None, - export_route_targets: Optional[List[str]] = None, - route_targets: Optional["_models.RouteTargetInformation"] = None, - **kwargs: Any - ) -> None: - """ - :keyword import_route_targets: Route Targets to be applied for incoming routes into CE. This is - for backward compatibility. - :paramtype import_route_targets: list[str] - :keyword export_route_targets: Route Targets to be applied for outgoing routes from CE. This is - for backward compatibility. - :paramtype export_route_targets: list[str] - :keyword route_targets: Route Targets to be applied. - :paramtype route_targets: ~azure.mgmt.managednetworkfabric.models.RouteTargetInformation - """ - super().__init__(**kwargs) - self.import_route_targets = import_route_targets - self.export_route_targets = export_route_targets - self.route_targets = route_targets - - -class PortGroupProperties(_serialization.Model): - """Port Group properties. - - :ivar name: The name of the port group. - :vartype name: str - :ivar ports: List of the ports that needs to be matched. - :vartype ports: list[str] - """ - - _validation = { - "name": {"min_length": 1}, - "ports": {"min_items": 1}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "ports": {"key": "ports", "type": "[str]"}, - } - - def __init__(self, *, name: Optional[str] = None, ports: Optional[List[str]] = None, **kwargs: Any) -> None: - """ - :keyword name: The name of the port group. - :paramtype name: str - :keyword ports: List of the ports that needs to be matched. - :paramtype ports: list[str] - """ - super().__init__(**kwargs) - self.name = name - self.ports = ports - - -class RebootProperties(_serialization.Model): - """Reboot properties. - - :ivar reboot_type: Type of reboot to be performed. Example: GracefulRebootWithZTP. Known values - are: "GracefulRebootWithZTP", "GracefulRebootWithoutZTP", "UngracefulRebootWithZTP", and - "UngracefulRebootWithoutZTP". - :vartype reboot_type: str or ~azure.mgmt.managednetworkfabric.models.RebootType - """ - - _attribute_map = { - "reboot_type": {"key": "rebootType", "type": "str"}, - } - - def __init__(self, *, reboot_type: Optional[Union[str, "_models.RebootType"]] = None, **kwargs: Any) -> None: - """ - :keyword reboot_type: Type of reboot to be performed. Example: GracefulRebootWithZTP. Known - values are: "GracefulRebootWithZTP", "GracefulRebootWithoutZTP", "UngracefulRebootWithZTP", and - "UngracefulRebootWithoutZTP". - :paramtype reboot_type: str or ~azure.mgmt.managednetworkfabric.models.RebootType - """ - super().__init__(**kwargs) - self.reboot_type = reboot_type - - -class RoutePoliciesListResult(_serialization.Model): - """List of RoutePolicies. - - :ivar value: List of RoutePolicy resources. - :vartype value: list[~azure.mgmt.managednetworkfabric.models.RoutePolicy] - :ivar next_link: Url to follow for getting next page of resources. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[RoutePolicy]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: Optional[List["_models.RoutePolicy"]] = None, next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: List of RoutePolicy resources. - :paramtype value: list[~azure.mgmt.managednetworkfabric.models.RoutePolicy] - :keyword next_link: Url to follow for getting next page of resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class RoutePolicy(TrackedResource): # pylint: disable=too-many-instance-attributes - """The RoutePolicy resource definition. - - 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 Azure. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.managednetworkfabric.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar statements: Route Policy statements. - :vartype statements: - list[~azure.mgmt.managednetworkfabric.models.RoutePolicyStatementProperties] - :ivar network_fabric_id: Arm Resource ID of Network Fabric. Required. - :vartype network_fabric_id: str - :ivar address_family_type: AddressFamilyType. This parameter decides whether the given ipv4 or - ipv6 route policy. Known values are: "IPv4" and "IPv6". - :vartype address_family_type: str or ~azure.mgmt.managednetworkfabric.models.AddressFamilyType - :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", - "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", - "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", - "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.AdministrativeState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "network_fabric_id": {"required": True}, - "configuration_state": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "administrative_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "annotation": {"key": "properties.annotation", "type": "str"}, - "statements": {"key": "properties.statements", "type": "[RoutePolicyStatementProperties]"}, - "network_fabric_id": {"key": "properties.networkFabricId", "type": "str"}, - "address_family_type": {"key": "properties.addressFamilyType", "type": "str"}, - "configuration_state": {"key": "properties.configurationState", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "administrative_state": {"key": "properties.administrativeState", "type": "str"}, - } - - def __init__( - self, - *, - location: str, - network_fabric_id: str, - tags: Optional[Dict[str, str]] = None, - annotation: Optional[str] = None, - statements: Optional[List["_models.RoutePolicyStatementProperties"]] = None, - address_family_type: Union[str, "_models.AddressFamilyType"] = "IPv4", - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword statements: Route Policy statements. - :paramtype statements: - list[~azure.mgmt.managednetworkfabric.models.RoutePolicyStatementProperties] - :keyword network_fabric_id: Arm Resource ID of Network Fabric. Required. - :paramtype network_fabric_id: str - :keyword address_family_type: AddressFamilyType. This parameter decides whether the given ipv4 - or ipv6 route policy. Known values are: "IPv4" and "IPv6". - :paramtype address_family_type: str or - ~azure.mgmt.managednetworkfabric.models.AddressFamilyType - """ - super().__init__(tags=tags, location=location, **kwargs) - self.annotation = annotation - self.statements = statements - self.network_fabric_id = network_fabric_id - self.address_family_type = address_family_type - self.configuration_state = None - self.provisioning_state = None - self.administrative_state = None - - -class RoutePolicyPatch(TagsUpdate): - """The Route Policy patch resource definition. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar statements: Route Policy statements. - :vartype statements: - list[~azure.mgmt.managednetworkfabric.models.RoutePolicyStatementProperties] - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "statements": {"key": "properties.statements", "type": "[RoutePolicyStatementProperties]"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - statements: Optional[List["_models.RoutePolicyStatementProperties"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword statements: Route Policy statements. - :paramtype statements: - list[~azure.mgmt.managednetworkfabric.models.RoutePolicyStatementProperties] - """ - super().__init__(tags=tags, **kwargs) - self.statements = statements - - -class RoutePolicyPatchableProperties(_serialization.Model): - """Route Policy patchable properties. - - :ivar statements: Route Policy statements. - :vartype statements: - list[~azure.mgmt.managednetworkfabric.models.RoutePolicyStatementProperties] - """ - - _attribute_map = { - "statements": {"key": "statements", "type": "[RoutePolicyStatementProperties]"}, - } - - def __init__( - self, *, statements: Optional[List["_models.RoutePolicyStatementProperties"]] = None, **kwargs: Any - ) -> None: - """ - :keyword statements: Route Policy statements. - :paramtype statements: - list[~azure.mgmt.managednetworkfabric.models.RoutePolicyStatementProperties] - """ - super().__init__(**kwargs) - self.statements = statements - - -class RoutePolicyProperties(AnnotationResource, RoutePolicyPatchableProperties): - """RoutePolicyProperties defines the resource properties. - - 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 Azure. - - :ivar statements: Route Policy statements. - :vartype statements: - list[~azure.mgmt.managednetworkfabric.models.RoutePolicyStatementProperties] - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar network_fabric_id: Arm Resource ID of Network Fabric. Required. - :vartype network_fabric_id: str - :ivar address_family_type: AddressFamilyType. This parameter decides whether the given ipv4 or - ipv6 route policy. Known values are: "IPv4" and "IPv6". - :vartype address_family_type: str or ~azure.mgmt.managednetworkfabric.models.AddressFamilyType - :ivar configuration_state: Configuration state of the resource. Known values are: "Succeeded", - "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", - "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - :ivar provisioning_state: Provisioning state of the resource. Known values are: "Accepted", - "Succeeded", "Updating", "Deleting", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.managednetworkfabric.models.ProvisioningState - :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", - "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.AdministrativeState - """ - - _validation = { - "network_fabric_id": {"required": True}, - "configuration_state": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "administrative_state": {"readonly": True}, - } - - _attribute_map = { - "statements": {"key": "statements", "type": "[RoutePolicyStatementProperties]"}, - "annotation": {"key": "annotation", "type": "str"}, - "network_fabric_id": {"key": "networkFabricId", "type": "str"}, - "address_family_type": {"key": "addressFamilyType", "type": "str"}, - "configuration_state": {"key": "configurationState", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "administrative_state": {"key": "administrativeState", "type": "str"}, - } - - def __init__( - self, - *, - network_fabric_id: str, - statements: Optional[List["_models.RoutePolicyStatementProperties"]] = None, - annotation: Optional[str] = None, - address_family_type: Union[str, "_models.AddressFamilyType"] = "IPv4", - **kwargs: Any - ) -> None: - """ - :keyword statements: Route Policy statements. - :paramtype statements: - list[~azure.mgmt.managednetworkfabric.models.RoutePolicyStatementProperties] - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword network_fabric_id: Arm Resource ID of Network Fabric. Required. - :paramtype network_fabric_id: str - :keyword address_family_type: AddressFamilyType. This parameter decides whether the given ipv4 - or ipv6 route policy. Known values are: "IPv4" and "IPv6". - :paramtype address_family_type: str or - ~azure.mgmt.managednetworkfabric.models.AddressFamilyType - """ - super().__init__(annotation=annotation, statements=statements, **kwargs) - self.statements = statements - self.network_fabric_id = network_fabric_id - self.address_family_type = address_family_type - self.configuration_state = None - self.provisioning_state = None - self.administrative_state = None - self.annotation = annotation - - -class RoutePolicyStatementProperties(AnnotationResource): - """Route Policy Statement properties. - - All required parameters must be populated in order to send to Azure. - - :ivar annotation: Switch configuration description. - :vartype annotation: str - :ivar sequence_number: Sequence to insert to/delete from existing route. Required. - :vartype sequence_number: int - :ivar condition: Route policy condition properties. Required. - :vartype condition: ~azure.mgmt.managednetworkfabric.models.StatementConditionProperties - :ivar action: Route policy action properties. Required. - :vartype action: ~azure.mgmt.managednetworkfabric.models.StatementActionProperties - """ - - _validation = { - "sequence_number": {"required": True, "maximum": 4294967295, "minimum": 1}, - "condition": {"required": True}, - "action": {"required": True}, - } - - _attribute_map = { - "annotation": {"key": "annotation", "type": "str"}, - "sequence_number": {"key": "sequenceNumber", "type": "int"}, - "condition": {"key": "condition", "type": "StatementConditionProperties"}, - "action": {"key": "action", "type": "StatementActionProperties"}, - } - - def __init__( - self, - *, - sequence_number: int, - condition: "_models.StatementConditionProperties", - action: "_models.StatementActionProperties", - annotation: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword annotation: Switch configuration description. - :paramtype annotation: str - :keyword sequence_number: Sequence to insert to/delete from existing route. Required. - :paramtype sequence_number: int - :keyword condition: Route policy condition properties. Required. - :paramtype condition: ~azure.mgmt.managednetworkfabric.models.StatementConditionProperties - :keyword action: Route policy action properties. Required. - :paramtype action: ~azure.mgmt.managednetworkfabric.models.StatementActionProperties - """ - super().__init__(annotation=annotation, **kwargs) - self.sequence_number = sequence_number - self.condition = condition - self.action = action - - -class RouteTargetInformation(_serialization.Model): - """Route Target Configuration. - - :ivar import_ipv4_route_targets: Route Targets to be applied for incoming routes into CE. - :vartype import_ipv4_route_targets: list[str] - :ivar import_ipv6_route_targets: Route Targets to be applied for incoming routes from CE. - :vartype import_ipv6_route_targets: list[str] - :ivar export_ipv4_route_targets: Route Targets to be applied for outgoing routes into CE. - :vartype export_ipv4_route_targets: list[str] - :ivar export_ipv6_route_targets: Route Targets to be applied for outgoing routes from CE. - :vartype export_ipv6_route_targets: list[str] - """ - - _validation = { - "import_ipv4_route_targets": {"min_items": 1}, - "import_ipv6_route_targets": {"min_items": 1}, - "export_ipv4_route_targets": {"min_items": 1}, - "export_ipv6_route_targets": {"min_items": 1}, - } - - _attribute_map = { - "import_ipv4_route_targets": {"key": "importIpv4RouteTargets", "type": "[str]"}, - "import_ipv6_route_targets": {"key": "importIpv6RouteTargets", "type": "[str]"}, - "export_ipv4_route_targets": {"key": "exportIpv4RouteTargets", "type": "[str]"}, - "export_ipv6_route_targets": {"key": "exportIpv6RouteTargets", "type": "[str]"}, - } - - def __init__( - self, - *, - import_ipv4_route_targets: Optional[List[str]] = None, - import_ipv6_route_targets: Optional[List[str]] = None, - export_ipv4_route_targets: Optional[List[str]] = None, - export_ipv6_route_targets: Optional[List[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword import_ipv4_route_targets: Route Targets to be applied for incoming routes into CE. - :paramtype import_ipv4_route_targets: list[str] - :keyword import_ipv6_route_targets: Route Targets to be applied for incoming routes from CE. - :paramtype import_ipv6_route_targets: list[str] - :keyword export_ipv4_route_targets: Route Targets to be applied for outgoing routes into CE. - :paramtype export_ipv4_route_targets: list[str] - :keyword export_ipv6_route_targets: Route Targets to be applied for outgoing routes from CE. - :paramtype export_ipv6_route_targets: list[str] - """ - super().__init__(**kwargs) - self.import_ipv4_route_targets = import_ipv4_route_targets - self.import_ipv6_route_targets = import_ipv6_route_targets - self.export_ipv4_route_targets = export_ipv4_route_targets - self.export_ipv6_route_targets = export_ipv6_route_targets - - -class RuleProperties(_serialization.Model): - """Rules for the InternetGateways. - - All required parameters must be populated in order to send to Azure. - - :ivar action: Specify action. Required. Known values are: "Allow" and "Deny". - :vartype action: str or ~azure.mgmt.managednetworkfabric.models.Action - :ivar address_list: List of Addresses to be allowed or denied. Required. - :vartype address_list: list[str] - """ - - _validation = { - "action": {"required": True}, - "address_list": {"required": True, "min_items": 1}, - } - - _attribute_map = { - "action": {"key": "action", "type": "str"}, - "address_list": {"key": "addressList", "type": "[str]"}, - } - - def __init__(self, *, action: Union[str, "_models.Action"], address_list: List[str], **kwargs: Any) -> None: - """ - :keyword action: Specify action. Required. Known values are: "Allow" and "Deny". - :paramtype action: str or ~azure.mgmt.managednetworkfabric.models.Action - :keyword address_list: List of Addresses to be allowed or denied. Required. - :paramtype address_list: list[str] - """ - super().__init__(**kwargs) - self.action = action - self.address_list = address_list - - -class StatementActionProperties(_serialization.Model): - """Route policy action properties. - - All required parameters must be populated in order to send to Azure. - - :ivar local_preference: Local Preference of the route policy. - :vartype local_preference: int - :ivar action_type: Action type. Example: Permit | Deny | Continue. Required. Known values are: - "Permit", "Deny", "Continue", and "Continue". - :vartype action_type: str or ~azure.mgmt.managednetworkfabric.models.RoutePolicyActionType - :ivar ip_community_properties: IP Community Properties. - :vartype ip_community_properties: - ~azure.mgmt.managednetworkfabric.models.ActionIpCommunityProperties - :ivar ip_extended_community_properties: IP Extended Community Properties. - :vartype ip_extended_community_properties: - ~azure.mgmt.managednetworkfabric.models.ActionIpExtendedCommunityProperties - """ - - _validation = { - "local_preference": {"maximum": 4294967295, "minimum": 0}, - "action_type": {"required": True}, - } - - _attribute_map = { - "local_preference": {"key": "localPreference", "type": "int"}, - "action_type": {"key": "actionType", "type": "str"}, - "ip_community_properties": {"key": "ipCommunityProperties", "type": "ActionIpCommunityProperties"}, - "ip_extended_community_properties": { - "key": "ipExtendedCommunityProperties", - "type": "ActionIpExtendedCommunityProperties", - }, - } - - def __init__( - self, - *, - action_type: Union[str, "_models.RoutePolicyActionType"], - local_preference: Optional[int] = None, - ip_community_properties: Optional["_models.ActionIpCommunityProperties"] = None, - ip_extended_community_properties: Optional["_models.ActionIpExtendedCommunityProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword local_preference: Local Preference of the route policy. - :paramtype local_preference: int - :keyword action_type: Action type. Example: Permit | Deny | Continue. Required. Known values - are: "Permit", "Deny", "Continue", and "Continue". - :paramtype action_type: str or ~azure.mgmt.managednetworkfabric.models.RoutePolicyActionType - :keyword ip_community_properties: IP Community Properties. - :paramtype ip_community_properties: - ~azure.mgmt.managednetworkfabric.models.ActionIpCommunityProperties - :keyword ip_extended_community_properties: IP Extended Community Properties. - :paramtype ip_extended_community_properties: - ~azure.mgmt.managednetworkfabric.models.ActionIpExtendedCommunityProperties - """ - super().__init__(**kwargs) - self.local_preference = local_preference - self.action_type = action_type - self.ip_community_properties = ip_community_properties - self.ip_extended_community_properties = ip_extended_community_properties - - -class StatementConditionProperties(IpCommunityIdList, IpExtendedCommunityIdList): - """Route policy statement condition properties. - - :ivar ip_extended_community_ids: List of IP Extended Community resource IDs. - :vartype ip_extended_community_ids: list[str] - :ivar ip_community_ids: List of IP Community resource IDs. - :vartype ip_community_ids: list[str] - :ivar type: Type of the condition used. Known values are: "Or", "And", "Or", and "And". - :vartype type: str or ~azure.mgmt.managednetworkfabric.models.RoutePolicyConditionType - :ivar ip_prefix_id: Arm Resource Id of IpPrefix. - :vartype ip_prefix_id: str - """ - - _attribute_map = { - "ip_extended_community_ids": {"key": "ipExtendedCommunityIds", "type": "[str]"}, - "ip_community_ids": {"key": "ipCommunityIds", "type": "[str]"}, - "type": {"key": "type", "type": "str"}, - "ip_prefix_id": {"key": "ipPrefixId", "type": "str"}, - } - - def __init__( - self, - *, - ip_extended_community_ids: Optional[List[str]] = None, - ip_community_ids: Optional[List[str]] = None, - type: Union[str, "_models.RoutePolicyConditionType"] = "Or", - ip_prefix_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword ip_extended_community_ids: List of IP Extended Community resource IDs. - :paramtype ip_extended_community_ids: list[str] - :keyword ip_community_ids: List of IP Community resource IDs. - :paramtype ip_community_ids: list[str] - :keyword type: Type of the condition used. Known values are: "Or", "And", "Or", and "And". - :paramtype type: str or ~azure.mgmt.managednetworkfabric.models.RoutePolicyConditionType - :keyword ip_prefix_id: Arm Resource Id of IpPrefix. - :paramtype ip_prefix_id: str - """ - super().__init__( - ip_community_ids=ip_community_ids, ip_extended_community_ids=ip_extended_community_ids, **kwargs - ) - self.ip_extended_community_ids = ip_extended_community_ids - self.type = type - self.ip_prefix_id = ip_prefix_id - self.ip_community_ids = ip_community_ids - - -class StaticRouteProperties(_serialization.Model): - """Route Properties. - - All required parameters must be populated in order to send to Azure. - - :ivar prefix: Prefix of the route. Required. - :vartype prefix: str - :ivar next_hop: List of next hop addresses. Required. - :vartype next_hop: list[str] - """ - - _validation = { - "prefix": {"required": True, "min_length": 1}, - "next_hop": {"required": True, "min_items": 1}, - } - - _attribute_map = { - "prefix": {"key": "prefix", "type": "str"}, - "next_hop": {"key": "nextHop", "type": "[str]"}, - } - - def __init__(self, *, prefix: str, next_hop: List[str], **kwargs: Any) -> None: - """ - :keyword prefix: Prefix of the route. Required. - :paramtype prefix: str - :keyword next_hop: List of next hop addresses. Required. - :paramtype next_hop: list[str] - """ - super().__init__(**kwargs) - self.prefix = prefix - self.next_hop = next_hop - - -class SupportedConnectorProperties(_serialization.Model): - """Supported connector properties. - - :ivar connector_type: Type of connector used. Example: Optical. - :vartype connector_type: str - :ivar max_speed_in_mbps: Maximum speed of the connector in Mbps. - :vartype max_speed_in_mbps: int - """ - - _attribute_map = { - "connector_type": {"key": "connectorType", "type": "str"}, - "max_speed_in_mbps": {"key": "maxSpeedInMbps", "type": "int"}, - } - - def __init__( - self, *, connector_type: Optional[str] = None, max_speed_in_mbps: Optional[int] = None, **kwargs: Any - ) -> None: - """ - :keyword connector_type: Type of connector used. Example: Optical. - :paramtype connector_type: str - :keyword max_speed_in_mbps: Maximum speed of the connector in Mbps. - :paramtype max_speed_in_mbps: int - """ - super().__init__(**kwargs) - self.connector_type = connector_type - self.max_speed_in_mbps = max_speed_in_mbps - - -class SupportedVersionProperties(_serialization.Model): - """Supported version details of the network device. - - :ivar version: Operating system and firmware combined versions. - :vartype version: str - :ivar vendor_os_version: Operating system version. - :vartype vendor_os_version: str - :ivar vendor_firmware_version: Firmware version. - :vartype vendor_firmware_version: str - :ivar is_default: If true newly provisioned Fabric will use this device version by default to - bootstrap the network devices for the first time. Known values are: "True" and "False". - :vartype is_default: str or ~azure.mgmt.managednetworkfabric.models.BooleanEnumProperty - """ - - _attribute_map = { - "version": {"key": "version", "type": "str"}, - "vendor_os_version": {"key": "vendorOsVersion", "type": "str"}, - "vendor_firmware_version": {"key": "vendorFirmwareVersion", "type": "str"}, - "is_default": {"key": "isDefault", "type": "str"}, - } - - def __init__( - self, - *, - version: Optional[str] = None, - vendor_os_version: Optional[str] = None, - vendor_firmware_version: Optional[str] = None, - is_default: Optional[Union[str, "_models.BooleanEnumProperty"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword version: Operating system and firmware combined versions. - :paramtype version: str - :keyword vendor_os_version: Operating system version. - :paramtype vendor_os_version: str - :keyword vendor_firmware_version: Firmware version. - :paramtype vendor_firmware_version: str - :keyword is_default: If true newly provisioned Fabric will use this device version by default - to bootstrap the network devices for the first time. Known values are: "True" and "False". - :paramtype is_default: str or ~azure.mgmt.managednetworkfabric.models.BooleanEnumProperty - """ - super().__init__(**kwargs) - self.version = version - self.vendor_os_version = vendor_os_version - self.vendor_firmware_version = vendor_firmware_version - self.is_default = is_default - - -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.managednetworkfabric.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.managednetworkfabric.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :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.managednetworkfabric.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.managednetworkfabric.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :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 TerminalServerConfiguration(TerminalServerPatchableProperties, Layer3IpPrefixProperties): - """Network and credentials configuration currently applied to terminal server. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar primary_ipv4_prefix: IPv4 Address Prefix. - :vartype primary_ipv4_prefix: str - :ivar primary_ipv6_prefix: IPv6 Address Prefix. - :vartype primary_ipv6_prefix: str - :ivar secondary_ipv4_prefix: Secondary IPv4 Address Prefix. - :vartype secondary_ipv4_prefix: str - :ivar secondary_ipv6_prefix: Secondary IPv6 Address Prefix. - :vartype secondary_ipv6_prefix: str - :ivar username: Username for the terminal server connection. - :vartype username: str - :ivar password: Password for the terminal server connection. - :vartype password: str - :ivar serial_number: Serial Number of Terminal server. - :vartype serial_number: str - :ivar network_device_id: ARM Resource ID used for the NetworkDevice. - :vartype network_device_id: str - """ - - _validation = { - "username": {"min_length": 1}, - "password": {"min_length": 1}, - "serial_number": {"min_length": 1}, - "network_device_id": {"readonly": True}, - } - - _attribute_map = { - "primary_ipv4_prefix": {"key": "primaryIpv4Prefix", "type": "str"}, - "primary_ipv6_prefix": {"key": "primaryIpv6Prefix", "type": "str"}, - "secondary_ipv4_prefix": {"key": "secondaryIpv4Prefix", "type": "str"}, - "secondary_ipv6_prefix": {"key": "secondaryIpv6Prefix", "type": "str"}, - "username": {"key": "username", "type": "str"}, - "password": {"key": "password", "type": "str"}, - "serial_number": {"key": "serialNumber", "type": "str"}, - "network_device_id": {"key": "networkDeviceId", "type": "str"}, - } - - def __init__( - self, - *, - primary_ipv4_prefix: Optional[str] = None, - primary_ipv6_prefix: Optional[str] = None, - secondary_ipv4_prefix: Optional[str] = None, - secondary_ipv6_prefix: Optional[str] = None, - username: Optional[str] = None, - password: Optional[str] = None, - serial_number: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword primary_ipv4_prefix: IPv4 Address Prefix. - :paramtype primary_ipv4_prefix: str - :keyword primary_ipv6_prefix: IPv6 Address Prefix. - :paramtype primary_ipv6_prefix: str - :keyword secondary_ipv4_prefix: Secondary IPv4 Address Prefix. - :paramtype secondary_ipv4_prefix: str - :keyword secondary_ipv6_prefix: Secondary IPv6 Address Prefix. - :paramtype secondary_ipv6_prefix: str - :keyword username: Username for the terminal server connection. - :paramtype username: str - :keyword password: Password for the terminal server connection. - :paramtype password: str - :keyword serial_number: Serial Number of Terminal server. - :paramtype serial_number: str - """ - super().__init__( - username=username, - password=password, - serial_number=serial_number, - primary_ipv4_prefix=primary_ipv4_prefix, - primary_ipv6_prefix=primary_ipv6_prefix, - secondary_ipv4_prefix=secondary_ipv4_prefix, - secondary_ipv6_prefix=secondary_ipv6_prefix, - **kwargs - ) - self.primary_ipv4_prefix = primary_ipv4_prefix - self.primary_ipv6_prefix = primary_ipv6_prefix - self.secondary_ipv4_prefix = secondary_ipv4_prefix - self.secondary_ipv6_prefix = secondary_ipv6_prefix - self.network_device_id = None - self.username = username - self.password = password - self.serial_number = serial_number - - -class UpdateAdministrativeState(EnableDisableOnResources): - """Update administrative state on list of resources. - - :ivar resource_ids: Network Fabrics or Network Rack resource Id. - :vartype resource_ids: list[str] - :ivar state: Administrative state. Known values are: "Enable" and "Disable". - :vartype state: str or ~azure.mgmt.managednetworkfabric.models.EnableDisableState - """ - - _attribute_map = { - "resource_ids": {"key": "resourceIds", "type": "[str]"}, - "state": {"key": "state", "type": "str"}, - } - - def __init__( - self, - *, - resource_ids: Optional[List[str]] = None, - state: Optional[Union[str, "_models.EnableDisableState"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword resource_ids: Network Fabrics or Network Rack resource Id. - :paramtype resource_ids: list[str] - :keyword state: Administrative state. Known values are: "Enable" and "Disable". - :paramtype state: str or ~azure.mgmt.managednetworkfabric.models.EnableDisableState - """ - super().__init__(resource_ids=resource_ids, **kwargs) - self.state = state - - -class UpdateDeviceAdministrativeState(EnableDisableOnResources): - """Update the administrative state on list of resources. - - :ivar resource_ids: Network Fabrics or Network Rack resource Id. - :vartype resource_ids: list[str] - :ivar state: Administrative state. Known values are: "RMA", "Resync", "GracefulQuarantine", and - "Quarantine". - :vartype state: str or ~azure.mgmt.managednetworkfabric.models.DeviceAdministrativeState - """ - - _attribute_map = { - "resource_ids": {"key": "resourceIds", "type": "[str]"}, - "state": {"key": "state", "type": "str"}, - } - - def __init__( - self, - *, - resource_ids: Optional[List[str]] = None, - state: Optional[Union[str, "_models.DeviceAdministrativeState"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword resource_ids: Network Fabrics or Network Rack resource Id. - :paramtype resource_ids: list[str] - :keyword state: Administrative state. Known values are: "RMA", "Resync", "GracefulQuarantine", - and "Quarantine". - :paramtype state: str or ~azure.mgmt.managednetworkfabric.models.DeviceAdministrativeState - """ - super().__init__(resource_ids=resource_ids, **kwargs) - self.state = state - - -class UpdateVersion(_serialization.Model): - """Update version properties. - - :ivar version: Specify the version. - :vartype version: str - """ - - _attribute_map = { - "version": {"key": "version", "type": "str"}, - } - - def __init__(self, *, version: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword version: Specify the version. - :paramtype version: str - """ - super().__init__(**kwargs) - self.version = version - - -class ValidateConfigurationProperties(_serialization.Model): - """Validation configuration properties. - - :ivar validate_action: Validate action that to be performed. Known values are: "Cabling", - "Configuration", and "Connectivity". - :vartype validate_action: str or ~azure.mgmt.managednetworkfabric.models.ValidateAction - """ - - _attribute_map = { - "validate_action": {"key": "validateAction", "type": "str"}, - } - - def __init__( - self, *, validate_action: Optional[Union[str, "_models.ValidateAction"]] = None, **kwargs: Any - ) -> None: - """ - :keyword validate_action: Validate action that to be performed. Known values are: "Cabling", - "Configuration", and "Connectivity". - :paramtype validate_action: str or ~azure.mgmt.managednetworkfabric.models.ValidateAction - """ - super().__init__(**kwargs) - self.validate_action = validate_action - - -class ValidateConfigurationResponse(ErrorResponse): - """The response of the action validate configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar error: The error object. - :vartype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail - :ivar configuration_state: Gets the configuration state. Known values are: "Succeeded", - "Failed", "Rejected", "Accepted", "Provisioned", "ErrorProvisioning", "Deprovisioning", - "Deprovisioned", "ErrorDeprovisioning", and "DeferredControl". - :vartype configuration_state: str or ~azure.mgmt.managednetworkfabric.models.ConfigurationState - :ivar url: URL for the details of the response. - :vartype url: str - """ - - _validation = { - "configuration_state": {"readonly": True}, - } - - _attribute_map = { - "error": {"key": "error", "type": "ErrorDetail"}, - "configuration_state": {"key": "configurationState", "type": "str"}, - "url": {"key": "url", "type": "str"}, - } - - def __init__( - self, *, error: Optional["_models.ErrorDetail"] = None, url: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.managednetworkfabric.models.ErrorDetail - :keyword url: URL for the details of the response. - :paramtype url: str - """ - super().__init__(error=error, **kwargs) - self.configuration_state = None - self.url = url - - -class VlanGroupProperties(_serialization.Model): - """Vlan group properties. - - :ivar name: Vlan group name. - :vartype name: str - :ivar vlans: List of vlans. - :vartype vlans: list[str] - """ - - _validation = { - "name": {"min_length": 1}, - "vlans": {"min_items": 1}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "vlans": {"key": "vlans", "type": "[str]"}, - } - - def __init__(self, *, name: Optional[str] = None, vlans: Optional[List[str]] = None, **kwargs: Any) -> None: - """ - :keyword name: Vlan group name. - :paramtype name: str - :keyword vlans: List of vlans. - :paramtype vlans: list[str] - """ - super().__init__(**kwargs) - self.name = name - self.vlans = vlans - - -class VlanMatchCondition(_serialization.Model): - """The vlan match conditions that needs to be matched. - - :ivar vlans: List of vlans that needs to be matched. - :vartype vlans: list[str] - :ivar inner_vlans: List of inner vlans that needs to be matched. - :vartype inner_vlans: list[str] - :ivar vlan_group_names: List of vlan group names that to be matched. - :vartype vlan_group_names: list[str] - """ - - _validation = { - "vlans": {"min_items": 1}, - "inner_vlans": {"min_items": 1}, - "vlan_group_names": {"min_items": 1}, - } - - _attribute_map = { - "vlans": {"key": "vlans", "type": "[str]"}, - "inner_vlans": {"key": "innerVlans", "type": "[str]"}, - "vlan_group_names": {"key": "vlanGroupNames", "type": "[str]"}, - } - - def __init__( - self, - *, - vlans: Optional[List[str]] = None, - inner_vlans: Optional[List[str]] = None, - vlan_group_names: Optional[List[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword vlans: List of vlans that needs to be matched. - :paramtype vlans: list[str] - :keyword inner_vlans: List of inner vlans that needs to be matched. - :paramtype inner_vlans: list[str] - :keyword vlan_group_names: List of vlan group names that to be matched. - :paramtype vlan_group_names: list[str] - """ - super().__init__(**kwargs) - self.vlans = vlans - self.inner_vlans = inner_vlans - self.vlan_group_names = vlan_group_names - - -class VpnConfigurationPatchableProperties(_serialization.Model): - """Network and credential configuration currently applied on terminal server. - - :ivar network_to_network_interconnect_id: ARM Resource ID of the Network To Network - Interconnect. - :vartype network_to_network_interconnect_id: str - :ivar peering_option: Peering option list. Known values are: "OptionA" and "OptionB". - :vartype peering_option: str or ~azure.mgmt.managednetworkfabric.models.PeeringOption - :ivar option_b_properties: option B properties. - :vartype option_b_properties: ~azure.mgmt.managednetworkfabric.models.OptionBProperties - :ivar option_a_properties: option A properties. - :vartype option_a_properties: - ~azure.mgmt.managednetworkfabric.models.VpnConfigurationPatchablePropertiesOptionAProperties - """ - - _attribute_map = { - "network_to_network_interconnect_id": {"key": "networkToNetworkInterconnectId", "type": "str"}, - "peering_option": {"key": "peeringOption", "type": "str"}, - "option_b_properties": {"key": "optionBProperties", "type": "OptionBProperties"}, - "option_a_properties": { - "key": "optionAProperties", - "type": "VpnConfigurationPatchablePropertiesOptionAProperties", - }, - } - - def __init__( - self, - *, - network_to_network_interconnect_id: Optional[str] = None, - peering_option: Optional[Union[str, "_models.PeeringOption"]] = None, - option_b_properties: Optional["_models.OptionBProperties"] = None, - option_a_properties: Optional["_models.VpnConfigurationPatchablePropertiesOptionAProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword network_to_network_interconnect_id: ARM Resource ID of the Network To Network - Interconnect. - :paramtype network_to_network_interconnect_id: str - :keyword peering_option: Peering option list. Known values are: "OptionA" and "OptionB". - :paramtype peering_option: str or ~azure.mgmt.managednetworkfabric.models.PeeringOption - :keyword option_b_properties: option B properties. - :paramtype option_b_properties: ~azure.mgmt.managednetworkfabric.models.OptionBProperties - :keyword option_a_properties: option A properties. - :paramtype option_a_properties: - ~azure.mgmt.managednetworkfabric.models.VpnConfigurationPatchablePropertiesOptionAProperties - """ - super().__init__(**kwargs) - self.network_to_network_interconnect_id = network_to_network_interconnect_id - self.peering_option = peering_option - self.option_b_properties = option_b_properties - self.option_a_properties = option_a_properties - - -class VpnConfigurationPatchablePropertiesOptionAProperties(OptionAProperties, Layer3IpPrefixProperties): - """option A properties. - - :ivar primary_ipv4_prefix: IPv4 Address Prefix. - :vartype primary_ipv4_prefix: str - :ivar primary_ipv6_prefix: IPv6 Address Prefix. - :vartype primary_ipv6_prefix: str - :ivar secondary_ipv4_prefix: Secondary IPv4 Address Prefix. - :vartype secondary_ipv4_prefix: str - :ivar secondary_ipv6_prefix: Secondary IPv6 Address Prefix. - :vartype secondary_ipv6_prefix: str - :ivar mtu: MTU to use for option A peering. - :vartype mtu: int - :ivar vlan_id: Vlan Id.Example : 501. - :vartype vlan_id: int - :ivar peer_asn: Peer ASN number.Example : 28. - :vartype peer_asn: int - :ivar bfd_configuration: BFD Configuration properties. - :vartype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdConfiguration - """ - - _validation = { - "mtu": {"maximum": 9200, "minimum": 64}, - "vlan_id": {"maximum": 4094, "minimum": 501}, - "peer_asn": {"maximum": 4294967295, "minimum": 1}, - } - - _attribute_map = { - "primary_ipv4_prefix": {"key": "primaryIpv4Prefix", "type": "str"}, - "primary_ipv6_prefix": {"key": "primaryIpv6Prefix", "type": "str"}, - "secondary_ipv4_prefix": {"key": "secondaryIpv4Prefix", "type": "str"}, - "secondary_ipv6_prefix": {"key": "secondaryIpv6Prefix", "type": "str"}, - "mtu": {"key": "mtu", "type": "int"}, - "vlan_id": {"key": "vlanId", "type": "int"}, - "peer_asn": {"key": "peerASN", "type": "int"}, - "bfd_configuration": {"key": "bfdConfiguration", "type": "BfdConfiguration"}, - } - - def __init__( - self, - *, - primary_ipv4_prefix: Optional[str] = None, - primary_ipv6_prefix: Optional[str] = None, - secondary_ipv4_prefix: Optional[str] = None, - secondary_ipv6_prefix: Optional[str] = None, - mtu: int = 1500, - vlan_id: Optional[int] = None, - peer_asn: Optional[int] = None, - bfd_configuration: Optional["_models.BfdConfiguration"] = None, - **kwargs: Any - ) -> None: - """ - :keyword primary_ipv4_prefix: IPv4 Address Prefix. - :paramtype primary_ipv4_prefix: str - :keyword primary_ipv6_prefix: IPv6 Address Prefix. - :paramtype primary_ipv6_prefix: str - :keyword secondary_ipv4_prefix: Secondary IPv4 Address Prefix. - :paramtype secondary_ipv4_prefix: str - :keyword secondary_ipv6_prefix: Secondary IPv6 Address Prefix. - :paramtype secondary_ipv6_prefix: str - :keyword mtu: MTU to use for option A peering. - :paramtype mtu: int - :keyword vlan_id: Vlan Id.Example : 501. - :paramtype vlan_id: int - :keyword peer_asn: Peer ASN number.Example : 28. - :paramtype peer_asn: int - :keyword bfd_configuration: BFD Configuration properties. - :paramtype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdConfiguration - """ - super().__init__( - mtu=mtu, - vlan_id=vlan_id, - peer_asn=peer_asn, - bfd_configuration=bfd_configuration, - primary_ipv4_prefix=primary_ipv4_prefix, - primary_ipv6_prefix=primary_ipv6_prefix, - secondary_ipv4_prefix=secondary_ipv4_prefix, - secondary_ipv6_prefix=secondary_ipv6_prefix, - **kwargs - ) - self.primary_ipv4_prefix = primary_ipv4_prefix - self.primary_ipv6_prefix = primary_ipv6_prefix - self.secondary_ipv4_prefix = secondary_ipv4_prefix - self.secondary_ipv6_prefix = secondary_ipv6_prefix - self.mtu = mtu - self.vlan_id = vlan_id - self.peer_asn = peer_asn - self.bfd_configuration = bfd_configuration - - -class VpnConfigurationProperties(_serialization.Model): - """Network and credential configuration currently applied on terminal server. - - 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 Azure. - - :ivar network_to_network_interconnect_id: ARM Resource ID of the Network To Network - Interconnect. - :vartype network_to_network_interconnect_id: str - :ivar administrative_state: Administrative state of the resource. Known values are: "Enabled", - "Disabled", "MAT", and "RMA". - :vartype administrative_state: str or - ~azure.mgmt.managednetworkfabric.models.AdministrativeState - :ivar peering_option: Peering option list. Required. Known values are: "OptionA" and "OptionB". - :vartype peering_option: str or ~azure.mgmt.managednetworkfabric.models.PeeringOption - :ivar option_b_properties: option B properties. - :vartype option_b_properties: ~azure.mgmt.managednetworkfabric.models.OptionBProperties - :ivar option_a_properties: option A properties. - :vartype option_a_properties: - ~azure.mgmt.managednetworkfabric.models.VpnConfigurationPropertiesOptionAProperties - """ - - _validation = { - "administrative_state": {"readonly": True}, - "peering_option": {"required": True}, - } - - _attribute_map = { - "network_to_network_interconnect_id": {"key": "networkToNetworkInterconnectId", "type": "str"}, - "administrative_state": {"key": "administrativeState", "type": "str"}, - "peering_option": {"key": "peeringOption", "type": "str"}, - "option_b_properties": {"key": "optionBProperties", "type": "OptionBProperties"}, - "option_a_properties": {"key": "optionAProperties", "type": "VpnConfigurationPropertiesOptionAProperties"}, - } - - def __init__( - self, - *, - peering_option: Union[str, "_models.PeeringOption"], - network_to_network_interconnect_id: Optional[str] = None, - option_b_properties: Optional["_models.OptionBProperties"] = None, - option_a_properties: Optional["_models.VpnConfigurationPropertiesOptionAProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword network_to_network_interconnect_id: ARM Resource ID of the Network To Network - Interconnect. - :paramtype network_to_network_interconnect_id: str - :keyword peering_option: Peering option list. Required. Known values are: "OptionA" and - "OptionB". - :paramtype peering_option: str or ~azure.mgmt.managednetworkfabric.models.PeeringOption - :keyword option_b_properties: option B properties. - :paramtype option_b_properties: ~azure.mgmt.managednetworkfabric.models.OptionBProperties - :keyword option_a_properties: option A properties. - :paramtype option_a_properties: - ~azure.mgmt.managednetworkfabric.models.VpnConfigurationPropertiesOptionAProperties - """ - super().__init__(**kwargs) - self.network_to_network_interconnect_id = network_to_network_interconnect_id - self.administrative_state = None - self.peering_option = peering_option - self.option_b_properties = option_b_properties - self.option_a_properties = option_a_properties - - -class VpnConfigurationPropertiesOptionAProperties(OptionAProperties, Layer3IpPrefixProperties): - """option A properties. - - :ivar primary_ipv4_prefix: IPv4 Address Prefix. - :vartype primary_ipv4_prefix: str - :ivar primary_ipv6_prefix: IPv6 Address Prefix. - :vartype primary_ipv6_prefix: str - :ivar secondary_ipv4_prefix: Secondary IPv4 Address Prefix. - :vartype secondary_ipv4_prefix: str - :ivar secondary_ipv6_prefix: Secondary IPv6 Address Prefix. - :vartype secondary_ipv6_prefix: str - :ivar mtu: MTU to use for option A peering. - :vartype mtu: int - :ivar vlan_id: Vlan Id.Example : 501. - :vartype vlan_id: int - :ivar peer_asn: Peer ASN number.Example : 28. - :vartype peer_asn: int - :ivar bfd_configuration: BFD Configuration properties. - :vartype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdConfiguration - """ - - _validation = { - "mtu": {"maximum": 9200, "minimum": 64}, - "vlan_id": {"maximum": 4094, "minimum": 501}, - "peer_asn": {"maximum": 4294967295, "minimum": 1}, - } - - _attribute_map = { - "primary_ipv4_prefix": {"key": "primaryIpv4Prefix", "type": "str"}, - "primary_ipv6_prefix": {"key": "primaryIpv6Prefix", "type": "str"}, - "secondary_ipv4_prefix": {"key": "secondaryIpv4Prefix", "type": "str"}, - "secondary_ipv6_prefix": {"key": "secondaryIpv6Prefix", "type": "str"}, - "mtu": {"key": "mtu", "type": "int"}, - "vlan_id": {"key": "vlanId", "type": "int"}, - "peer_asn": {"key": "peerASN", "type": "int"}, - "bfd_configuration": {"key": "bfdConfiguration", "type": "BfdConfiguration"}, - } - - def __init__( - self, - *, - primary_ipv4_prefix: Optional[str] = None, - primary_ipv6_prefix: Optional[str] = None, - secondary_ipv4_prefix: Optional[str] = None, - secondary_ipv6_prefix: Optional[str] = None, - mtu: int = 1500, - vlan_id: Optional[int] = None, - peer_asn: Optional[int] = None, - bfd_configuration: Optional["_models.BfdConfiguration"] = None, - **kwargs: Any - ) -> None: - """ - :keyword primary_ipv4_prefix: IPv4 Address Prefix. - :paramtype primary_ipv4_prefix: str - :keyword primary_ipv6_prefix: IPv6 Address Prefix. - :paramtype primary_ipv6_prefix: str - :keyword secondary_ipv4_prefix: Secondary IPv4 Address Prefix. - :paramtype secondary_ipv4_prefix: str - :keyword secondary_ipv6_prefix: Secondary IPv6 Address Prefix. - :paramtype secondary_ipv6_prefix: str - :keyword mtu: MTU to use for option A peering. - :paramtype mtu: int - :keyword vlan_id: Vlan Id.Example : 501. - :paramtype vlan_id: int - :keyword peer_asn: Peer ASN number.Example : 28. - :paramtype peer_asn: int - :keyword bfd_configuration: BFD Configuration properties. - :paramtype bfd_configuration: ~azure.mgmt.managednetworkfabric.models.BfdConfiguration - """ - super().__init__( - mtu=mtu, - vlan_id=vlan_id, - peer_asn=peer_asn, - bfd_configuration=bfd_configuration, - primary_ipv4_prefix=primary_ipv4_prefix, - primary_ipv6_prefix=primary_ipv6_prefix, - secondary_ipv4_prefix=secondary_ipv4_prefix, - secondary_ipv6_prefix=secondary_ipv6_prefix, - **kwargs - ) - self.primary_ipv4_prefix = primary_ipv4_prefix - self.primary_ipv6_prefix = primary_ipv6_prefix - self.secondary_ipv4_prefix = secondary_ipv4_prefix - self.secondary_ipv6_prefix = secondary_ipv6_prefix - self.mtu = mtu - self.vlan_id = vlan_id - self.peer_asn = peer_asn - self.bfd_configuration = bfd_configuration diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/models/_patch.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/models/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/models/_patch.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/models/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """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 + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/__init__.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/__init__.py index 95b33173ed4b..6f98a0dd5ad0 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/__init__.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/__init__.py @@ -2,43 +2,53 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._access_control_lists_operations import AccessControlListsOperations -from ._internet_gateways_operations import InternetGatewaysOperations -from ._internet_gateway_rules_operations import InternetGatewayRulesOperations -from ._ip_communities_operations import IpCommunitiesOperations -from ._ip_extended_communities_operations import IpExtendedCommunitiesOperations -from ._ip_prefixes_operations import IpPrefixesOperations -from ._l2_isolation_domains_operations import L2IsolationDomainsOperations -from ._l3_isolation_domains_operations import L3IsolationDomainsOperations -from ._internal_networks_operations import InternalNetworksOperations -from ._external_networks_operations import ExternalNetworksOperations -from ._neighbor_groups_operations import NeighborGroupsOperations -from ._network_device_skus_operations import NetworkDeviceSkusOperations -from ._network_devices_operations import NetworkDevicesOperations -from ._network_interfaces_operations import NetworkInterfacesOperations -from ._network_fabric_controllers_operations import NetworkFabricControllersOperations -from ._network_fabric_skus_operations import NetworkFabricSkusOperations -from ._network_fabrics_operations import NetworkFabricsOperations -from ._network_to_network_interconnects_operations import NetworkToNetworkInterconnectsOperations -from ._network_packet_brokers_operations import NetworkPacketBrokersOperations -from ._network_racks_operations import NetworkRacksOperations -from ._network_tap_rules_operations import NetworkTapRulesOperations -from ._network_taps_operations import NetworkTapsOperations -from ._operations import Operations -from ._route_policies_operations import RoutePoliciesOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import Operations # type: ignore +from ._operations import AccessControlListsOperations # type: ignore +from ._operations import InternetGatewayRulesOperations # type: ignore +from ._operations import InternetGatewaysOperations # type: ignore +from ._operations import IpCommunitiesOperations # type: ignore +from ._operations import IpExtendedCommunitiesOperations # type: ignore +from ._operations import IpPrefixesOperations # type: ignore +from ._operations import L2IsolationDomainsOperations # type: ignore +from ._operations import L3IsolationDomainsOperations # type: ignore +from ._operations import InternalNetworksOperations # type: ignore +from ._operations import ExternalNetworksOperations # type: ignore +from ._operations import NeighborGroupsOperations # type: ignore +from ._operations import NetworkDeviceSkusOperations # type: ignore +from ._operations import NetworkDevicesOperations # type: ignore +from ._operations import NetworkInterfacesOperations # type: ignore +from ._operations import NetworkFabricControllersOperations # type: ignore +from ._operations import NetworkFabricSkusOperations # type: ignore +from ._operations import NetworkFabricsOperations # type: ignore +from ._operations import NetworkToNetworkInterconnectsOperations # type: ignore +from ._operations import NetworkPacketBrokersOperations # type: ignore +from ._operations import NetworkRacksOperations # type: ignore +from ._operations import NetworkTapRulesOperations # type: ignore +from ._operations import NetworkTapsOperations # type: ignore +from ._operations import RoutePoliciesOperations # type: ignore +from ._operations import NetworkMonitorsOperations # type: ignore +from ._operations import NetworkBootstrapDevicesOperations # type: ignore +from ._operations import NetworkBootstrapInterfacesOperations # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ + "Operations", "AccessControlListsOperations", - "InternetGatewaysOperations", "InternetGatewayRulesOperations", + "InternetGatewaysOperations", "IpCommunitiesOperations", "IpExtendedCommunitiesOperations", "IpPrefixesOperations", @@ -58,8 +68,10 @@ "NetworkRacksOperations", "NetworkTapRulesOperations", "NetworkTapsOperations", - "Operations", "RoutePoliciesOperations", + "NetworkMonitorsOperations", + "NetworkBootstrapDevicesOperations", + "NetworkBootstrapInterfacesOperations", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_access_control_lists_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_access_control_lists_operations.py deleted file mode 100644 index 484a1c843ed5..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_access_control_lists_operations.py +++ /dev/null @@ -1,1700 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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 _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_request( - resource_group_name: str, access_control_list_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/accessControlLists/{accessControlListName}", - ) # 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", max_length=90, min_length=1 - ), - "accessControlListName": _SERIALIZER.url("access_control_list_name", access_control_list_name, "str"), - } - - _url: str = _format_url_section(_url, **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_get_request( - resource_group_name: str, access_control_list_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}", - ) # 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", max_length=90, min_length=1 - ), - "accessControlListName": _SERIALIZER.url("access_control_list_name", access_control_list_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, access_control_list_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/accessControlLists/{accessControlListName}", - ) # 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", max_length=90, min_length=1 - ), - "accessControlListName": _SERIALIZER.url("access_control_list_name", access_control_list_name, "str"), - } - - _url: str = _format_url_section(_url, **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_delete_request( - resource_group_name: str, access_control_list_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}", - ) # 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", max_length=90, min_length=1 - ), - "accessControlListName": _SERIALIZER.url("access_control_list_name", access_control_list_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_list_by_resource_group_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists", - ) # 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", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_subscription_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/accessControlLists" - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_administrative_state_request( - resource_group_name: str, access_control_list_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/accessControlLists/{accessControlListName}/updateAdministrativeState", - ) # 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", max_length=90, min_length=1 - ), - "accessControlListName": _SERIALIZER.url("access_control_list_name", access_control_list_name, "str"), - } - - _url: str = _format_url_section(_url, **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_resync_request( - resource_group_name: str, access_control_list_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}/resync", - ) # 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", max_length=90, min_length=1 - ), - "accessControlListName": _SERIALIZER.url("access_control_list_name", access_control_list_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_validate_configuration_request( - resource_group_name: str, access_control_list_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}/validateConfiguration", - ) # 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", max_length=90, min_length=1 - ), - "accessControlListName": _SERIALIZER.url("access_control_list_name", access_control_list_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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) - - -class AccessControlListsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricMgmtClient`'s - :attr:`access_control_lists` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - def _create_initial( - self, - resource_group_name: str, - access_control_list_name: str, - body: Union[_models.AccessControlList, IO], - **kwargs: Any - ) -> _models.AccessControlList: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AccessControlList] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "AccessControlList") - - request = build_create_request( - resource_group_name=resource_group_name, - access_control_list_name=access_control_list_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AccessControlList", pipeline_response) - - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = self._deserialize("AccessControlList", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}" - } - - @overload - def begin_create( - self, - resource_group_name: str, - access_control_list_name: str, - body: _models.AccessControlList, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AccessControlList]: - """Creates Access Control List. - - Implements Access Control List PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param access_control_list_name: Name of the Access Control List. Required. - :type access_control_list_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.AccessControlList - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either AccessControlList or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.AccessControlList] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - access_control_list_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AccessControlList]: - """Creates Access Control List. - - Implements Access Control List PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param access_control_list_name: Name of the Access Control List. Required. - :type access_control_list_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either AccessControlList or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.AccessControlList] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - access_control_list_name: str, - body: Union[_models.AccessControlList, IO], - **kwargs: Any - ) -> LROPoller[_models.AccessControlList]: - """Creates Access Control List. - - Implements Access Control List PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param access_control_list_name: Name of the Access Control List. Required. - :type access_control_list_name: str - :param body: Request payload. Is either a AccessControlList type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.AccessControlList or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either AccessControlList or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.AccessControlList] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AccessControlList] = 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, - access_control_list_name=access_control_list_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AccessControlList", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}" - } - - @distributed_trace - def get(self, resource_group_name: str, access_control_list_name: str, **kwargs: Any) -> _models.AccessControlList: - """Gets a Access Control List. - - Implements Access Control List GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param access_control_list_name: Name of the Access Control List. Required. - :type access_control_list_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AccessControlList or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.AccessControlList - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AccessControlList] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - access_control_list_name=access_control_list_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("AccessControlList", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}" - } - - def _update_initial( - self, - resource_group_name: str, - access_control_list_name: str, - body: Union[_models.AccessControlListPatch, IO], - **kwargs: Any - ) -> Optional[_models.AccessControlList]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.AccessControlList]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "AccessControlListPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - access_control_list_name=access_control_list_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AccessControlList", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}" - } - - @overload - def begin_update( - self, - resource_group_name: str, - access_control_list_name: str, - body: _models.AccessControlListPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AccessControlList]: - """Updates the Access Control List. - - API to update certain properties of the Access Control List resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param access_control_list_name: Name of the Access Control List. Required. - :type access_control_list_name: str - :param body: Access Control List properties to update. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.AccessControlListPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either AccessControlList or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.AccessControlList] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - access_control_list_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AccessControlList]: - """Updates the Access Control List. - - API to update certain properties of the Access Control List resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param access_control_list_name: Name of the Access Control List. Required. - :type access_control_list_name: str - :param body: Access Control List properties to update. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either AccessControlList or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.AccessControlList] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - access_control_list_name: str, - body: Union[_models.AccessControlListPatch, IO], - **kwargs: Any - ) -> LROPoller[_models.AccessControlList]: - """Updates the Access Control List. - - API to update certain properties of the Access Control List resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param access_control_list_name: Name of the Access Control List. Required. - :type access_control_list_name: str - :param body: Access Control List properties to update. Is either a AccessControlListPatch type - or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.AccessControlListPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either AccessControlList or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.AccessControlList] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AccessControlList] = 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, - access_control_list_name=access_control_list_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AccessControlList", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, access_control_list_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - access_control_list_name=access_control_list_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: 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) - - 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) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}" - } - - @distributed_trace - def begin_delete(self, resource_group_name: str, access_control_list_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a Access Control List. - - Implements Access Control List DELETE method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param access_control_list_name: Name of the Access Control List. Required. - :type access_control_list_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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, - access_control_list_name=access_control_list_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}" - } - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.AccessControlList"]: - """List AccessControlLists by resource group. - - Implements AccessControlLists list by resource group GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AccessControlList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.AccessControlList] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AccessControlListsListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("AccessControlListsListResult", 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.AccessControlList"]: - """List AccessControlLists by subscription. - - Implements AccessControlLists list by subscription GET method. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AccessControlList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.AccessControlList] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AccessControlListsListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("AccessControlListsListResult", 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/accessControlLists" - } - - def _update_administrative_state_initial( - self, - resource_group_name: str, - access_control_list_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_administrative_state_request( - resource_group_name=resource_group_name, - access_control_list_name=access_control_list_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_administrative_state_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_administrative_state_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}/updateAdministrativeState" - } - - @overload - def begin_update_administrative_state( - self, - resource_group_name: str, - access_control_list_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Updates administrative state of Access Control Lists. - - Implements the operation to the underlying resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param access_control_list_name: Name of the Access Control List. Required. - :type access_control_list_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_administrative_state( - self, - resource_group_name: str, - access_control_list_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Updates administrative state of Access Control Lists. - - Implements the operation to the underlying resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param access_control_list_name: Name of the Access Control List. Required. - :type access_control_list_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update_administrative_state( - self, - resource_group_name: str, - access_control_list_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Updates administrative state of Access Control Lists. - - Implements the operation to the underlying resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param access_control_list_name: Name of the Access Control List. Required. - :type access_control_list_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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_administrative_state_initial( - resource_group_name=resource_group_name, - access_control_list_name=access_control_list_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_administrative_state.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}/updateAdministrativeState" - } - - def _resync_initial( - self, resource_group_name: str, access_control_list_name: str, **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - request = build_resync_request( - resource_group_name=resource_group_name, - access_control_list_name=access_control_list_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._resync_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _resync_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}/resync" - } - - @distributed_trace - def begin_resync( - self, resource_group_name: str, access_control_list_name: str, **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Resync operation on the Access Control Lists. - - Implements the operation to the underlying resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param access_control_list_name: Name of the Access Control List. Required. - :type access_control_list_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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._resync_initial( - resource_group_name=resource_group_name, - access_control_list_name=access_control_list_name, - api_version=api_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("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_resync.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}/resync" - } - - def _validate_configuration_initial( - self, resource_group_name: str, access_control_list_name: str, **kwargs: Any - ) -> _models.ValidateConfigurationResponse: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ValidateConfigurationResponse] = kwargs.pop("cls", None) - - request = build_validate_configuration_request( - resource_group_name=resource_group_name, - access_control_list_name=access_control_list_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._validate_configuration_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _validate_configuration_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}/validateConfiguration" - } - - @distributed_trace - def begin_validate_configuration( - self, resource_group_name: str, access_control_list_name: str, **kwargs: Any - ) -> LROPoller[_models.ValidateConfigurationResponse]: - """Validates the configuration of the Access Control Lists. - - Implements the operation to the underlying resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param access_control_list_name: Name of the Access Control List. Required. - :type access_control_list_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ValidateConfigurationResponse or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ValidateConfigurationResponse] = 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._validate_configuration_initial( - resource_group_name=resource_group_name, - access_control_list_name=access_control_list_name, - api_version=api_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("ValidateConfigurationResponse", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}/validateConfiguration" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_external_networks_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_external_networks_operations.py deleted file mode 100644 index 1a9c527b18aa..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_external_networks_operations.py +++ /dev/null @@ -1,1618 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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 _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_request( - resource_group_name: str, - l3_isolation_domain_name: str, - external_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-06-15")) - 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.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}", - ) # 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", max_length=90, min_length=1 - ), - "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), - "externalNetworkName": _SERIALIZER.url("external_network_name", external_network_name, "str"), - } - - _url: str = _format_url_section(_url, **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_get_request( - resource_group_name: str, - l3_isolation_domain_name: str, - external_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}", - ) # 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", max_length=90, min_length=1 - ), - "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), - "externalNetworkName": _SERIALIZER.url("external_network_name", external_network_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, - l3_isolation_domain_name: str, - external_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-06-15")) - 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.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}", - ) # 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", max_length=90, min_length=1 - ), - "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), - "externalNetworkName": _SERIALIZER.url("external_network_name", external_network_name, "str"), - } - - _url: str = _format_url_section(_url, **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_delete_request( - resource_group_name: str, - l3_isolation_domain_name: str, - external_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}", - ) # 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", max_length=90, min_length=1 - ), - "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), - "externalNetworkName": _SERIALIZER.url("external_network_name", external_network_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_list_by_l3_isolation_domain_request( - resource_group_name: str, l3_isolation_domain_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks", - ) # 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", max_length=90, min_length=1 - ), - "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_administrative_state_request( - resource_group_name: str, - l3_isolation_domain_name: str, - external_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-06-15")) - 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.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}/updateAdministrativeState", - ) # 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", max_length=90, min_length=1 - ), - "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), - "externalNetworkName": _SERIALIZER.url("external_network_name", external_network_name, "str"), - } - - _url: str = _format_url_section(_url, **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_update_static_route_bfd_administrative_state_request( - resource_group_name: str, - l3_isolation_domain_name: str, - external_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-06-15")) - 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.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}/updateStaticRouteBfdAdministrativeState", - ) # 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", max_length=90, min_length=1 - ), - "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), - "externalNetworkName": _SERIALIZER.url("external_network_name", external_network_name, "str"), - } - - _url: str = _format_url_section(_url, **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) - - -class ExternalNetworksOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricMgmtClient`'s - :attr:`external_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") - - def _create_initial( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: Union[_models.ExternalNetwork, IO], - **kwargs: Any - ) -> _models.ExternalNetwork: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ExternalNetwork] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "ExternalNetwork") - - request = build_create_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - external_network_name=external_network_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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("ExternalNetwork", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("ExternalNetwork", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}" - } - - @overload - def begin_create( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: _models.ExternalNetwork, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ExternalNetwork]: - """Creates ExternalNetwork for Layer3 Isolation Domain for communication of computes with external - services. - - Creates ExternalNetwork PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param external_network_name: Name of the External Network. Required. - :type external_network_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.ExternalNetwork - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ExternalNetwork or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ExternalNetwork]: - """Creates ExternalNetwork for Layer3 Isolation Domain for communication of computes with external - services. - - Creates ExternalNetwork PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param external_network_name: Name of the External Network. Required. - :type external_network_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ExternalNetwork or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: Union[_models.ExternalNetwork, IO], - **kwargs: Any - ) -> LROPoller[_models.ExternalNetwork]: - """Creates ExternalNetwork for Layer3 Isolation Domain for communication of computes with external - services. - - Creates ExternalNetwork PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param external_network_name: Name of the External Network. Required. - :type external_network_name: str - :param body: Request payload. Is either a ExternalNetwork type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.ExternalNetwork or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ExternalNetwork or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ExternalNetwork] = 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, - l3_isolation_domain_name=l3_isolation_domain_name, - external_network_name=external_network_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ExternalNetwork", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}" - } - - @distributed_trace - def get( - self, resource_group_name: str, l3_isolation_domain_name: str, external_network_name: str, **kwargs: Any - ) -> _models.ExternalNetwork: - """Retrieves details of ExternalNetwork. - - Implements ExternalNetworks GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param external_network_name: Name of the External Network. Required. - :type external_network_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ExternalNetwork or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.ExternalNetwork - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ExternalNetwork] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - external_network_name=external_network_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("ExternalNetwork", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}" - } - - def _update_initial( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: Union[_models.ExternalNetworkPatch, IO], - **kwargs: Any - ) -> Optional[_models.ExternalNetwork]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.ExternalNetwork]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "ExternalNetworkPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - external_network_name=external_network_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("ExternalNetwork", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}" - } - - @overload - def begin_update( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: _models.ExternalNetworkPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ExternalNetwork]: - """Updates a External Networks. - - API to update certain properties of the ExternalNetworks resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param external_network_name: Name of the External Network. Required. - :type external_network_name: str - :param body: ExternalNetwork properties to update. Only annotations are supported. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.ExternalNetworkPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ExternalNetwork or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ExternalNetwork]: - """Updates a External Networks. - - API to update certain properties of the ExternalNetworks resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param external_network_name: Name of the External Network. Required. - :type external_network_name: str - :param body: ExternalNetwork properties to update. Only annotations are supported. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ExternalNetwork or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: Union[_models.ExternalNetworkPatch, IO], - **kwargs: Any - ) -> LROPoller[_models.ExternalNetwork]: - """Updates a External Networks. - - API to update certain properties of the ExternalNetworks resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param external_network_name: Name of the External Network. Required. - :type external_network_name: str - :param body: ExternalNetwork properties to update. Only annotations are supported. Is either a - ExternalNetworkPatch type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.ExternalNetworkPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ExternalNetwork or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ExternalNetwork] = 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, - l3_isolation_domain_name=l3_isolation_domain_name, - external_network_name=external_network_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ExternalNetwork", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, l3_isolation_domain_name: str, external_network_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - external_network_name=external_network_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}" - } - - @distributed_trace - def begin_delete( - self, resource_group_name: str, l3_isolation_domain_name: str, external_network_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a ExternalNetworks. - - Implements ExternalNetworks DELETE method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param external_network_name: Name of the External Network. Required. - :type external_network_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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, - l3_isolation_domain_name=l3_isolation_domain_name, - external_network_name=external_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, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}" - } - - @distributed_trace - def list_by_l3_isolation_domain( - self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any - ) -> Iterable["_models.ExternalNetwork"]: - """Executes list operation to display External Networks within an isolation domain. - - Implements External Networks list by resource group GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ExternalNetwork or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ExternalNetworksList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_l3_isolation_domain_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_l3_isolation_domain.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("ExternalNetworksList", 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) - - list_by_l3_isolation_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks" - } - - def _update_administrative_state_initial( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_administrative_state_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - external_network_name=external_network_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_administrative_state_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_administrative_state_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}/updateAdministrativeState" - } - - @overload - def begin_update_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Executes update operation to enable or disable administrative State for externalNetwork. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param external_network_name: Name of the External Network. Required. - :type external_network_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Executes update operation to enable or disable administrative State for externalNetwork. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param external_network_name: Name of the External Network. Required. - :type external_network_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Executes update operation to enable or disable administrative State for externalNetwork. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param external_network_name: Name of the External Network. Required. - :type external_network_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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_administrative_state_initial( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - external_network_name=external_network_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_administrative_state.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}/updateAdministrativeState" - } - - def _update_static_route_bfd_administrative_state_initial( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_static_route_bfd_administrative_state_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - external_network_name=external_network_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_static_route_bfd_administrative_state_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_static_route_bfd_administrative_state_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}/updateStaticRouteBfdAdministrativeState" - } - - @overload - def begin_update_static_route_bfd_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Executes Static Route BFD state update operation to the underlying resources. - - Update Static Route BFD for external Network. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param external_network_name: Name of the External Network. Required. - :type external_network_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_static_route_bfd_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Executes Static Route BFD state update operation to the underlying resources. - - Update Static Route BFD for external Network. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param external_network_name: Name of the External Network. Required. - :type external_network_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update_static_route_bfd_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - external_network_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Executes Static Route BFD state update operation to the underlying resources. - - Update Static Route BFD for external Network. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param external_network_name: Name of the External Network. Required. - :type external_network_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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_static_route_bfd_administrative_state_initial( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - external_network_name=external_network_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_static_route_bfd_administrative_state.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}/updateStaticRouteBfdAdministrativeState" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_internal_networks_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_internal_networks_operations.py deleted file mode 100644 index 43541bac41e9..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_internal_networks_operations.py +++ /dev/null @@ -1,1911 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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 _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_request( - resource_group_name: str, - l3_isolation_domain_name: str, - internal_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-06-15")) - 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.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}", - ) # 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", max_length=90, min_length=1 - ), - "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), - "internalNetworkName": _SERIALIZER.url("internal_network_name", internal_network_name, "str"), - } - - _url: str = _format_url_section(_url, **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_get_request( - resource_group_name: str, - l3_isolation_domain_name: str, - internal_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}", - ) # 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", max_length=90, min_length=1 - ), - "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), - "internalNetworkName": _SERIALIZER.url("internal_network_name", internal_network_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, - l3_isolation_domain_name: str, - internal_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-06-15")) - 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.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}", - ) # 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", max_length=90, min_length=1 - ), - "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), - "internalNetworkName": _SERIALIZER.url("internal_network_name", internal_network_name, "str"), - } - - _url: str = _format_url_section(_url, **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_delete_request( - resource_group_name: str, - l3_isolation_domain_name: str, - internal_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}", - ) # 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", max_length=90, min_length=1 - ), - "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), - "internalNetworkName": _SERIALIZER.url("internal_network_name", internal_network_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_list_by_l3_isolation_domain_request( - resource_group_name: str, l3_isolation_domain_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks", - ) # 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", max_length=90, min_length=1 - ), - "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_administrative_state_request( - resource_group_name: str, - l3_isolation_domain_name: str, - internal_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-06-15")) - 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.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateAdministrativeState", - ) # 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", max_length=90, min_length=1 - ), - "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), - "internalNetworkName": _SERIALIZER.url("internal_network_name", internal_network_name, "str"), - } - - _url: str = _format_url_section(_url, **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_update_bgp_administrative_state_request( - resource_group_name: str, - l3_isolation_domain_name: str, - internal_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-06-15")) - 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.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateBgpAdministrativeState", - ) # 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", max_length=90, min_length=1 - ), - "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), - "internalNetworkName": _SERIALIZER.url("internal_network_name", internal_network_name, "str"), - } - - _url: str = _format_url_section(_url, **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_update_static_route_bfd_administrative_state_request( - resource_group_name: str, - l3_isolation_domain_name: str, - internal_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-06-15")) - 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.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateStaticRouteBfdAdministrativeState", - ) # 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", max_length=90, min_length=1 - ), - "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), - "internalNetworkName": _SERIALIZER.url("internal_network_name", internal_network_name, "str"), - } - - _url: str = _format_url_section(_url, **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) - - -class InternalNetworksOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricMgmtClient`'s - :attr:`internal_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") - - def _create_initial( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: Union[_models.InternalNetwork, IO], - **kwargs: Any - ) -> _models.InternalNetwork: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InternalNetwork] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "InternalNetwork") - - request = build_create_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - internal_network_name=internal_network_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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("InternalNetwork", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("InternalNetwork", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}" - } - - @overload - def begin_create( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: _models.InternalNetwork, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InternalNetwork]: - """Creates InternalNetwork for Layer3 Isolation Domain for communication of compute within and - across racks. - - Creates InternalNetwork PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.InternalNetwork - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InternalNetwork or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InternalNetwork]: - """Creates InternalNetwork for Layer3 Isolation Domain for communication of compute within and - across racks. - - Creates InternalNetwork PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InternalNetwork or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: Union[_models.InternalNetwork, IO], - **kwargs: Any - ) -> LROPoller[_models.InternalNetwork]: - """Creates InternalNetwork for Layer3 Isolation Domain for communication of compute within and - across racks. - - Creates InternalNetwork PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :param body: Request payload. Is either a InternalNetwork type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.InternalNetwork or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InternalNetwork or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InternalNetwork] = 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, - l3_isolation_domain_name=l3_isolation_domain_name, - internal_network_name=internal_network_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("InternalNetwork", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}" - } - - @distributed_trace - def get( - self, resource_group_name: str, l3_isolation_domain_name: str, internal_network_name: str, **kwargs: Any - ) -> _models.InternalNetwork: - """Retrieves details of InternalNetworks using GET method. - - Gets a InternalNetworks. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InternalNetwork or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.InternalNetwork - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.InternalNetwork] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - internal_network_name=internal_network_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("InternalNetwork", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}" - } - - def _update_initial( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: Union[_models.InternalNetworkPatch, IO], - **kwargs: Any - ) -> Optional[_models.InternalNetwork]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.InternalNetwork]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "InternalNetworkPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - internal_network_name=internal_network_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("InternalNetwork", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}" - } - - @overload - def begin_update( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: _models.InternalNetworkPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InternalNetwork]: - """API to update certain properties of the InternalNetworks resources. - - Updates a InternalNetworks. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :param body: InternalNetwork properties to update. Only annotations are supported. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.InternalNetworkPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InternalNetwork or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InternalNetwork]: - """API to update certain properties of the InternalNetworks resources. - - Updates a InternalNetworks. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :param body: InternalNetwork properties to update. Only annotations are supported. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InternalNetwork or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: Union[_models.InternalNetworkPatch, IO], - **kwargs: Any - ) -> LROPoller[_models.InternalNetwork]: - """API to update certain properties of the InternalNetworks resources. - - Updates a InternalNetworks. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :param body: InternalNetwork properties to update. Only annotations are supported. Is either a - InternalNetworkPatch type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.InternalNetworkPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InternalNetwork or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InternalNetwork] = 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, - l3_isolation_domain_name=l3_isolation_domain_name, - internal_network_name=internal_network_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("InternalNetwork", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, l3_isolation_domain_name: str, internal_network_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - internal_network_name=internal_network_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}" - } - - @distributed_trace - def begin_delete( - self, resource_group_name: str, l3_isolation_domain_name: str, internal_network_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a InternalNetworks. - - Implements InternalNetworks DELETE method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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, - l3_isolation_domain_name=l3_isolation_domain_name, - internal_network_name=internal_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, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}" - } - - @distributed_trace - def list_by_l3_isolation_domain( - self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any - ) -> Iterable["_models.InternalNetwork"]: - """Executes list operation to display list of all internal networks. - - Displays InternalNetworks list by resource group GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InternalNetwork or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.InternalNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.InternalNetworksList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_l3_isolation_domain_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_l3_isolation_domain.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("InternalNetworksList", 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) - - list_by_l3_isolation_domain.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks" - } - - def _update_administrative_state_initial( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_administrative_state_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - internal_network_name=internal_network_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_administrative_state_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_administrative_state_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateAdministrativeState" - } - - @overload - def begin_update_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Executes the operation to the underlying resources. - - Update Administrative state of InternalNetworks on resources referred by their resource ids. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Executes the operation to the underlying resources. - - Update Administrative state of InternalNetworks on resources referred by their resource ids. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Executes the operation to the underlying resources. - - Update Administrative state of InternalNetworks on resources referred by their resource ids. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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_administrative_state_initial( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - internal_network_name=internal_network_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_administrative_state.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateAdministrativeState" - } - - def _update_bgp_administrative_state_initial( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_bgp_administrative_state_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - internal_network_name=internal_network_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_bgp_administrative_state_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_bgp_administrative_state_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateBgpAdministrativeState" - } - - @overload - def begin_update_bgp_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Executes the operation to the underlying resources for updating BGP state on edge devices. - - Update BGP state for internalNetwork. Allowed only on edge devices. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_bgp_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Executes the operation to the underlying resources for updating BGP state on edge devices. - - Update BGP state for internalNetwork. Allowed only on edge devices. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update_bgp_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Executes the operation to the underlying resources for updating BGP state on edge devices. - - Update BGP state for internalNetwork. Allowed only on edge devices. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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_bgp_administrative_state_initial( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - internal_network_name=internal_network_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_bgp_administrative_state.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateBgpAdministrativeState" - } - - def _update_static_route_bfd_administrative_state_initial( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_static_route_bfd_administrative_state_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - internal_network_name=internal_network_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_static_route_bfd_administrative_state_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_static_route_bfd_administrative_state_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateStaticRouteBfdAdministrativeState" - } - - @overload - def begin_update_static_route_bfd_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Update Static Route BFD administrative state for internalNetwork. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_static_route_bfd_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Update Static Route BFD administrative state for internalNetwork. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update_static_route_bfd_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - internal_network_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Update Static Route BFD administrative state for internalNetwork. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param internal_network_name: Name of the Internal Network. Required. - :type internal_network_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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_static_route_bfd_administrative_state_initial( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - internal_network_name=internal_network_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_static_route_bfd_administrative_state.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateStaticRouteBfdAdministrativeState" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_internet_gateway_rules_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_internet_gateway_rules_operations.py deleted file mode 100644 index ccb544cbc307..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_internet_gateway_rules_operations.py +++ /dev/null @@ -1,1100 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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 _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_request( - resource_group_name: str, internet_gateway_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-06-15")) - 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.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName}", - ) # 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", max_length=90, min_length=1 - ), - "internetGatewayRuleName": _SERIALIZER.url("internet_gateway_rule_name", internet_gateway_rule_name, "str"), - } - - _url: str = _format_url_section(_url, **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_get_request( - resource_group_name: str, internet_gateway_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName}", - ) # 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", max_length=90, min_length=1 - ), - "internetGatewayRuleName": _SERIALIZER.url("internet_gateway_rule_name", internet_gateway_rule_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, internet_gateway_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-06-15")) - 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.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName}", - ) # 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", max_length=90, min_length=1 - ), - "internetGatewayRuleName": _SERIALIZER.url("internet_gateway_rule_name", internet_gateway_rule_name, "str"), - } - - _url: str = _format_url_section(_url, **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_delete_request( - resource_group_name: str, internet_gateway_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName}", - ) # 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", max_length=90, min_length=1 - ), - "internetGatewayRuleName": _SERIALIZER.url("internet_gateway_rule_name", internet_gateway_rule_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_list_by_resource_group_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules", - ) # 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", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_subscription_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules" - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class InternetGatewayRulesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricMgmtClient`'s - :attr:`internet_gateway_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") - - def _create_initial( - self, - resource_group_name: str, - internet_gateway_rule_name: str, - body: Union[_models.InternetGatewayRule, IO], - **kwargs: Any - ) -> _models.InternetGatewayRule: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InternetGatewayRule] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "InternetGatewayRule") - - request = build_create_request( - resource_group_name=resource_group_name, - internet_gateway_rule_name=internet_gateway_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("InternetGatewayRule", pipeline_response) - - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = self._deserialize("InternetGatewayRule", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName}" - } - - @overload - def begin_create( - self, - resource_group_name: str, - internet_gateway_rule_name: str, - body: _models.InternetGatewayRule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InternetGatewayRule]: - """Creates an Internet Gateway rule. - - Creates an Internet Gateway rule resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. - :type internet_gateway_rule_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.InternetGatewayRule - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InternetGatewayRule or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - internet_gateway_rule_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InternetGatewayRule]: - """Creates an Internet Gateway rule. - - Creates an Internet Gateway rule resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. - :type internet_gateway_rule_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InternetGatewayRule or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - internet_gateway_rule_name: str, - body: Union[_models.InternetGatewayRule, IO], - **kwargs: Any - ) -> LROPoller[_models.InternetGatewayRule]: - """Creates an Internet Gateway rule. - - Creates an Internet Gateway rule resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. - :type internet_gateway_rule_name: str - :param body: Request payload. Is either a InternetGatewayRule type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.InternetGatewayRule or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InternetGatewayRule or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InternetGatewayRule] = 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, - internet_gateway_rule_name=internet_gateway_rule_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("InternetGatewayRule", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName}" - } - - @distributed_trace - def get( - self, resource_group_name: str, internet_gateway_rule_name: str, **kwargs: Any - ) -> _models.InternetGatewayRule: - """Gets an Internet Gateway Rule. - - Gets an Internet Gateway Rule resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. - :type internet_gateway_rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InternetGatewayRule or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.InternetGatewayRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.InternetGatewayRule] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - internet_gateway_rule_name=internet_gateway_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("InternetGatewayRule", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName}" - } - - def _update_initial( - self, - resource_group_name: str, - internet_gateway_rule_name: str, - body: Union[_models.InternetGatewayRulePatch, IO], - **kwargs: Any - ) -> Optional[_models.InternetGatewayRule]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.InternetGatewayRule]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "InternetGatewayRulePatch") - - request = build_update_request( - resource_group_name=resource_group_name, - internet_gateway_rule_name=internet_gateway_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("InternetGatewayRule", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName}" - } - - @overload - def begin_update( - self, - resource_group_name: str, - internet_gateway_rule_name: str, - body: _models.InternetGatewayRulePatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InternetGatewayRule]: - """Updates an Internet Gateway Rule. - - API to update certain properties of the Internet Gateway Rule resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. - :type internet_gateway_rule_name: str - :param body: Internet Gateway Rule properties to update. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.InternetGatewayRulePatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InternetGatewayRule or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - internet_gateway_rule_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InternetGatewayRule]: - """Updates an Internet Gateway Rule. - - API to update certain properties of the Internet Gateway Rule resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. - :type internet_gateway_rule_name: str - :param body: Internet Gateway Rule properties to update. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InternetGatewayRule or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - internet_gateway_rule_name: str, - body: Union[_models.InternetGatewayRulePatch, IO], - **kwargs: Any - ) -> LROPoller[_models.InternetGatewayRule]: - """Updates an Internet Gateway Rule. - - API to update certain properties of the Internet Gateway Rule resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. - :type internet_gateway_rule_name: str - :param body: Internet Gateway Rule properties to update. Is either a InternetGatewayRulePatch - type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.InternetGatewayRulePatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InternetGatewayRule or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InternetGatewayRule] = 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, - internet_gateway_rule_name=internet_gateway_rule_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("InternetGatewayRule", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, internet_gateway_rule_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - internet_gateway_rule_name=internet_gateway_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: 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) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName}" - } - - @distributed_trace - def begin_delete(self, resource_group_name: str, internet_gateway_rule_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes an Internet Gateway Rule. - - Implements Internet Gateway Rules DELETE method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. - :type internet_gateway_rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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, - internet_gateway_rule_name=internet_gateway_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, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName}" - } - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.InternetGatewayRule"]: - """List Internet Gateway Rules by resource group. - - Implements Internet Gateway Rules list by resource group GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InternetGatewayRule or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.InternetGatewayRulesListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("InternetGatewayRulesListResult", 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.InternetGatewayRule"]: - """List Internet Gateway Rules by subscription. - - List all Internet Gateway rules in the given subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InternetGatewayRule or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.InternetGatewayRulesListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("InternetGatewayRulesListResult", 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_internet_gateways_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_internet_gateways_operations.py deleted file mode 100644 index 634f76770cf5..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_internet_gateways_operations.py +++ /dev/null @@ -1,1082 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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 _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_request( - resource_group_name: str, internet_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-06-15")) - 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.ManagedNetworkFabric/internetGateways/{internetGatewayName}", - ) # 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", max_length=90, min_length=1 - ), - "internetGatewayName": _SERIALIZER.url("internet_gateway_name", internet_gateway_name, "str"), - } - - _url: str = _format_url_section(_url, **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_get_request( - resource_group_name: str, internet_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName}", - ) # 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", max_length=90, min_length=1 - ), - "internetGatewayName": _SERIALIZER.url("internet_gateway_name", internet_gateway_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, internet_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-06-15")) - 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.ManagedNetworkFabric/internetGateways/{internetGatewayName}", - ) # 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", max_length=90, min_length=1 - ), - "internetGatewayName": _SERIALIZER.url("internet_gateway_name", internet_gateway_name, "str"), - } - - _url: str = _format_url_section(_url, **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_delete_request( - resource_group_name: str, internet_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName}", - ) # 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", max_length=90, min_length=1 - ), - "internetGatewayName": _SERIALIZER.url("internet_gateway_name", internet_gateway_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_list_by_resource_group_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways", - ) # 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", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_subscription_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/internetGateways" - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class InternetGatewaysOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricMgmtClient`'s - :attr:`internet_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") - - def _create_initial( - self, - resource_group_name: str, - internet_gateway_name: str, - body: Union[_models.InternetGateway, IO], - **kwargs: Any - ) -> _models.InternetGateway: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InternetGateway] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "InternetGateway") - - request = build_create_request( - resource_group_name=resource_group_name, - internet_gateway_name=internet_gateway_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("InternetGateway", pipeline_response) - - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = self._deserialize("InternetGateway", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName}" - } - - @overload - def begin_create( - self, - resource_group_name: str, - internet_gateway_name: str, - body: _models.InternetGateway, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InternetGateway]: - """Create a Network Fabric Service Internet Gateway. - - Creates a Network Fabric Service Internet Gateway resource instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_name: Name of the Internet Gateway. Required. - :type internet_gateway_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.InternetGateway - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InternetGateway or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternetGateway] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - internet_gateway_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InternetGateway]: - """Create a Network Fabric Service Internet Gateway. - - Creates a Network Fabric Service Internet Gateway resource instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_name: Name of the Internet Gateway. Required. - :type internet_gateway_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InternetGateway or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternetGateway] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - internet_gateway_name: str, - body: Union[_models.InternetGateway, IO], - **kwargs: Any - ) -> LROPoller[_models.InternetGateway]: - """Create a Network Fabric Service Internet Gateway. - - Creates a Network Fabric Service Internet Gateway resource instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_name: Name of the Internet Gateway. Required. - :type internet_gateway_name: str - :param body: Request payload. Is either a InternetGateway type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.InternetGateway or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InternetGateway or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternetGateway] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InternetGateway] = 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, - internet_gateway_name=internet_gateway_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("InternetGateway", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName}" - } - - @distributed_trace - def get(self, resource_group_name: str, internet_gateway_name: str, **kwargs: Any) -> _models.InternetGateway: - """Retrieves details of Network Fabric Service Internet Gateway. - - Implements Gateway GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_name: Name of the Internet Gateway. Required. - :type internet_gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InternetGateway or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.InternetGateway - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.InternetGateway] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - internet_gateway_name=internet_gateway_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("InternetGateway", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName}" - } - - def _update_initial( - self, - resource_group_name: str, - internet_gateway_name: str, - body: Union[_models.InternetGatewayPatch, IO], - **kwargs: Any - ) -> Optional[_models.InternetGateway]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.InternetGateway]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "InternetGatewayPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - internet_gateway_name=internet_gateway_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("InternetGateway", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName}" - } - - @overload - def begin_update( - self, - resource_group_name: str, - internet_gateway_name: str, - body: _models.InternetGatewayPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InternetGateway]: - """Updates a Network Fabric Service Internet Gateway. - - Execute patch on Network Fabric Service Internet Gateway. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_name: Name of the Internet Gateway. Required. - :type internet_gateway_name: str - :param body: API to update certain properties of the L2 Isolation Domain resource.. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.InternetGatewayPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InternetGateway or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternetGateway] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - internet_gateway_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InternetGateway]: - """Updates a Network Fabric Service Internet Gateway. - - Execute patch on Network Fabric Service Internet Gateway. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_name: Name of the Internet Gateway. Required. - :type internet_gateway_name: str - :param body: API to update certain properties of the L2 Isolation Domain resource.. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InternetGateway or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternetGateway] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - internet_gateway_name: str, - body: Union[_models.InternetGatewayPatch, IO], - **kwargs: Any - ) -> LROPoller[_models.InternetGateway]: - """Updates a Network Fabric Service Internet Gateway. - - Execute patch on Network Fabric Service Internet Gateway. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_name: Name of the Internet Gateway. Required. - :type internet_gateway_name: str - :param body: API to update certain properties of the L2 Isolation Domain resource.. Is either a - InternetGatewayPatch type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.InternetGatewayPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either InternetGateway or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternetGateway] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InternetGateway] = 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, - internet_gateway_name=internet_gateway_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("InternetGateway", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, internet_gateway_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - internet_gateway_name=internet_gateway_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName}" - } - - @distributed_trace - def begin_delete(self, resource_group_name: str, internet_gateway_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a Network Fabric Service Internet Gateway. - - Execute a delete on Network Fabric Service Internet Gateway. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param internet_gateway_name: Name of the Internet Gateway. Required. - :type internet_gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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, - internet_gateway_name=internet_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, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName}" - } - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.InternetGateway"]: - """List Internet Gateways by resource group. - - Displays Internet Gateways list by resource group GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InternetGateway or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.InternetGateway] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.InternetGatewaysListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("InternetGatewaysListResult", 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.InternetGateway"]: - """List Internet Gateways by subscription. - - Displays Internet Gateways list by subscription GET method. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InternetGateway or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.InternetGateway] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.InternetGatewaysListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("InternetGatewaysListResult", 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/internetGateways" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_ip_communities_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_ip_communities_operations.py deleted file mode 100644 index 861d85bba59d..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_ip_communities_operations.py +++ /dev/null @@ -1,1072 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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 _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_request( - resource_group_name: str, ip_community_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/ipCommunities/{ipCommunityName}", - ) # 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", max_length=90, min_length=1 - ), - "ipCommunityName": _SERIALIZER.url("ip_community_name", ip_community_name, "str"), - } - - _url: str = _format_url_section(_url, **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_get_request( - resource_group_name: str, ip_community_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities/{ipCommunityName}", - ) # 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", max_length=90, min_length=1 - ), - "ipCommunityName": _SERIALIZER.url("ip_community_name", ip_community_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, ip_community_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/ipCommunities/{ipCommunityName}", - ) # 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", max_length=90, min_length=1 - ), - "ipCommunityName": _SERIALIZER.url("ip_community_name", ip_community_name, "str"), - } - - _url: str = _format_url_section(_url, **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_delete_request( - resource_group_name: str, ip_community_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities/{ipCommunityName}", - ) # 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", max_length=90, min_length=1 - ), - "ipCommunityName": _SERIALIZER.url("ip_community_name", ip_community_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_list_by_resource_group_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities", - ) # 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", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_subscription_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/ipCommunities" - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class IpCommunitiesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricMgmtClient`'s - :attr:`ip_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") - - def _create_initial( - self, resource_group_name: str, ip_community_name: str, body: Union[_models.IpCommunity, IO], **kwargs: Any - ) -> _models.IpCommunity: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.IpCommunity] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "IpCommunity") - - request = build_create_request( - resource_group_name=resource_group_name, - ip_community_name=ip_community_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("IpCommunity", pipeline_response) - - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = self._deserialize("IpCommunity", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities/{ipCommunityName}" - } - - @overload - def begin_create( - self, - resource_group_name: str, - ip_community_name: str, - body: _models.IpCommunity, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.IpCommunity]: - """Create an IP Community. - - Implements an IP Community PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_community_name: Name of the IP Community. Required. - :type ip_community_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.IpCommunity - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either IpCommunity or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - ip_community_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.IpCommunity]: - """Create an IP Community. - - Implements an IP Community PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_community_name: Name of the IP Community. Required. - :type ip_community_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either IpCommunity or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, resource_group_name: str, ip_community_name: str, body: Union[_models.IpCommunity, IO], **kwargs: Any - ) -> LROPoller[_models.IpCommunity]: - """Create an IP Community. - - Implements an IP Community PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_community_name: Name of the IP Community. Required. - :type ip_community_name: str - :param body: Request payload. Is either a IpCommunity type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.IpCommunity or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either IpCommunity or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.IpCommunity] = 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, - ip_community_name=ip_community_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("IpCommunity", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities/{ipCommunityName}" - } - - @distributed_trace - def get(self, resource_group_name: str, ip_community_name: str, **kwargs: Any) -> _models.IpCommunity: - """Gets an IP Community. - - Implements an IP Community GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_community_name: Name of the IP Community. Required. - :type ip_community_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: IpCommunity or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.IpCommunity - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.IpCommunity] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - ip_community_name=ip_community_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("IpCommunity", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities/{ipCommunityName}" - } - - def _update_initial( - self, resource_group_name: str, ip_community_name: str, body: Union[_models.IpCommunityPatch, IO], **kwargs: Any - ) -> Optional[_models.IpCommunity]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.IpCommunity]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "IpCommunityPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - ip_community_name=ip_community_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("IpCommunity", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities/{ipCommunityName}" - } - - @overload - def begin_update( - self, - resource_group_name: str, - ip_community_name: str, - body: _models.IpCommunityPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.IpCommunity]: - """Updates an IP Community. - - API to update certain properties of the IP Community resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_community_name: Name of the IP Community. Required. - :type ip_community_name: str - :param body: IP Community properties to update. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.IpCommunityPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either IpCommunity or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - ip_community_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.IpCommunity]: - """Updates an IP Community. - - API to update certain properties of the IP Community resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_community_name: Name of the IP Community. Required. - :type ip_community_name: str - :param body: IP Community properties to update. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either IpCommunity or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, resource_group_name: str, ip_community_name: str, body: Union[_models.IpCommunityPatch, IO], **kwargs: Any - ) -> LROPoller[_models.IpCommunity]: - """Updates an IP Community. - - API to update certain properties of the IP Community resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_community_name: Name of the IP Community. Required. - :type ip_community_name: str - :param body: IP Community properties to update. Is either a IpCommunityPatch type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.IpCommunityPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either IpCommunity or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.IpCommunity] = 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, - ip_community_name=ip_community_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("IpCommunity", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities/{ipCommunityName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, ip_community_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - ip_community_name=ip_community_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: 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) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities/{ipCommunityName}" - } - - @distributed_trace - def begin_delete(self, resource_group_name: str, ip_community_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes an IP Community. - - Implements IP Community DELETE method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_community_name: Name of the IP Community. Required. - :type ip_community_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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_community_name=ip_community_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities/{ipCommunityName}" - } - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.IpCommunity"]: - """List IP Communities by resource group. - - Implements IP Communities list by resource group GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IpCommunity or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.IpCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.IpCommunitiesListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("IpCommunitiesListResult", 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.IpCommunity"]: - """List IP Communities by subscription. - - Implements IP Communities list by subscription GET method. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IpCommunity or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.IpCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.IpCommunitiesListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("IpCommunitiesListResult", 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/ipCommunities" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_ip_extended_communities_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_ip_extended_communities_operations.py deleted file mode 100644 index 9315e7414a1d..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_ip_extended_communities_operations.py +++ /dev/null @@ -1,1100 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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 _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_request( - resource_group_name: str, ip_extended_community_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName}", - ) # 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", max_length=90, min_length=1 - ), - "ipExtendedCommunityName": _SERIALIZER.url("ip_extended_community_name", ip_extended_community_name, "str"), - } - - _url: str = _format_url_section(_url, **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_get_request( - resource_group_name: str, ip_extended_community_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName}", - ) # 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", max_length=90, min_length=1 - ), - "ipExtendedCommunityName": _SERIALIZER.url("ip_extended_community_name", ip_extended_community_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, ip_extended_community_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName}", - ) # 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", max_length=90, min_length=1 - ), - "ipExtendedCommunityName": _SERIALIZER.url("ip_extended_community_name", ip_extended_community_name, "str"), - } - - _url: str = _format_url_section(_url, **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_delete_request( - resource_group_name: str, ip_extended_community_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName}", - ) # 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", max_length=90, min_length=1 - ), - "ipExtendedCommunityName": _SERIALIZER.url("ip_extended_community_name", ip_extended_community_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_list_by_resource_group_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities", - ) # 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", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_subscription_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities" - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class IpExtendedCommunitiesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricMgmtClient`'s - :attr:`ip_extended_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") - - def _create_initial( - self, - resource_group_name: str, - ip_extended_community_name: str, - body: Union[_models.IpExtendedCommunity, IO], - **kwargs: Any - ) -> _models.IpExtendedCommunity: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.IpExtendedCommunity] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "IpExtendedCommunity") - - request = build_create_request( - resource_group_name=resource_group_name, - ip_extended_community_name=ip_extended_community_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("IpExtendedCommunity", pipeline_response) - - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = self._deserialize("IpExtendedCommunity", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName}" - } - - @overload - def begin_create( - self, - resource_group_name: str, - ip_extended_community_name: str, - body: _models.IpExtendedCommunity, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.IpExtendedCommunity]: - """Create an IP Extended Community. - - Implements IP Extended Community PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_extended_community_name: Name of the IP Extended Community. Required. - :type ip_extended_community_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either IpExtendedCommunity or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - ip_extended_community_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.IpExtendedCommunity]: - """Create an IP Extended Community. - - Implements IP Extended Community PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_extended_community_name: Name of the IP Extended Community. Required. - :type ip_extended_community_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either IpExtendedCommunity or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - ip_extended_community_name: str, - body: Union[_models.IpExtendedCommunity, IO], - **kwargs: Any - ) -> LROPoller[_models.IpExtendedCommunity]: - """Create an IP Extended Community. - - Implements IP Extended Community PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_extended_community_name: Name of the IP Extended Community. Required. - :type ip_extended_community_name: str - :param body: Request payload. Is either a IpExtendedCommunity type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either IpExtendedCommunity or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.IpExtendedCommunity] = 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, - ip_extended_community_name=ip_extended_community_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("IpExtendedCommunity", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName}" - } - - @distributed_trace - def get( - self, resource_group_name: str, ip_extended_community_name: str, **kwargs: Any - ) -> _models.IpExtendedCommunity: - """Gets an IP Extended Community. - - Implements IP Extended Community GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_extended_community_name: Name of the IP Extended Community. Required. - :type ip_extended_community_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: IpExtendedCommunity or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.IpExtendedCommunity] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - ip_extended_community_name=ip_extended_community_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("IpExtendedCommunity", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName}" - } - - def _update_initial( - self, - resource_group_name: str, - ip_extended_community_name: str, - body: Union[_models.IpExtendedCommunityPatch, IO], - **kwargs: Any - ) -> Optional[_models.IpExtendedCommunity]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.IpExtendedCommunity]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "IpExtendedCommunityPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - ip_extended_community_name=ip_extended_community_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("IpExtendedCommunity", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName}" - } - - @overload - def begin_update( - self, - resource_group_name: str, - ip_extended_community_name: str, - body: _models.IpExtendedCommunityPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.IpExtendedCommunity]: - """Updates the IP Extended Community. - - API to update certain properties of the IP Extended Community resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_extended_community_name: Name of the IP Extended Community. Required. - :type ip_extended_community_name: str - :param body: IP Extended Community properties to update. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either IpExtendedCommunity or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - ip_extended_community_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.IpExtendedCommunity]: - """Updates the IP Extended Community. - - API to update certain properties of the IP Extended Community resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_extended_community_name: Name of the IP Extended Community. Required. - :type ip_extended_community_name: str - :param body: IP Extended Community properties to update. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either IpExtendedCommunity or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - ip_extended_community_name: str, - body: Union[_models.IpExtendedCommunityPatch, IO], - **kwargs: Any - ) -> LROPoller[_models.IpExtendedCommunity]: - """Updates the IP Extended Community. - - API to update certain properties of the IP Extended Community resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_extended_community_name: Name of the IP Extended Community. Required. - :type ip_extended_community_name: str - :param body: IP Extended Community properties to update. Is either a IpExtendedCommunityPatch - type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either IpExtendedCommunity or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.IpExtendedCommunity] = 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, - ip_extended_community_name=ip_extended_community_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("IpExtendedCommunity", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, ip_extended_community_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - ip_extended_community_name=ip_extended_community_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: 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) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName}" - } - - @distributed_trace - def begin_delete(self, resource_group_name: str, ip_extended_community_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes the IP Extended Community. - - Implements IP Extended Community DELETE method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_extended_community_name: Name of the IP Extended Community. Required. - :type ip_extended_community_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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_extended_community_name=ip_extended_community_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName}" - } - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.IpExtendedCommunity"]: - """List IpExtendedCommunities by resource group. - - Implements IpExtendedCommunities list by resource group GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IpExtendedCommunity or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.IpExtendedCommunityListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("IpExtendedCommunityListResult", 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.IpExtendedCommunity"]: - """List IpExtendedCommunities by subscription. - - Implements IpExtendedCommunities list by subscription GET method. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IpExtendedCommunity or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.IpExtendedCommunityListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("IpExtendedCommunityListResult", 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_ip_prefixes_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_ip_prefixes_operations.py deleted file mode 100644 index 86cd6027d893..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_ip_prefixes_operations.py +++ /dev/null @@ -1,1066 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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 _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_request( - resource_group_name: str, 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-06-15")) - 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.ManagedNetworkFabric/ipPrefixes/{ipPrefixName}", - ) # 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", max_length=90, min_length=1 - ), - "ipPrefixName": _SERIALIZER.url("ip_prefix_name", ip_prefix_name, "str"), - } - - _url: str = _format_url_section(_url, **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_get_request( - resource_group_name: str, 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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/{ipPrefixName}", - ) # 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", max_length=90, min_length=1 - ), - "ipPrefixName": _SERIALIZER.url("ip_prefix_name", ip_prefix_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, 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-06-15")) - 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.ManagedNetworkFabric/ipPrefixes/{ipPrefixName}", - ) # 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", max_length=90, min_length=1 - ), - "ipPrefixName": _SERIALIZER.url("ip_prefix_name", ip_prefix_name, "str"), - } - - _url: str = _format_url_section(_url, **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_delete_request( - resource_group_name: str, 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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/{ipPrefixName}", - ) # 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", max_length=90, min_length=1 - ), - "ipPrefixName": _SERIALIZER.url("ip_prefix_name", ip_prefix_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_list_by_resource_group_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes", - ) # 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", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_subscription_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes" - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class IpPrefixesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricMgmtClient`'s - :attr:`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") - - def _create_initial( - self, resource_group_name: str, ip_prefix_name: str, body: Union[_models.IpPrefix, IO], **kwargs: Any - ) -> _models.IpPrefix: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.IpPrefix] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "IpPrefix") - - request = build_create_request( - resource_group_name=resource_group_name, - ip_prefix_name=ip_prefix_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("IpPrefix", pipeline_response) - - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = self._deserialize("IpPrefix", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/{ipPrefixName}" - } - - @overload - def begin_create( - self, - resource_group_name: str, - ip_prefix_name: str, - body: _models.IpPrefix, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.IpPrefix]: - """Create an IP Prefix. - - Implements IP Prefix PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_prefix_name: Name of the IP Prefix. Required. - :type ip_prefix_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.IpPrefix - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either IpPrefix or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpPrefix] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - ip_prefix_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.IpPrefix]: - """Create an IP Prefix. - - Implements IP Prefix PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_prefix_name: Name of the IP Prefix. Required. - :type ip_prefix_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either IpPrefix or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpPrefix] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, resource_group_name: str, ip_prefix_name: str, body: Union[_models.IpPrefix, IO], **kwargs: Any - ) -> LROPoller[_models.IpPrefix]: - """Create an IP Prefix. - - Implements IP Prefix PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_prefix_name: Name of the IP Prefix. Required. - :type ip_prefix_name: str - :param body: Request payload. Is either a IpPrefix type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.IpPrefix or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either IpPrefix or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpPrefix] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.IpPrefix] = 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, - ip_prefix_name=ip_prefix_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("IpPrefix", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/{ipPrefixName}" - } - - @distributed_trace - def get(self, resource_group_name: str, ip_prefix_name: str, **kwargs: Any) -> _models.IpPrefix: - """Gets an IP Prefix. - - Implements IP Prefix GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_prefix_name: Name of the IP Prefix. Required. - :type ip_prefix_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: IpPrefix or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.IpPrefix - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.IpPrefix] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - ip_prefix_name=ip_prefix_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("IpPrefix", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/{ipPrefixName}" - } - - def _update_initial( - self, resource_group_name: str, ip_prefix_name: str, body: Union[_models.IpPrefixPatch, IO], **kwargs: Any - ) -> Optional[_models.IpPrefix]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.IpPrefix]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "IpPrefixPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - ip_prefix_name=ip_prefix_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("IpPrefix", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/{ipPrefixName}" - } - - @overload - def begin_update( - self, - resource_group_name: str, - ip_prefix_name: str, - body: _models.IpPrefixPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.IpPrefix]: - """Updates the IP Prefix. - - API to update certain properties of the IP Prefix resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_prefix_name: Name of the IP Prefix. Required. - :type ip_prefix_name: str - :param body: IP Prefix properties to update. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.IpPrefixPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either IpPrefix or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpPrefix] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - ip_prefix_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.IpPrefix]: - """Updates the IP Prefix. - - API to update certain properties of the IP Prefix resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_prefix_name: Name of the IP Prefix. Required. - :type ip_prefix_name: str - :param body: IP Prefix properties to update. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either IpPrefix or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpPrefix] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, resource_group_name: str, ip_prefix_name: str, body: Union[_models.IpPrefixPatch, IO], **kwargs: Any - ) -> LROPoller[_models.IpPrefix]: - """Updates the IP Prefix. - - API to update certain properties of the IP Prefix resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_prefix_name: Name of the IP Prefix. Required. - :type ip_prefix_name: str - :param body: IP Prefix properties to update. Is either a IpPrefixPatch type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.IpPrefixPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either IpPrefix or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpPrefix] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.IpPrefix] = 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, - ip_prefix_name=ip_prefix_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("IpPrefix", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/{ipPrefixName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, ip_prefix_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - ip_prefix_name=ip_prefix_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: 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) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - if cls: - return cls(pipeline_response, None, response_headers) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/{ipPrefixName}" - } - - @distributed_trace - def begin_delete(self, resource_group_name: str, ip_prefix_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes the IP Prefix. - - Implements IP Prefix DELETE method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param ip_prefix_name: Name of the IP Prefix. Required. - :type ip_prefix_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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_prefix_name=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, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/{ipPrefixName}" - } - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.IpPrefix"]: - """List IpPrefixes by resource group. - - Implements IpPrefixes list by resource group GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IpPrefix or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.IpPrefix] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.IpPrefixesListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("IpPrefixesListResult", 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.IpPrefix"]: - """List IpPrefixes by subscription. - - Implements IpPrefixes list by subscription GET method. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IpPrefix or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.IpPrefix] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.IpPrefixesListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("IpPrefixesListResult", 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_l2_isolation_domains_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_l2_isolation_domains_operations.py deleted file mode 100644 index d0a8ace42926..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_l2_isolation_domains_operations.py +++ /dev/null @@ -1,1692 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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 _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_request( - resource_group_name: str, l2_isolation_domain_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}", - ) # 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", max_length=90, min_length=1 - ), - "l2IsolationDomainName": _SERIALIZER.url("l2_isolation_domain_name", l2_isolation_domain_name, "str"), - } - - _url: str = _format_url_section(_url, **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_get_request( - resource_group_name: str, l2_isolation_domain_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}", - ) # 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", max_length=90, min_length=1 - ), - "l2IsolationDomainName": _SERIALIZER.url("l2_isolation_domain_name", l2_isolation_domain_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, l2_isolation_domain_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}", - ) # 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", max_length=90, min_length=1 - ), - "l2IsolationDomainName": _SERIALIZER.url("l2_isolation_domain_name", l2_isolation_domain_name, "str"), - } - - _url: str = _format_url_section(_url, **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_delete_request( - resource_group_name: str, l2_isolation_domain_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}", - ) # 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", max_length=90, min_length=1 - ), - "l2IsolationDomainName": _SERIALIZER.url("l2_isolation_domain_name", l2_isolation_domain_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_update_administrative_state_request( - resource_group_name: str, l2_isolation_domain_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/updateAdministrativeState", - ) # 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", max_length=90, min_length=1 - ), - "l2IsolationDomainName": _SERIALIZER.url("l2_isolation_domain_name", l2_isolation_domain_name, "str"), - } - - _url: str = _format_url_section(_url, **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_validate_configuration_request( - resource_group_name: str, l2_isolation_domain_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/validateConfiguration", - ) # 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", max_length=90, min_length=1 - ), - "l2IsolationDomainName": _SERIALIZER.url("l2_isolation_domain_name", l2_isolation_domain_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_commit_configuration_request( - resource_group_name: str, l2_isolation_domain_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/commitConfiguration", - ) # 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", max_length=90, min_length=1 - ), - "l2IsolationDomainName": _SERIALIZER.url("l2_isolation_domain_name", l2_isolation_domain_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_list_by_resource_group_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains", - ) # 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", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_subscription_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains" - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class L2IsolationDomainsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricMgmtClient`'s - :attr:`l2_isolation_domains` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - def _create_initial( - self, - resource_group_name: str, - l2_isolation_domain_name: str, - body: Union[_models.L2IsolationDomain, IO], - **kwargs: Any - ) -> _models.L2IsolationDomain: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.L2IsolationDomain] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "L2IsolationDomain") - - request = build_create_request( - resource_group_name=resource_group_name, - l2_isolation_domain_name=l2_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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("L2IsolationDomain", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("L2IsolationDomain", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}" - } - - @overload - def begin_create( - self, - resource_group_name: str, - l2_isolation_domain_name: str, - body: _models.L2IsolationDomain, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.L2IsolationDomain]: - """Create L2 Isolation Domain. - - Creates layer 2 network connectivity between compute nodes within a rack and across racks.The - configuration is applied on the devices only after the isolation domain is enabled. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. - :type l2_isolation_domain_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.L2IsolationDomain - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either L2IsolationDomain or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - l2_isolation_domain_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.L2IsolationDomain]: - """Create L2 Isolation Domain. - - Creates layer 2 network connectivity between compute nodes within a rack and across racks.The - configuration is applied on the devices only after the isolation domain is enabled. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. - :type l2_isolation_domain_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either L2IsolationDomain or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - l2_isolation_domain_name: str, - body: Union[_models.L2IsolationDomain, IO], - **kwargs: Any - ) -> LROPoller[_models.L2IsolationDomain]: - """Create L2 Isolation Domain. - - Creates layer 2 network connectivity between compute nodes within a rack and across racks.The - configuration is applied on the devices only after the isolation domain is enabled. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. - :type l2_isolation_domain_name: str - :param body: Request payload. Is either a L2IsolationDomain type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.L2IsolationDomain or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either L2IsolationDomain or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.L2IsolationDomain] = 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, - l2_isolation_domain_name=l2_isolation_domain_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("L2IsolationDomain", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}" - } - - @distributed_trace - def get(self, resource_group_name: str, l2_isolation_domain_name: str, **kwargs: Any) -> _models.L2IsolationDomain: - """Retrieves details of this L2 Isolation Domain. - - Implements L2 Isolation Domain GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. - :type l2_isolation_domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: L2IsolationDomain or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.L2IsolationDomain - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.L2IsolationDomain] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - l2_isolation_domain_name=l2_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("L2IsolationDomain", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}" - } - - def _update_initial( - self, - resource_group_name: str, - l2_isolation_domain_name: str, - body: Union[_models.L2IsolationDomainPatch, IO], - **kwargs: Any - ) -> Optional[_models.L2IsolationDomain]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.L2IsolationDomain]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "L2IsolationDomainPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - l2_isolation_domain_name=l2_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("L2IsolationDomain", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}" - } - - @overload - def begin_update( - self, - resource_group_name: str, - l2_isolation_domain_name: str, - body: _models.L2IsolationDomainPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.L2IsolationDomain]: - """Updates the L2 Isolation Domain. - - API to update certain properties of the L2 Isolation Domain resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. - :type l2_isolation_domain_name: str - :param body: API to update certain properties of the L2 Isolation Domain resource.. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.L2IsolationDomainPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either L2IsolationDomain or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - l2_isolation_domain_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.L2IsolationDomain]: - """Updates the L2 Isolation Domain. - - API to update certain properties of the L2 Isolation Domain resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. - :type l2_isolation_domain_name: str - :param body: API to update certain properties of the L2 Isolation Domain resource.. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either L2IsolationDomain or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - l2_isolation_domain_name: str, - body: Union[_models.L2IsolationDomainPatch, IO], - **kwargs: Any - ) -> LROPoller[_models.L2IsolationDomain]: - """Updates the L2 Isolation Domain. - - API to update certain properties of the L2 Isolation Domain resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. - :type l2_isolation_domain_name: str - :param body: API to update certain properties of the L2 Isolation Domain resource.. Is either a - L2IsolationDomainPatch type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.L2IsolationDomainPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either L2IsolationDomain or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.L2IsolationDomain] = 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, - l2_isolation_domain_name=l2_isolation_domain_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("L2IsolationDomain", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, l2_isolation_domain_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - l2_isolation_domain_name=l2_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}" - } - - @distributed_trace - def begin_delete(self, resource_group_name: str, l2_isolation_domain_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes the L2 Isolation Domain. - - Deletes layer 2 connectivity between compute nodes by managed by named L2 Isolation name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. - :type l2_isolation_domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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, - l2_isolation_domain_name=l2_isolation_domain_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}" - } - - def _update_administrative_state_initial( - self, - resource_group_name: str, - l2_isolation_domain_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForDeviceUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForDeviceUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_administrative_state_request( - resource_group_name=resource_group_name, - l2_isolation_domain_name=l2_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_administrative_state_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_administrative_state_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/updateAdministrativeState" - } - - @overload - def begin_update_administrative_state( - self, - resource_group_name: str, - l2_isolation_domain_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForDeviceUpdate]: - """Implements the operation to the underlying resources. - - Enables isolation domain across the fabric or on specified racks. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. - :type l2_isolation_domain_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForDeviceUpdate - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_administrative_state( - self, - resource_group_name: str, - l2_isolation_domain_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForDeviceUpdate]: - """Implements the operation to the underlying resources. - - Enables isolation domain across the fabric or on specified racks. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. - :type l2_isolation_domain_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForDeviceUpdate - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update_administrative_state( - self, - resource_group_name: str, - l2_isolation_domain_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForDeviceUpdate]: - """Implements the operation to the underlying resources. - - Enables isolation domain across the fabric or on specified racks. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. - :type l2_isolation_domain_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForDeviceUpdate - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForDeviceUpdate] = 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_administrative_state_initial( - resource_group_name=resource_group_name, - l2_isolation_domain_name=l2_isolation_domain_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_administrative_state.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/updateAdministrativeState" - } - - def _validate_configuration_initial( - self, resource_group_name: str, l2_isolation_domain_name: str, **kwargs: Any - ) -> _models.ValidateConfigurationResponse: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ValidateConfigurationResponse] = kwargs.pop("cls", None) - - request = build_validate_configuration_request( - resource_group_name=resource_group_name, - l2_isolation_domain_name=l2_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._validate_configuration_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _validate_configuration_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/validateConfiguration" - } - - @distributed_trace - def begin_validate_configuration( - self, resource_group_name: str, l2_isolation_domain_name: str, **kwargs: Any - ) -> LROPoller[_models.ValidateConfigurationResponse]: - """Validates the configuration of the resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. - :type l2_isolation_domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ValidateConfigurationResponse or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ValidateConfigurationResponse] = 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._validate_configuration_initial( - resource_group_name=resource_group_name, - l2_isolation_domain_name=l2_isolation_domain_name, - api_version=api_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("ValidateConfigurationResponse", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/validateConfiguration" - } - - def _commit_configuration_initial( - self, resource_group_name: str, l2_isolation_domain_name: str, **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - request = build_commit_configuration_request( - resource_group_name=resource_group_name, - l2_isolation_domain_name=l2_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._commit_configuration_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _commit_configuration_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/commitConfiguration" - } - - @distributed_trace - def begin_commit_configuration( - self, resource_group_name: str, l2_isolation_domain_name: str, **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Execute the commit on the resources. - - Commits the configuration of the given resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. - :type l2_isolation_domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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._commit_configuration_initial( - resource_group_name=resource_group_name, - l2_isolation_domain_name=l2_isolation_domain_name, - api_version=api_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("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_commit_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/commitConfiguration" - } - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.L2IsolationDomain"]: - """List L2IsolationDomains by resource group. - - Displays L2IsolationDomains list by resource group GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either L2IsolationDomain or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.L2IsolationDomainsListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("L2IsolationDomainsListResult", 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.L2IsolationDomain"]: - """List L2IsolationDomains by subscription. - - Displays L2IsolationDomains list by subscription GET method. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either L2IsolationDomain or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.L2IsolationDomainsListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("L2IsolationDomainsListResult", 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_l3_isolation_domains_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_l3_isolation_domains_operations.py deleted file mode 100644 index e4f0871b7a9c..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_l3_isolation_domains_operations.py +++ /dev/null @@ -1,1695 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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 _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_request( - resource_group_name: str, l3_isolation_domain_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}", - ) # 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", max_length=90, min_length=1 - ), - "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), - } - - _url: str = _format_url_section(_url, **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_get_request( - resource_group_name: str, l3_isolation_domain_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}", - ) # 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", max_length=90, min_length=1 - ), - "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, l3_isolation_domain_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}", - ) # 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", max_length=90, min_length=1 - ), - "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), - } - - _url: str = _format_url_section(_url, **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_delete_request( - resource_group_name: str, l3_isolation_domain_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}", - ) # 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", max_length=90, min_length=1 - ), - "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_list_by_resource_group_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains", - ) # 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", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_subscription_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains" - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_administrative_state_request( - resource_group_name: str, l3_isolation_domain_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/updateAdministrativeState", - ) # 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", max_length=90, min_length=1 - ), - "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), - } - - _url: str = _format_url_section(_url, **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_validate_configuration_request( - resource_group_name: str, l3_isolation_domain_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/validateConfiguration", - ) # 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", max_length=90, min_length=1 - ), - "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_commit_configuration_request( - resource_group_name: str, l3_isolation_domain_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/commitConfiguration", - ) # 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", max_length=90, min_length=1 - ), - "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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) - - -class L3IsolationDomainsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricMgmtClient`'s - :attr:`l3_isolation_domains` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - def _create_initial( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - body: Union[_models.L3IsolationDomain, IO], - **kwargs: Any - ) -> _models.L3IsolationDomain: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.L3IsolationDomain] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "L3IsolationDomain") - - request = build_create_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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("L3IsolationDomain", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("L3IsolationDomain", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}" - } - - @overload - def begin_create( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - body: _models.L3IsolationDomain, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.L3IsolationDomain]: - """Create L3 Isolation Domain. - - Create isolation domain resources for layer 3 connectivity between compute nodes and for - communication with external services .This configuration is applied on the devices only after - the creation of networks is completed and isolation domain is enabled. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.L3IsolationDomain - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either L3IsolationDomain or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.L3IsolationDomain]: - """Create L3 Isolation Domain. - - Create isolation domain resources for layer 3 connectivity between compute nodes and for - communication with external services .This configuration is applied on the devices only after - the creation of networks is completed and isolation domain is enabled. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either L3IsolationDomain or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - body: Union[_models.L3IsolationDomain, IO], - **kwargs: Any - ) -> LROPoller[_models.L3IsolationDomain]: - """Create L3 Isolation Domain. - - Create isolation domain resources for layer 3 connectivity between compute nodes and for - communication with external services .This configuration is applied on the devices only after - the creation of networks is completed and isolation domain is enabled. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param body: Request payload. Is either a L3IsolationDomain type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.L3IsolationDomain or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either L3IsolationDomain or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.L3IsolationDomain] = 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, - l3_isolation_domain_name=l3_isolation_domain_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("L3IsolationDomain", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}" - } - - @distributed_trace - def get(self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any) -> _models.L3IsolationDomain: - """Gets a L3 Isolation Domain. - - Retrieves details of this L3 Isolation Domain. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: L3IsolationDomain or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.L3IsolationDomain - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.L3IsolationDomain] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("L3IsolationDomain", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}" - } - - def _update_initial( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - body: Union[_models.L3IsolationDomainPatch, IO], - **kwargs: Any - ) -> Optional[_models.L3IsolationDomain]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.L3IsolationDomain]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "L3IsolationDomainPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("L3IsolationDomain", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}" - } - - @overload - def begin_update( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - body: _models.L3IsolationDomainPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.L3IsolationDomain]: - """Updates a L3 Isolation Domain. - - API to update certain properties of the L3 Isolation Domain resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param body: API to update certain properties of the L3 Isolation Domain resource. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.L3IsolationDomainPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either L3IsolationDomain or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.L3IsolationDomain]: - """Updates a L3 Isolation Domain. - - API to update certain properties of the L3 Isolation Domain resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param body: API to update certain properties of the L3 Isolation Domain resource. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either L3IsolationDomain or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - body: Union[_models.L3IsolationDomainPatch, IO], - **kwargs: Any - ) -> LROPoller[_models.L3IsolationDomain]: - """Updates a L3 Isolation Domain. - - API to update certain properties of the L3 Isolation Domain resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param body: API to update certain properties of the L3 Isolation Domain resource. Is either a - L3IsolationDomainPatch type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.L3IsolationDomainPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either L3IsolationDomain or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.L3IsolationDomain] = 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, - l3_isolation_domain_name=l3_isolation_domain_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("L3IsolationDomain", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}" - } - - @distributed_trace - def begin_delete(self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a L3 Isolation Domain. - - Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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, - l3_isolation_domain_name=l3_isolation_domain_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}" - } - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.L3IsolationDomain"]: - """List L3IsolationDomains by resource group. - - Displays L3IsolationDomains list by resource group GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either L3IsolationDomain or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.L3IsolationDomainsListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("L3IsolationDomainsListResult", 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.L3IsolationDomain"]: - """List L3IsolationDomains by subscription. - - Displays L3IsolationDomains list by subscription GET method. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either L3IsolationDomain or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.L3IsolationDomainsListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("L3IsolationDomainsListResult", 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains" - } - - def _update_administrative_state_initial( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForDeviceUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForDeviceUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_administrative_state_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_administrative_state_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_administrative_state_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/updateAdministrativeState" - } - - @overload - def begin_update_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForDeviceUpdate]: - """executes enable operation to the underlying resources. - - Enables racks for this Isolation Domain. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForDeviceUpdate - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForDeviceUpdate]: - """executes enable operation to the underlying resources. - - Enables racks for this Isolation Domain. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForDeviceUpdate - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update_administrative_state( - self, - resource_group_name: str, - l3_isolation_domain_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForDeviceUpdate]: - """executes enable operation to the underlying resources. - - Enables racks for this Isolation Domain. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForDeviceUpdate - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForDeviceUpdate] = 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_administrative_state_initial( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_administrative_state.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/updateAdministrativeState" - } - - def _validate_configuration_initial( - self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any - ) -> _models.ValidateConfigurationResponse: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ValidateConfigurationResponse] = kwargs.pop("cls", None) - - request = build_validate_configuration_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._validate_configuration_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _validate_configuration_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/validateConfiguration" - } - - @distributed_trace - def begin_validate_configuration( - self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any - ) -> LROPoller[_models.ValidateConfigurationResponse]: - """Validates the configuration of the resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ValidateConfigurationResponse or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ValidateConfigurationResponse] = 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._validate_configuration_initial( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - api_version=api_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("ValidateConfigurationResponse", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/validateConfiguration" - } - - def _commit_configuration_initial( - self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - request = build_commit_configuration_request( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._commit_configuration_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _commit_configuration_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/commitConfiguration" - } - - @distributed_trace - def begin_commit_configuration( - self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Execute the commit on the resources. - - Commits the configuration of the given resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. - :type l3_isolation_domain_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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._commit_configuration_initial( - resource_group_name=resource_group_name, - l3_isolation_domain_name=l3_isolation_domain_name, - api_version=api_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("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_commit_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/commitConfiguration" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_neighbor_groups_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_neighbor_groups_operations.py deleted file mode 100644 index cf0d66ab43d0..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_neighbor_groups_operations.py +++ /dev/null @@ -1,1069 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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 _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_request( - resource_group_name: str, neighbor_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-06-15")) - 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.ManagedNetworkFabric/neighborGroups/{neighborGroupName}", - ) # 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", max_length=90, min_length=1 - ), - "neighborGroupName": _SERIALIZER.url("neighbor_group_name", neighbor_group_name, "str"), - } - - _url: str = _format_url_section(_url, **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_get_request( - resource_group_name: str, neighbor_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups/{neighborGroupName}", - ) # 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", max_length=90, min_length=1 - ), - "neighborGroupName": _SERIALIZER.url("neighbor_group_name", neighbor_group_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, neighbor_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-06-15")) - 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.ManagedNetworkFabric/neighborGroups/{neighborGroupName}", - ) # 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", max_length=90, min_length=1 - ), - "neighborGroupName": _SERIALIZER.url("neighbor_group_name", neighbor_group_name, "str"), - } - - _url: str = _format_url_section(_url, **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_delete_request( - resource_group_name: str, neighbor_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups/{neighborGroupName}", - ) # 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", max_length=90, min_length=1 - ), - "neighborGroupName": _SERIALIZER.url("neighbor_group_name", neighbor_group_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_list_by_resource_group_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups", - ) # 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", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_subscription_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/neighborGroups" - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class NeighborGroupsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricMgmtClient`'s - :attr:`neighbor_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") - - def _create_initial( - self, resource_group_name: str, neighbor_group_name: str, body: Union[_models.NeighborGroup, IO], **kwargs: Any - ) -> _models.NeighborGroup: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NeighborGroup] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NeighborGroup") - - request = build_create_request( - resource_group_name=resource_group_name, - neighbor_group_name=neighbor_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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("NeighborGroup", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("NeighborGroup", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups/{neighborGroupName}" - } - - @overload - def begin_create( - self, - resource_group_name: str, - neighbor_group_name: str, - body: _models.NeighborGroup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NeighborGroup]: - """Creates the Neighbor Group. - - Implements the Neighbor Group PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param neighbor_group_name: Name of the Neighbor Group. Required. - :type neighbor_group_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NeighborGroup - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NeighborGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NeighborGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - neighbor_group_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NeighborGroup]: - """Creates the Neighbor Group. - - Implements the Neighbor Group PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param neighbor_group_name: Name of the Neighbor Group. Required. - :type neighbor_group_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NeighborGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NeighborGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, resource_group_name: str, neighbor_group_name: str, body: Union[_models.NeighborGroup, IO], **kwargs: Any - ) -> LROPoller[_models.NeighborGroup]: - """Creates the Neighbor Group. - - Implements the Neighbor Group PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param neighbor_group_name: Name of the Neighbor Group. Required. - :type neighbor_group_name: str - :param body: Request payload. Is either a NeighborGroup type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NeighborGroup or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NeighborGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NeighborGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NeighborGroup] = 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, - neighbor_group_name=neighbor_group_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NeighborGroup", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups/{neighborGroupName}" - } - - @distributed_trace - def get(self, resource_group_name: str, neighbor_group_name: str, **kwargs: Any) -> _models.NeighborGroup: - """Retrieves details of neighbor Group using GET method. - - Gets the Neighbor Group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param neighbor_group_name: Name of the Neighbor Group. Required. - :type neighbor_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NeighborGroup or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.NeighborGroup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NeighborGroup] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - neighbor_group_name=neighbor_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("NeighborGroup", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups/{neighborGroupName}" - } - - def _update_initial( - self, - resource_group_name: str, - neighbor_group_name: str, - body: Union[_models.NeighborGroupPatch, IO], - **kwargs: Any - ) -> Optional[_models.NeighborGroup]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.NeighborGroup]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NeighborGroupPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - neighbor_group_name=neighbor_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("NeighborGroup", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups/{neighborGroupName}" - } - - @overload - def begin_update( - self, - resource_group_name: str, - neighbor_group_name: str, - body: _models.NeighborGroupPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NeighborGroup]: - """API to update certain properties of the Neighbor Group Resources. - - Updates the Neighbor Group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param neighbor_group_name: Name of the Neighbor Group. Required. - :type neighbor_group_name: str - :param body: Neighbor Group properties to update. Only annotations are supported. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NeighborGroupPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NeighborGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NeighborGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - neighbor_group_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NeighborGroup]: - """API to update certain properties of the Neighbor Group Resources. - - Updates the Neighbor Group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param neighbor_group_name: Name of the Neighbor Group. Required. - :type neighbor_group_name: str - :param body: Neighbor Group properties to update. Only annotations are supported. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NeighborGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NeighborGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - neighbor_group_name: str, - body: Union[_models.NeighborGroupPatch, IO], - **kwargs: Any - ) -> LROPoller[_models.NeighborGroup]: - """API to update certain properties of the Neighbor Group Resources. - - Updates the Neighbor Group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param neighbor_group_name: Name of the Neighbor Group. Required. - :type neighbor_group_name: str - :param body: Neighbor Group properties to update. Only annotations are supported. Is either a - NeighborGroupPatch type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NeighborGroupPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NeighborGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NeighborGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NeighborGroup] = 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, - neighbor_group_name=neighbor_group_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NeighborGroup", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups/{neighborGroupName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, neighbor_group_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - neighbor_group_name=neighbor_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups/{neighborGroupName}" - } - - @distributed_trace - def begin_delete(self, resource_group_name: str, neighbor_group_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a Neighbor Group. - - Implements Neighbor Group DELETE method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param neighbor_group_name: Name of the Neighbor Group. Required. - :type neighbor_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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, - neighbor_group_name=neighbor_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, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups/{neighborGroupName}" - } - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.NeighborGroup"]: - """List Neighbor Groups by resource group. - - Displays NeighborGroups list by resource group GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NeighborGroup or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NeighborGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NeighborGroupsListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("NeighborGroupsListResult", 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.NeighborGroup"]: - """List Neighbor Groups by subscription. - - Displays NeighborGroups list by subscription GET method. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NeighborGroup or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NeighborGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NeighborGroupsListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("NeighborGroupsListResult", 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/neighborGroups" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_device_skus_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_device_skus_operations.py deleted file mode 100644 index 9d35c32dab2b..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_device_skus_operations.py +++ /dev/null @@ -1,256 +0,0 @@ -# pylint: disable=too-many-lines -# 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, Callable, Dict, Iterable, Optional, TypeVar -import urllib.parse - -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.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 .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_get_request(network_device_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkDeviceSkus/{networkDeviceSkuName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "networkDeviceSkuName": _SERIALIZER.url("network_device_sku_name", network_device_sku_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_subscription_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkDeviceSkus" - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class NetworkDeviceSkusOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricMgmtClient`'s - :attr:`network_device_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") - - @distributed_trace - def get(self, network_device_sku_name: str, **kwargs: Any) -> _models.NetworkDeviceSku: - """Gets a Network Device Sku. - - Get a Network Device SKU details. - - :param network_device_sku_name: Name of the Network Device SKU. Required. - :type network_device_sku_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkDeviceSku or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkDeviceSku - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkDeviceSku] = kwargs.pop("cls", None) - - request = build_get_request( - network_device_sku_name=network_device_sku_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("NetworkDeviceSku", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkDeviceSkus/{networkDeviceSkuName}" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.NetworkDeviceSku"]: - """List Network Device SKUs by subscription. - - List Network Device SKUs for the given subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkDeviceSku or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkDeviceSku] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkDeviceSkusListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkDeviceSkusListResult", 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkDeviceSkus" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_devices_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_devices_operations.py deleted file mode 100644 index 3b02b693a5aa..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_devices_operations.py +++ /dev/null @@ -1,2053 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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 _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_request( - resource_group_name: str, network_device_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/networkDevices/{networkDeviceName}", - ) # 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", max_length=90, min_length=1 - ), - "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_name, "str"), - } - - _url: str = _format_url_section(_url, **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_get_request( - resource_group_name: str, network_device_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}", - ) # 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", max_length=90, min_length=1 - ), - "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, network_device_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/networkDevices/{networkDeviceName}", - ) # 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", max_length=90, min_length=1 - ), - "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_name, "str"), - } - - _url: str = _format_url_section(_url, **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_delete_request( - resource_group_name: str, network_device_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}", - ) # 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", max_length=90, min_length=1 - ), - "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_list_by_resource_group_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices", - ) # 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", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_subscription_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkDevices" - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_reboot_request( - resource_group_name: str, network_device_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/networkDevices/{networkDeviceName}/reboot", - ) # 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", max_length=90, min_length=1 - ), - "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_name, "str"), - } - - _url: str = _format_url_section(_url, **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_refresh_configuration_request( - resource_group_name: str, network_device_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/refreshConfiguration", - ) # 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", max_length=90, min_length=1 - ), - "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_update_administrative_state_request( - resource_group_name: str, network_device_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/networkDevices/{networkDeviceName}/updateAdministrativeState", - ) # 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", max_length=90, min_length=1 - ), - "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_name, "str"), - } - - _url: str = _format_url_section(_url, **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_upgrade_request( - resource_group_name: str, network_device_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/networkDevices/{networkDeviceName}/upgrade", - ) # 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", max_length=90, min_length=1 - ), - "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_name, "str"), - } - - _url: str = _format_url_section(_url, **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) - - -class NetworkDevicesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricMgmtClient`'s - :attr:`network_devices` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - def _create_initial( - self, resource_group_name: str, network_device_name: str, body: Union[_models.NetworkDevice, IO], **kwargs: Any - ) -> _models.NetworkDevice: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkDevice] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkDevice") - - request = build_create_request( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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("NetworkDevice", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("NetworkDevice", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}" - } - - @overload - def begin_create( - self, - resource_group_name: str, - network_device_name: str, - body: _models.NetworkDevice, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkDevice]: - """Create Network Device. - - Create a Network Device resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkDevice - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkDevice or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - network_device_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkDevice]: - """Create Network Device. - - Create a Network Device resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkDevice or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, resource_group_name: str, network_device_name: str, body: Union[_models.NetworkDevice, IO], **kwargs: Any - ) -> LROPoller[_models.NetworkDevice]: - """Create Network Device. - - Create a Network Device resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param body: Request payload. Is either a NetworkDevice type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkDevice or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkDevice or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkDevice] = 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_device_name=network_device_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkDevice", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}" - } - - @distributed_trace - def get(self, resource_group_name: str, network_device_name: str, **kwargs: Any) -> _models.NetworkDevice: - """Gets a Network Device. - - Gets the Network Device resource details. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkDevice or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkDevice - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkDevice] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("NetworkDevice", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}" - } - - def _update_initial( - self, - resource_group_name: str, - network_device_name: str, - body: Union[_models.NetworkDevicePatchParameters, IO], - **kwargs: Any - ) -> Optional[_models.NetworkDevice]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.NetworkDevice]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkDevicePatchParameters") - - request = build_update_request( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("NetworkDevice", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}" - } - - @overload - def begin_update( - self, - resource_group_name: str, - network_device_name: str, - body: _models.NetworkDevicePatchParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkDevice]: - """Updates a Network Device. - - Update certain properties of the Network Device resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param body: Network Device properties to update. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkDevicePatchParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkDevice or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - network_device_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkDevice]: - """Updates a Network Device. - - Update certain properties of the Network Device resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param body: Network Device properties to update. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkDevice or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - network_device_name: str, - body: Union[_models.NetworkDevicePatchParameters, IO], - **kwargs: Any - ) -> LROPoller[_models.NetworkDevice]: - """Updates a Network Device. - - Update certain properties of the Network Device resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param body: Network Device properties to update. Is either a NetworkDevicePatchParameters type - or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkDevicePatchParameters or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkDevice or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkDevice] = 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, - network_device_name=network_device_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkDevice", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, network_device_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}" - } - - @distributed_trace - def begin_delete(self, resource_group_name: str, network_device_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a Network Device. - - Delete the Network Device resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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_device_name=network_device_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}" - } - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.NetworkDevice"]: - """List NetworkDevices by resource group. - - List all the Network Device resources in a given resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkDevice or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkDevicesListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkDevicesListResult", 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.NetworkDevice"]: - """List NetworkDevices by subscription. - - List all the Network Device resources in a given subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkDevice or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkDevicesListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkDevicesListResult", 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkDevices" - } - - def _reboot_initial( - self, - resource_group_name: str, - network_device_name: str, - body: Union[_models.RebootProperties, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "RebootProperties") - - request = build_reboot_request( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._reboot_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _reboot_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/reboot" - } - - @overload - def begin_reboot( - self, - resource_group_name: str, - network_device_name: str, - body: _models.RebootProperties, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Reboot the Network Device. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.RebootProperties - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_reboot( - self, - resource_group_name: str, - network_device_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Reboot the Network Device. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_reboot( - self, - resource_group_name: str, - network_device_name: str, - body: Union[_models.RebootProperties, IO], - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Reboot the Network Device. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param body: Request payload. Is either a RebootProperties type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.RebootProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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._reboot_initial( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_reboot.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/reboot" - } - - def _refresh_configuration_initial( - self, resource_group_name: str, network_device_name: str, **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - request = build_refresh_configuration_request( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._refresh_configuration_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _refresh_configuration_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/refreshConfiguration" - } - - @distributed_trace - def begin_refresh_configuration( - self, resource_group_name: str, network_device_name: str, **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Refreshes the configuration the Network Device. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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._refresh_configuration_initial( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - api_version=api_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("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_refresh_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/refreshConfiguration" - } - - def _update_administrative_state_initial( - self, - resource_group_name: str, - network_device_name: str, - body: Union[_models.UpdateDeviceAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateDeviceAdministrativeState") - - request = build_update_administrative_state_request( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_administrative_state_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_administrative_state_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/updateAdministrativeState" - } - - @overload - def begin_update_administrative_state( - self, - resource_group_name: str, - network_device_name: str, - body: _models.UpdateDeviceAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Updates the Administrative state of the Network Device. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateDeviceAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_administrative_state( - self, - resource_group_name: str, - network_device_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Updates the Administrative state of the Network Device. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update_administrative_state( - self, - resource_group_name: str, - network_device_name: str, - body: Union[_models.UpdateDeviceAdministrativeState, IO], - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Updates the Administrative state of the Network Device. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param body: Request payload. Is either a UpdateDeviceAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateDeviceAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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_administrative_state_initial( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_administrative_state.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/updateAdministrativeState" - } - - def _upgrade_initial( - self, resource_group_name: str, network_device_name: str, body: Union[_models.UpdateVersion, IO], **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateVersion") - - request = build_upgrade_request( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._upgrade_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _upgrade_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/upgrade" - } - - @overload - def begin_upgrade( - self, - resource_group_name: str, - network_device_name: str, - body: _models.UpdateVersion, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Upgrades the version of the Network Device. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_upgrade( - self, - resource_group_name: str, - network_device_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Upgrades the version of the Network Device. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_upgrade( - self, resource_group_name: str, network_device_name: str, body: Union[_models.UpdateVersion, IO], **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Upgrades the version of the Network Device. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param body: Request payload. Is either a UpdateVersion type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateVersion or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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._upgrade_initial( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_upgrade.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/upgrade" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_fabric_controllers_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_fabric_controllers_operations.py deleted file mode 100644 index 9dc83e2ddb5c..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_fabric_controllers_operations.py +++ /dev/null @@ -1,1106 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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 _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_request( - resource_group_name: str, network_fabric_controller_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}", - ) # 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", max_length=90, min_length=1 - ), - "networkFabricControllerName": _SERIALIZER.url( - "network_fabric_controller_name", network_fabric_controller_name, "str" - ), - } - - _url: str = _format_url_section(_url, **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_get_request( - resource_group_name: str, network_fabric_controller_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}", - ) # 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", max_length=90, min_length=1 - ), - "networkFabricControllerName": _SERIALIZER.url( - "network_fabric_controller_name", network_fabric_controller_name, "str" - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, network_fabric_controller_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}", - ) # 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", max_length=90, min_length=1 - ), - "networkFabricControllerName": _SERIALIZER.url( - "network_fabric_controller_name", network_fabric_controller_name, "str" - ), - } - - _url: str = _format_url_section(_url, **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_delete_request( - resource_group_name: str, network_fabric_controller_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}", - ) # 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", max_length=90, min_length=1 - ), - "networkFabricControllerName": _SERIALIZER.url( - "network_fabric_controller_name", network_fabric_controller_name, "str" - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_list_by_resource_group_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers", - ) # 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", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_subscription_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class NetworkFabricControllersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricMgmtClient`'s - :attr:`network_fabric_controllers` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - def _create_initial( - self, - resource_group_name: str, - network_fabric_controller_name: str, - body: Union[_models.NetworkFabricController, IO], - **kwargs: Any - ) -> _models.NetworkFabricController: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkFabricController] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkFabricController") - - request = build_create_request( - resource_group_name=resource_group_name, - network_fabric_controller_name=network_fabric_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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("NetworkFabricController", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("NetworkFabricController", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}" - } - - @overload - def begin_create( - self, - resource_group_name: str, - network_fabric_controller_name: str, - body: _models.NetworkFabricController, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkFabricController]: - """Create Network fabric controller. - - Creates a Network Fabric Controller. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. - :type network_fabric_controller_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabricController - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkFabricController or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - network_fabric_controller_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkFabricController]: - """Create Network fabric controller. - - Creates a Network Fabric Controller. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. - :type network_fabric_controller_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkFabricController or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - network_fabric_controller_name: str, - body: Union[_models.NetworkFabricController, IO], - **kwargs: Any - ) -> LROPoller[_models.NetworkFabricController]: - """Create Network fabric controller. - - Creates a Network Fabric Controller. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. - :type network_fabric_controller_name: str - :param body: Request payload. Is either a NetworkFabricController type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabricController or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkFabricController or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkFabricController] = 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_fabric_controller_name=network_fabric_controller_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkFabricController", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}" - } - - @distributed_trace - def get( - self, resource_group_name: str, network_fabric_controller_name: str, **kwargs: Any - ) -> _models.NetworkFabricController: - """Gets a Network Fabric Controller. - - Shows the provisioning status of Network Fabric Controller. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. - :type network_fabric_controller_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkFabricController or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkFabricController - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkFabricController] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - network_fabric_controller_name=network_fabric_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("NetworkFabricController", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}" - } - - def _update_initial( - self, - resource_group_name: str, - network_fabric_controller_name: str, - body: Union[_models.NetworkFabricControllerPatch, IO], - **kwargs: Any - ) -> Optional[_models.NetworkFabricController]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.NetworkFabricController]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkFabricControllerPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - network_fabric_controller_name=network_fabric_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("NetworkFabricController", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}" - } - - @overload - def begin_update( - self, - resource_group_name: str, - network_fabric_controller_name: str, - body: _models.NetworkFabricControllerPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkFabricController]: - """Updates a Network Fabric Controller. - - Updates are currently not supported for the Network Fabric Controller resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. - :type network_fabric_controller_name: str - :param body: Network Fabric Controller properties to update. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabricControllerPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkFabricController or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - network_fabric_controller_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkFabricController]: - """Updates a Network Fabric Controller. - - Updates are currently not supported for the Network Fabric Controller resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. - :type network_fabric_controller_name: str - :param body: Network Fabric Controller properties to update. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkFabricController or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - network_fabric_controller_name: str, - body: Union[_models.NetworkFabricControllerPatch, IO], - **kwargs: Any - ) -> LROPoller[_models.NetworkFabricController]: - """Updates a Network Fabric Controller. - - Updates are currently not supported for the Network Fabric Controller resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. - :type network_fabric_controller_name: str - :param body: Network Fabric Controller properties to update. Is either a - NetworkFabricControllerPatch type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabricControllerPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkFabricController or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkFabricController] = 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, - network_fabric_controller_name=network_fabric_controller_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkFabricController", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, network_fabric_controller_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - network_fabric_controller_name=network_fabric_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: 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) - - 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) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}" - } - - @distributed_trace - def begin_delete( - self, resource_group_name: str, network_fabric_controller_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a Network Fabric Controller. - - Deletes the Network Fabric Controller resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. - :type network_fabric_controller_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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_fabric_controller_name=network_fabric_controller_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}" - } - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.NetworkFabricController"]: - """List NetworkFabricControllers by resource group. - - Lists all the NetworkFabricControllers thats available in the resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkFabricController or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkFabricControllersListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkFabricControllersListResult", 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.NetworkFabricController"]: - """List NetworkFabricControllers by subscription. - - Lists all the NetworkFabricControllers by subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkFabricController or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkFabricControllersListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkFabricControllersListResult", 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_fabric_skus_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_fabric_skus_operations.py deleted file mode 100644 index f9e7f7608457..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_fabric_skus_operations.py +++ /dev/null @@ -1,256 +0,0 @@ -# pylint: disable=too-many-lines -# 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, Callable, Dict, Iterable, Optional, TypeVar -import urllib.parse - -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.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 .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_get_request(network_fabric_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkFabricSkus/{networkFabricSkuName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "networkFabricSkuName": _SERIALIZER.url("network_fabric_sku_name", network_fabric_sku_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_subscription_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkFabricSkus" - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class NetworkFabricSkusOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricMgmtClient`'s - :attr:`network_fabric_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") - - @distributed_trace - def get(self, network_fabric_sku_name: str, **kwargs: Any) -> _models.NetworkFabricSku: - """Gets a Network Fabric Sku. - - Implements Network Fabric SKU GET method. - - :param network_fabric_sku_name: Name of the Network Fabric SKU. Required. - :type network_fabric_sku_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkFabricSku or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkFabricSku - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkFabricSku] = kwargs.pop("cls", None) - - request = build_get_request( - network_fabric_sku_name=network_fabric_sku_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("NetworkFabricSku", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkFabricSkus/{networkFabricSkuName}" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.NetworkFabricSku"]: - """List Network Fabric SKUs by subscription. - - Implements Network Fabric SKUs list by subscription GET method. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkFabricSku or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkFabricSku] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkFabricSkusListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkFabricSkusListResult", 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkFabricSkus" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_fabrics_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_fabrics_operations.py deleted file mode 100644 index dcb69c5aafc3..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_fabrics_operations.py +++ /dev/null @@ -1,3011 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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 _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_request( - resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/networkFabrics/{networkFabricName}", - ) # 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", max_length=90, min_length=1 - ), - "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_name, "str"), - } - - _url: str = _format_url_section(_url, **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_get_request( - resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}", - ) # 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", max_length=90, min_length=1 - ), - "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/networkFabrics/{networkFabricName}", - ) # 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", max_length=90, min_length=1 - ), - "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_name, "str"), - } - - _url: str = _format_url_section(_url, **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_delete_request( - resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}", - ) # 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", max_length=90, min_length=1 - ), - "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_list_by_resource_group_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics", - ) # 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", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_subscription_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkFabrics" - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_provision_request( - resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/provision", - ) # 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", max_length=90, min_length=1 - ), - "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_deprovision_request( - resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/deprovision", - ) # 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", max_length=90, min_length=1 - ), - "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_upgrade_request( - resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/networkFabrics/{networkFabricName}/upgrade", - ) # 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", max_length=90, min_length=1 - ), - "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_name, "str"), - } - - _url: str = _format_url_section(_url, **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_refresh_configuration_request( - resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/refreshConfiguration", - ) # 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", max_length=90, min_length=1 - ), - "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_update_workload_management_bfd_configuration_request( - resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/networkFabrics/{networkFabricName}/updateWorkloadManagementBfdConfiguration", - ) # 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", max_length=90, min_length=1 - ), - "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_name, "str"), - } - - _url: str = _format_url_section(_url, **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_update_infra_management_bfd_configuration_request( - resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/networkFabrics/{networkFabricName}/updateInfraManagementBfdConfiguration", - ) # 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", max_length=90, min_length=1 - ), - "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_name, "str"), - } - - _url: str = _format_url_section(_url, **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_validate_configuration_request( - resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/networkFabrics/{networkFabricName}/validateConfiguration", - ) # 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", max_length=90, min_length=1 - ), - "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_name, "str"), - } - - _url: str = _format_url_section(_url, **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_get_topology_request( - resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/getTopology", - ) # 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", max_length=90, min_length=1 - ), - "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_commit_configuration_request( - resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/commitConfiguration", - ) # 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", max_length=90, min_length=1 - ), - "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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) - - -class NetworkFabricsOperations: # pylint: disable=too-many-public-methods - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricMgmtClient`'s - :attr:`network_fabrics` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - def _create_initial( - self, resource_group_name: str, network_fabric_name: str, body: Union[_models.NetworkFabric, IO], **kwargs: Any - ) -> _models.NetworkFabric: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkFabric] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkFabric") - - request = build_create_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("NetworkFabric", pipeline_response) - - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = self._deserialize("NetworkFabric", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}" - } - - @overload - def begin_create( - self, - resource_group_name: str, - network_fabric_name: str, - body: _models.NetworkFabric, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkFabric]: - """Create Network Fabric. - - Create Network Fabric resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabric - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkFabric or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabric] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - network_fabric_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkFabric]: - """Create Network Fabric. - - Create Network Fabric resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkFabric or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabric] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, resource_group_name: str, network_fabric_name: str, body: Union[_models.NetworkFabric, IO], **kwargs: Any - ) -> LROPoller[_models.NetworkFabric]: - """Create Network Fabric. - - Create Network Fabric resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Request payload. Is either a NetworkFabric type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabric or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkFabric or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabric] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkFabric] = 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_fabric_name=network_fabric_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkFabric", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}" - } - - @distributed_trace - def get(self, resource_group_name: str, network_fabric_name: str, **kwargs: Any) -> _models.NetworkFabric: - """Gets a Network Fabric. - - Get Network Fabric resource details. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkFabric or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkFabric - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkFabric] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("NetworkFabric", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}" - } - - def _update_initial( - self, - resource_group_name: str, - network_fabric_name: str, - body: Union[_models.NetworkFabricPatch, IO], - **kwargs: Any - ) -> Optional[_models.NetworkFabric]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.NetworkFabric]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkFabricPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("NetworkFabric", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}" - } - - @overload - def begin_update( - self, - resource_group_name: str, - network_fabric_name: str, - body: _models.NetworkFabricPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkFabric]: - """Updates a Network Fabric. - - Update certain properties of the Network Fabric resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Network Fabric properties to update. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabricPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkFabric or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabric] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - network_fabric_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkFabric]: - """Updates a Network Fabric. - - Update certain properties of the Network Fabric resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Network Fabric properties to update. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkFabric or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabric] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - network_fabric_name: str, - body: Union[_models.NetworkFabricPatch, IO], - **kwargs: Any - ) -> LROPoller[_models.NetworkFabric]: - """Updates a Network Fabric. - - Update certain properties of the Network Fabric resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Network Fabric properties to update. Is either a NetworkFabricPatch type or a IO - type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabricPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkFabric or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabric] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkFabric] = 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, - network_fabric_name=network_fabric_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkFabric", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, network_fabric_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: 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) - - 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) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}" - } - - @distributed_trace - def begin_delete(self, resource_group_name: str, network_fabric_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a Network Fabric. - - Delete Network Fabric resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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_fabric_name=network_fabric_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}" - } - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.NetworkFabric"]: - """List Network Fabrics by resource group. - - List all the Network Fabric resources in the given resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkFabric or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkFabric] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkFabricsListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkFabricsListResult", 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.NetworkFabric"]: - """List Network Fabrics by subscription. - - List all the Network Fabric resources in the given subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkFabric or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkFabric] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkFabricsListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkFabricsListResult", 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkFabrics" - } - - def _provision_initial( - self, resource_group_name: str, network_fabric_name: str, **kwargs: Any - ) -> _models.CommonPostActionResponseForDeviceUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForDeviceUpdate] = kwargs.pop("cls", None) - - request = build_provision_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._provision_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _provision_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/provision" - } - - @distributed_trace - def begin_provision( - self, resource_group_name: str, network_fabric_name: str, **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForDeviceUpdate]: - """Implements the operation to the underlying resources. - - Provisions the underlying resources in the given Network Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForDeviceUpdate - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForDeviceUpdate] = 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._provision_initial( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - api_version=api_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("CommonPostActionResponseForDeviceUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_provision.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/provision" - } - - def _deprovision_initial( - self, resource_group_name: str, network_fabric_name: str, **kwargs: Any - ) -> _models.CommonPostActionResponseForDeviceUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForDeviceUpdate] = kwargs.pop("cls", None) - - request = build_deprovision_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._deprovision_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _deprovision_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/deprovision" - } - - @distributed_trace - def begin_deprovision( - self, resource_group_name: str, network_fabric_name: str, **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForDeviceUpdate]: - """Implements the operation to the underlying resources. - - Deprovisions the underlying resources in the given Network Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForDeviceUpdate - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForDeviceUpdate] = 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._deprovision_initial( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - api_version=api_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("CommonPostActionResponseForDeviceUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_deprovision.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/deprovision" - } - - def _upgrade_initial( - self, resource_group_name: str, network_fabric_name: str, body: Union[_models.UpdateVersion, IO], **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateVersion") - - request = build_upgrade_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._upgrade_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _upgrade_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/upgrade" - } - - @overload - def begin_upgrade( - self, - resource_group_name: str, - network_fabric_name: str, - body: _models.UpdateVersion, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Upgrades the version of the underlying resources in the given Network Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Network Fabric properties to update. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_upgrade( - self, - resource_group_name: str, - network_fabric_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Upgrades the version of the underlying resources in the given Network Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Network Fabric properties to update. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_upgrade( - self, resource_group_name: str, network_fabric_name: str, body: Union[_models.UpdateVersion, IO], **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Upgrades the version of the underlying resources in the given Network Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Network Fabric properties to update. Is either a UpdateVersion type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateVersion or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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._upgrade_initial( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_upgrade.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/upgrade" - } - - def _refresh_configuration_initial( - self, resource_group_name: str, network_fabric_name: str, **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - request = build_refresh_configuration_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._refresh_configuration_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _refresh_configuration_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/refreshConfiguration" - } - - @distributed_trace - def begin_refresh_configuration( - self, resource_group_name: str, network_fabric_name: str, **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Refreshes the configuration of the underlying resources in the given Network Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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._refresh_configuration_initial( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - api_version=api_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("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_refresh_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/refreshConfiguration" - } - - def _update_workload_management_bfd_configuration_initial( - self, - resource_group_name: str, - network_fabric_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_workload_management_bfd_configuration_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_workload_management_bfd_configuration_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_workload_management_bfd_configuration_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/updateWorkloadManagementBfdConfiguration" - } - - @overload - def begin_update_workload_management_bfd_configuration( - self, - resource_group_name: str, - network_fabric_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Updates the Workload Management BFD Configuration of the underlying resources in the given - Network Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_workload_management_bfd_configuration( - self, - resource_group_name: str, - network_fabric_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Updates the Workload Management BFD Configuration of the underlying resources in the given - Network Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update_workload_management_bfd_configuration( - self, - resource_group_name: str, - network_fabric_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Updates the Workload Management BFD Configuration of the underlying resources in the given - Network Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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_workload_management_bfd_configuration_initial( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_workload_management_bfd_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/updateWorkloadManagementBfdConfiguration" - } - - def _update_infra_management_bfd_configuration_initial( - self, - resource_group_name: str, - network_fabric_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_infra_management_bfd_configuration_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_infra_management_bfd_configuration_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_infra_management_bfd_configuration_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/updateInfraManagementBfdConfiguration" - } - - @overload - def begin_update_infra_management_bfd_configuration( - self, - resource_group_name: str, - network_fabric_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Updates the Infra Management BFD Configuration of the underlying resources in the given Network - Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_infra_management_bfd_configuration( - self, - resource_group_name: str, - network_fabric_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Updates the Infra Management BFD Configuration of the underlying resources in the given Network - Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update_infra_management_bfd_configuration( - self, - resource_group_name: str, - network_fabric_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Updates the Infra Management BFD Configuration of the underlying resources in the given Network - Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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_infra_management_bfd_configuration_initial( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_infra_management_bfd_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/updateInfraManagementBfdConfiguration" - } - - def _validate_configuration_initial( - self, - resource_group_name: str, - network_fabric_name: str, - body: Union[_models.ValidateConfigurationProperties, IO], - **kwargs: Any - ) -> _models.ValidateConfigurationResponse: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ValidateConfigurationResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "ValidateConfigurationProperties") - - request = build_validate_configuration_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._validate_configuration_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _validate_configuration_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/validateConfiguration" - } - - @overload - def begin_validate_configuration( - self, - resource_group_name: str, - network_fabric_name: str, - body: _models.ValidateConfigurationProperties, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ValidateConfigurationResponse]: - """Implements the operation to the underlying resources. - - Validates the configuration of the underlying resources in the given Network Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Validate configuration properties. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.ValidateConfigurationProperties - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ValidateConfigurationResponse or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_validate_configuration( - self, - resource_group_name: str, - network_fabric_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ValidateConfigurationResponse]: - """Implements the operation to the underlying resources. - - Validates the configuration of the underlying resources in the given Network Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Validate configuration properties. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ValidateConfigurationResponse or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_validate_configuration( - self, - resource_group_name: str, - network_fabric_name: str, - body: Union[_models.ValidateConfigurationProperties, IO], - **kwargs: Any - ) -> LROPoller[_models.ValidateConfigurationResponse]: - """Implements the operation to the underlying resources. - - Validates the configuration of the underlying resources in the given Network Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param body: Validate configuration properties. Is either a ValidateConfigurationProperties - type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.ValidateConfigurationProperties or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ValidateConfigurationResponse or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ValidateConfigurationResponse] = 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._validate_configuration_initial( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/validateConfiguration" - } - - def _get_topology_initial( - self, resource_group_name: str, network_fabric_name: str, **kwargs: Any - ) -> _models.ValidateConfigurationResponse: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ValidateConfigurationResponse] = kwargs.pop("cls", None) - - request = build_get_topology_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._get_topology_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _get_topology_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/getTopology" - } - - @distributed_trace - def begin_get_topology( - self, resource_group_name: str, network_fabric_name: str, **kwargs: Any - ) -> LROPoller[_models.ValidateConfigurationResponse]: - """Implements the operation to the underlying resources. - - Gets Topology of the underlying resources in the given Network Fabric instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ValidateConfigurationResponse or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ValidateConfigurationResponse] = 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_topology_initial( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - api_version=api_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("ValidateConfigurationResponse", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_get_topology.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/getTopology" - } - - def _commit_configuration_initial( - self, resource_group_name: str, network_fabric_name: str, **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - request = build_commit_configuration_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._commit_configuration_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _commit_configuration_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/commitConfiguration" - } - - @distributed_trace - def begin_commit_configuration( - self, resource_group_name: str, network_fabric_name: str, **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Atomic update of the given Network Fabric instance. Sync update of NFA resources at Fabric - level. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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._commit_configuration_initial( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - api_version=api_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("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_commit_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/commitConfiguration" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_interfaces_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_interfaces_operations.py deleted file mode 100644 index 2f6ab49415f0..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_interfaces_operations.py +++ /dev/null @@ -1,1302 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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 _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_request( - resource_group_name: str, network_device_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-06-15")) - 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.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}", - ) # 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", max_length=90, min_length=1 - ), - "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_name, "str"), - "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, "str"), - } - - _url: str = _format_url_section(_url, **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_get_request( - resource_group_name: str, network_device_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}", - ) # 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", max_length=90, min_length=1 - ), - "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_name, "str"), - "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, network_device_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-06-15")) - 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.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}", - ) # 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", max_length=90, min_length=1 - ), - "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_name, "str"), - "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, "str"), - } - - _url: str = _format_url_section(_url, **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_delete_request( - resource_group_name: str, network_device_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}", - ) # 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", max_length=90, min_length=1 - ), - "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_name, "str"), - "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_list_by_network_device_request( - resource_group_name: str, network_device_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces", - ) # 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", max_length=90, min_length=1 - ), - "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_administrative_state_request( - resource_group_name: str, network_device_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-06-15")) - 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.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}/updateAdministrativeState", - ) # 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", max_length=90, min_length=1 - ), - "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_name, "str"), - "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, "str"), - } - - _url: str = _format_url_section(_url, **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) - - -class NetworkInterfacesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricMgmtClient`'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") - - def _create_initial( - self, - resource_group_name: str, - network_device_name: str, - network_interface_name: str, - body: Union[_models.NetworkInterface, IO], - **kwargs: Any - ) -> _models.NetworkInterface: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkInterface") - - request = build_create_request( - resource_group_name=resource_group_name, - network_device_name=network_device_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, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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("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 - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}" - } - - @overload - def begin_create( - self, - resource_group_name: str, - network_device_name: str, - network_interface_name: str, - body: _models.NetworkInterface, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkInterface]: - """Create NetworkInterface. - - Create a Network Interface resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param network_interface_name: Name of the Network Interface. Required. - :type network_interface_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkInterface - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkInterface or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkInterface] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - network_device_name: str, - network_interface_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkInterface]: - """Create NetworkInterface. - - Create a Network Interface resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param network_interface_name: Name of the Network Interface. Required. - :type network_interface_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkInterface or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkInterface] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - network_device_name: str, - network_interface_name: str, - body: Union[_models.NetworkInterface, IO], - **kwargs: Any - ) -> LROPoller[_models.NetworkInterface]: - """Create NetworkInterface. - - Create a Network Interface resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param network_interface_name: Name of the Network Interface. Required. - :type network_interface_name: str - :param body: Request payload. Is either a NetworkInterface type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkInterface or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkInterface or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.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._config.api_version)) - 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_initial( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - network_interface_name=network_interface_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda 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, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}" - } - - @distributed_trace - def get( - self, resource_group_name: str, network_device_name: str, network_interface_name: str, **kwargs: Any - ) -> _models.NetworkInterface: - """Gets a NetworkInterface. - - Get the Network Interface resource details. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param network_interface_name: Name of the Network Interface. Required. - :type network_interface_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkInterface or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkInterface - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkInterface] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - network_interface_name=network_interface_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("NetworkInterface", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}" - } - - def _update_initial( - self, - resource_group_name: str, - network_device_name: str, - network_interface_name: str, - body: Union[_models.NetworkInterfacePatch, IO], - **kwargs: Any - ) -> Optional[_models.NetworkInterface]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.NetworkInterface]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkInterfacePatch") - - request = build_update_request( - resource_group_name=resource_group_name, - network_device_name=network_device_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, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("NetworkInterface", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}" - } - - @overload - def begin_update( - self, - resource_group_name: str, - network_device_name: str, - network_interface_name: str, - body: _models.NetworkInterfacePatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkInterface]: - """Updates a NetworkInterface. - - Update certain properties of the Network Interface resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param network_interface_name: Name of the Network Interface. Required. - :type network_interface_name: str - :param body: NetworkInterface properties to update. Only tags are supported. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkInterfacePatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkInterface or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkInterface] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - network_device_name: str, - network_interface_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkInterface]: - """Updates a NetworkInterface. - - Update certain properties of the Network Interface resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param network_interface_name: Name of the Network Interface. Required. - :type network_interface_name: str - :param body: NetworkInterface properties to update. Only tags are supported. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkInterface or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkInterface] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - network_device_name: str, - network_interface_name: str, - body: Union[_models.NetworkInterfacePatch, IO], - **kwargs: Any - ) -> LROPoller[_models.NetworkInterface]: - """Updates a NetworkInterface. - - Update certain properties of the Network Interface resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param network_interface_name: Name of the Network Interface. Required. - :type network_interface_name: str - :param body: NetworkInterface properties to update. Only tags are supported. Is either a - NetworkInterfacePatch type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkInterfacePatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkInterface or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.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._config.api_version)) - 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._update_initial( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - network_interface_name=network_interface_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda 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, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, network_device_name: str, network_interface_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - network_interface_name=network_interface_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}" - } - - @distributed_trace - def begin_delete( - self, resource_group_name: str, network_device_name: str, network_interface_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a NetworkInterface. - - Delete the Network Interface resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param network_interface_name: Name of the Network Interface. Required. - :type network_interface_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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_device_name=network_device_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, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}" - } - - @distributed_trace - def list_by_network_device( - self, resource_group_name: str, network_device_name: str, **kwargs: Any - ) -> Iterable["_models.NetworkInterface"]: - """List all Network Interfaces that are available using an Network Device. - - List all the Network Interface resources in a given resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkInterface or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.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._config.api_version)) - cls: ClsType[_models.NetworkInterfacesList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_network_device_request( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_network_device.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkInterfacesList", 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) - - list_by_network_device.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces" - } - - def _update_administrative_state_initial( - self, - resource_group_name: str, - network_device_name: str, - network_interface_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_administrative_state_request( - resource_group_name=resource_group_name, - network_device_name=network_device_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, - template_url=self._update_administrative_state_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_administrative_state_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}/updateAdministrativeState" - } - - @overload - def begin_update_administrative_state( - self, - resource_group_name: str, - network_device_name: str, - network_interface_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Updates the admin state of the network interface. - - Update the admin state of the Network Interface. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param network_interface_name: Name of the Network Interface. Required. - :type network_interface_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_administrative_state( - self, - resource_group_name: str, - network_device_name: str, - network_interface_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Updates the admin state of the network interface. - - Update the admin state of the Network Interface. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param network_interface_name: Name of the Network Interface. Required. - :type network_interface_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update_administrative_state( - self, - resource_group_name: str, - network_device_name: str, - network_interface_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Updates the admin state of the network interface. - - Update the admin state of the Network Interface. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_device_name: Name of the Network Device. Required. - :type network_device_name: str - :param network_interface_name: Name of the Network Interface. Required. - :type network_interface_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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_administrative_state_initial( - resource_group_name=resource_group_name, - network_device_name=network_device_name, - network_interface_name=network_interface_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_administrative_state.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}/updateAdministrativeState" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_packet_brokers_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_packet_brokers_operations.py deleted file mode 100644 index 96495cb34a3c..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_packet_brokers_operations.py +++ /dev/null @@ -1,1089 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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 _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_request( - resource_group_name: str, network_packet_broker_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/networkPacketBrokers/{networkPacketBrokerName}", - ) # 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", max_length=90, min_length=1 - ), - "networkPacketBrokerName": _SERIALIZER.url("network_packet_broker_name", network_packet_broker_name, "str"), - } - - _url: str = _format_url_section(_url, **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_get_request( - resource_group_name: str, network_packet_broker_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/{networkPacketBrokerName}", - ) # 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", max_length=90, min_length=1 - ), - "networkPacketBrokerName": _SERIALIZER.url("network_packet_broker_name", network_packet_broker_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, network_packet_broker_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/networkPacketBrokers/{networkPacketBrokerName}", - ) # 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", max_length=90, min_length=1 - ), - "networkPacketBrokerName": _SERIALIZER.url("network_packet_broker_name", network_packet_broker_name, "str"), - } - - _url: str = _format_url_section(_url, **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_delete_request( - resource_group_name: str, network_packet_broker_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/{networkPacketBrokerName}", - ) # 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", max_length=90, min_length=1 - ), - "networkPacketBrokerName": _SERIALIZER.url("network_packet_broker_name", network_packet_broker_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_list_by_resource_group_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers", - ) # 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", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_subscription_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers" - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class NetworkPacketBrokersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricMgmtClient`'s - :attr:`network_packet_brokers` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - def _create_initial( - self, - resource_group_name: str, - network_packet_broker_name: str, - body: Union[_models.NetworkPacketBroker, IO], - **kwargs: Any - ) -> _models.NetworkPacketBroker: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkPacketBroker] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkPacketBroker") - - request = build_create_request( - resource_group_name=resource_group_name, - network_packet_broker_name=network_packet_broker_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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("NetworkPacketBroker", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("NetworkPacketBroker", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/{networkPacketBrokerName}" - } - - @overload - def begin_create( - self, - resource_group_name: str, - network_packet_broker_name: str, - body: _models.NetworkPacketBroker, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkPacketBroker]: - """Create Network Packet Broker. - - Creates a Network Packet Broker. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_packet_broker_name: Name of the Network Packet Broker. Required. - :type network_packet_broker_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkPacketBroker or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - network_packet_broker_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkPacketBroker]: - """Create Network Packet Broker. - - Creates a Network Packet Broker. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_packet_broker_name: Name of the Network Packet Broker. Required. - :type network_packet_broker_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkPacketBroker or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - network_packet_broker_name: str, - body: Union[_models.NetworkPacketBroker, IO], - **kwargs: Any - ) -> LROPoller[_models.NetworkPacketBroker]: - """Create Network Packet Broker. - - Creates a Network Packet Broker. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_packet_broker_name: Name of the Network Packet Broker. Required. - :type network_packet_broker_name: str - :param body: Request payload. Is either a NetworkPacketBroker type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkPacketBroker or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkPacketBroker] = 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_packet_broker_name=network_packet_broker_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkPacketBroker", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/{networkPacketBrokerName}" - } - - @distributed_trace - def get( - self, resource_group_name: str, network_packet_broker_name: str, **kwargs: Any - ) -> _models.NetworkPacketBroker: - """Gets a Network Packet Broker. - - Retrieves details of this Network Packet Broker. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_packet_broker_name: Name of the Network Packet Broker. Required. - :type network_packet_broker_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkPacketBroker or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkPacketBroker] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - network_packet_broker_name=network_packet_broker_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("NetworkPacketBroker", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/{networkPacketBrokerName}" - } - - def _update_initial( - self, - resource_group_name: str, - network_packet_broker_name: str, - body: Union[_models.NetworkPacketBrokerPatch, IO], - **kwargs: Any - ) -> Optional[_models.NetworkPacketBroker]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.NetworkPacketBroker]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkPacketBrokerPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - network_packet_broker_name=network_packet_broker_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("NetworkPacketBroker", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/{networkPacketBrokerName}" - } - - @overload - def begin_update( - self, - resource_group_name: str, - network_packet_broker_name: str, - body: _models.NetworkPacketBrokerPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkPacketBroker]: - """Updates the Network Packet Broker. - - API to update certain properties of the Network Packet Broker resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_packet_broker_name: Name of the Network Packet Broker. Required. - :type network_packet_broker_name: str - :param body: Network Packet Broker properties to update. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkPacketBrokerPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkPacketBroker or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - network_packet_broker_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkPacketBroker]: - """Updates the Network Packet Broker. - - API to update certain properties of the Network Packet Broker resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_packet_broker_name: Name of the Network Packet Broker. Required. - :type network_packet_broker_name: str - :param body: Network Packet Broker properties to update. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkPacketBroker or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - network_packet_broker_name: str, - body: Union[_models.NetworkPacketBrokerPatch, IO], - **kwargs: Any - ) -> LROPoller[_models.NetworkPacketBroker]: - """Updates the Network Packet Broker. - - API to update certain properties of the Network Packet Broker resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_packet_broker_name: Name of the Network Packet Broker. Required. - :type network_packet_broker_name: str - :param body: Network Packet Broker properties to update. Is either a NetworkPacketBrokerPatch - type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkPacketBrokerPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkPacketBroker or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkPacketBroker] = 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, - network_packet_broker_name=network_packet_broker_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkPacketBroker", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/{networkPacketBrokerName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, network_packet_broker_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - network_packet_broker_name=network_packet_broker_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/{networkPacketBrokerName}" - } - - @distributed_trace - def begin_delete(self, resource_group_name: str, network_packet_broker_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a Network Packet Broker. - - Deletes Network Packet Broker. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_packet_broker_name: Name of the Network Packet Broker. Required. - :type network_packet_broker_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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_packet_broker_name=network_packet_broker_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/{networkPacketBrokerName}" - } - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.NetworkPacketBroker"]: - """List all Network Packet Brokers under resource group. - - Displays NetworkPacketBrokers list by resource group GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkPacketBroker or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkPacketBrokersListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkPacketBrokersListResult", 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.NetworkPacketBroker"]: - """List Network Packet Brokers by subscription. - - Displays Network Packet Brokers list by subscription GET method. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkPacketBroker or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkPacketBrokersListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkPacketBrokersListResult", 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_racks_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_racks_operations.py deleted file mode 100644 index 3909e6bfeb5a..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_racks_operations.py +++ /dev/null @@ -1,1061 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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 _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_request( - resource_group_name: str, network_rack_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/networkRacks/{networkRackName}", - ) # 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", max_length=90, min_length=1 - ), - "networkRackName": _SERIALIZER.url("network_rack_name", network_rack_name, "str"), - } - - _url: str = _format_url_section(_url, **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_get_request( - resource_group_name: str, network_rack_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks/{networkRackName}", - ) # 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", max_length=90, min_length=1 - ), - "networkRackName": _SERIALIZER.url("network_rack_name", network_rack_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, network_rack_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/networkRacks/{networkRackName}", - ) # 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", max_length=90, min_length=1 - ), - "networkRackName": _SERIALIZER.url("network_rack_name", network_rack_name, "str"), - } - - _url: str = _format_url_section(_url, **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_delete_request( - resource_group_name: str, network_rack_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks/{networkRackName}", - ) # 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", max_length=90, min_length=1 - ), - "networkRackName": _SERIALIZER.url("network_rack_name", network_rack_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_list_by_resource_group_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks", - ) # 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", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_subscription_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkRacks" - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class NetworkRacksOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricMgmtClient`'s - :attr:`network_racks` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - def _create_initial( - self, resource_group_name: str, network_rack_name: str, body: Union[_models.NetworkRack, IO], **kwargs: Any - ) -> _models.NetworkRack: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkRack] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkRack") - - request = build_create_request( - resource_group_name=resource_group_name, - network_rack_name=network_rack_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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("NetworkRack", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("NetworkRack", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks/{networkRackName}" - } - - @overload - def begin_create( - self, - resource_group_name: str, - network_rack_name: str, - body: _models.NetworkRack, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkRack]: - """Create Network Rack. - - Create Network Rack resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_rack_name: Name of the Network Rack. Required. - :type network_rack_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkRack - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkRack or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkRack] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - network_rack_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkRack]: - """Create Network Rack. - - Create Network Rack resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_rack_name: Name of the Network Rack. Required. - :type network_rack_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkRack or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkRack] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, resource_group_name: str, network_rack_name: str, body: Union[_models.NetworkRack, IO], **kwargs: Any - ) -> LROPoller[_models.NetworkRack]: - """Create Network Rack. - - Create Network Rack resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_rack_name: Name of the Network Rack. Required. - :type network_rack_name: str - :param body: Request payload. Is either a NetworkRack type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkRack or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkRack or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkRack] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkRack] = 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_rack_name=network_rack_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkRack", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks/{networkRackName}" - } - - @distributed_trace - def get(self, resource_group_name: str, network_rack_name: str, **kwargs: Any) -> _models.NetworkRack: - """Gets a Network Rack. - - Get Network Rack resource details. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_rack_name: Name of the Network Rack. Required. - :type network_rack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkRack or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkRack - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkRack] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - network_rack_name=network_rack_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("NetworkRack", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks/{networkRackName}" - } - - def _update_initial( - self, resource_group_name: str, network_rack_name: str, body: Union[_models.TagsUpdate, IO], **kwargs: Any - ) -> Optional[_models.NetworkRack]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.NetworkRack]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "TagsUpdate") - - request = build_update_request( - resource_group_name=resource_group_name, - network_rack_name=network_rack_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("NetworkRack", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks/{networkRackName}" - } - - @overload - def begin_update( - self, - resource_group_name: str, - network_rack_name: str, - body: _models.TagsUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkRack]: - """Updates a Network Rack. - - Update certain properties of the Network Rack resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_rack_name: Name of the Network Rack. Required. - :type network_rack_name: str - :param body: Network Rack properties to update. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.TagsUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkRack or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkRack] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - network_rack_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkRack]: - """Updates a Network Rack. - - Update certain properties of the Network Rack resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_rack_name: Name of the Network Rack. Required. - :type network_rack_name: str - :param body: Network Rack properties to update. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkRack or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkRack] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, resource_group_name: str, network_rack_name: str, body: Union[_models.TagsUpdate, IO], **kwargs: Any - ) -> LROPoller[_models.NetworkRack]: - """Updates a Network Rack. - - Update certain properties of the Network Rack resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_rack_name: Name of the Network Rack. Required. - :type network_rack_name: str - :param body: Network Rack properties to update. Is either a TagsUpdate type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.TagsUpdate or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkRack or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkRack] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkRack] = 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, - network_rack_name=network_rack_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkRack", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks/{networkRackName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, network_rack_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - network_rack_name=network_rack_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks/{networkRackName}" - } - - @distributed_trace - def begin_delete(self, resource_group_name: str, network_rack_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a Network Rack. - - Delete Network Rack resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_rack_name: Name of the Network Rack. Required. - :type network_rack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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_rack_name=network_rack_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks/{networkRackName}" - } - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.NetworkRack"]: - """List Network Racks by resource group. - - List all Network Rack resources in the given resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkRack or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkRack] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkRacksListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkRacksListResult", 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.NetworkRack"]: - """List Network Racks by subscription. - - List all Network Rack resources in the given subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkRack or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkRack] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkRacksListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkRacksListResult", 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkRacks" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_tap_rules_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_tap_rules_operations.py deleted file mode 100644 index 76e9a4dc24d8..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_tap_rules_operations.py +++ /dev/null @@ -1,1694 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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 _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_request( - resource_group_name: str, network_tap_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-06-15")) - 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.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}", - ) # 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", max_length=90, min_length=1 - ), - "networkTapRuleName": _SERIALIZER.url("network_tap_rule_name", network_tap_rule_name, "str"), - } - - _url: str = _format_url_section(_url, **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_get_request( - resource_group_name: str, network_tap_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}", - ) # 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", max_length=90, min_length=1 - ), - "networkTapRuleName": _SERIALIZER.url("network_tap_rule_name", network_tap_rule_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, network_tap_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-06-15")) - 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.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}", - ) # 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", max_length=90, min_length=1 - ), - "networkTapRuleName": _SERIALIZER.url("network_tap_rule_name", network_tap_rule_name, "str"), - } - - _url: str = _format_url_section(_url, **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_delete_request( - resource_group_name: str, network_tap_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}", - ) # 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", max_length=90, min_length=1 - ), - "networkTapRuleName": _SERIALIZER.url("network_tap_rule_name", network_tap_rule_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_list_by_resource_group_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules", - ) # 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", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_subscription_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkTapRules" - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_administrative_state_request( - resource_group_name: str, network_tap_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-06-15")) - 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.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}/updateAdministrativeState", - ) # 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", max_length=90, min_length=1 - ), - "networkTapRuleName": _SERIALIZER.url("network_tap_rule_name", network_tap_rule_name, "str"), - } - - _url: str = _format_url_section(_url, **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_resync_request( - resource_group_name: str, network_tap_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}/resync", - ) # 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", max_length=90, min_length=1 - ), - "networkTapRuleName": _SERIALIZER.url("network_tap_rule_name", network_tap_rule_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_validate_configuration_request( - resource_group_name: str, network_tap_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}/validateConfiguration", - ) # 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", max_length=90, min_length=1 - ), - "networkTapRuleName": _SERIALIZER.url("network_tap_rule_name", network_tap_rule_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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) - - -class NetworkTapRulesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricMgmtClient`'s - :attr:`network_tap_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") - - def _create_initial( - self, - resource_group_name: str, - network_tap_rule_name: str, - body: Union[_models.NetworkTapRule, IO], - **kwargs: Any - ) -> _models.NetworkTapRule: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkTapRule] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkTapRule") - - request = build_create_request( - resource_group_name=resource_group_name, - network_tap_rule_name=network_tap_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("NetworkTapRule", pipeline_response) - - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = self._deserialize("NetworkTapRule", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}" - } - - @overload - def begin_create( - self, - resource_group_name: str, - network_tap_rule_name: str, - body: _models.NetworkTapRule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkTapRule]: - """Create Network Tap Rule. - - Create Network Tap Rule resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_rule_name: Name of the Network Tap Rule. Required. - :type network_tap_rule_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTapRule - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkTapRule or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - network_tap_rule_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkTapRule]: - """Create Network Tap Rule. - - Create Network Tap Rule resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_rule_name: Name of the Network Tap Rule. Required. - :type network_tap_rule_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkTapRule or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - network_tap_rule_name: str, - body: Union[_models.NetworkTapRule, IO], - **kwargs: Any - ) -> LROPoller[_models.NetworkTapRule]: - """Create Network Tap Rule. - - Create Network Tap Rule resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_rule_name: Name of the Network Tap Rule. Required. - :type network_tap_rule_name: str - :param body: Request payload. Is either a NetworkTapRule type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTapRule or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkTapRule or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkTapRule] = 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_tap_rule_name=network_tap_rule_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkTapRule", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}" - } - - @distributed_trace - def get(self, resource_group_name: str, network_tap_rule_name: str, **kwargs: Any) -> _models.NetworkTapRule: - """Gets a Network Tap Rule. - - Get Network Tap Rule resource details. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_rule_name: Name of the Network Tap Rule. Required. - :type network_tap_rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkTapRule or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkTapRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkTapRule] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - network_tap_rule_name=network_tap_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("NetworkTapRule", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}" - } - - def _update_initial( - self, - resource_group_name: str, - network_tap_rule_name: str, - body: Union[_models.NetworkTapRulePatch, IO], - **kwargs: Any - ) -> Optional[_models.NetworkTapRule]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.NetworkTapRule]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkTapRulePatch") - - request = build_update_request( - resource_group_name=resource_group_name, - network_tap_rule_name=network_tap_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("NetworkTapRule", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}" - } - - @overload - def begin_update( - self, - resource_group_name: str, - network_tap_rule_name: str, - body: _models.NetworkTapRulePatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkTapRule]: - """Updates a Network Tap Rule. - - Update certain properties of the Network Tap Rule resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_rule_name: Name of the Network Tap Rule. Required. - :type network_tap_rule_name: str - :param body: Network Tap Rule properties to update. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTapRulePatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkTapRule or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - network_tap_rule_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkTapRule]: - """Updates a Network Tap Rule. - - Update certain properties of the Network Tap Rule resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_rule_name: Name of the Network Tap Rule. Required. - :type network_tap_rule_name: str - :param body: Network Tap Rule properties to update. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkTapRule or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - network_tap_rule_name: str, - body: Union[_models.NetworkTapRulePatch, IO], - **kwargs: Any - ) -> LROPoller[_models.NetworkTapRule]: - """Updates a Network Tap Rule. - - Update certain properties of the Network Tap Rule resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_rule_name: Name of the Network Tap Rule. Required. - :type network_tap_rule_name: str - :param body: Network Tap Rule properties to update. Is either a NetworkTapRulePatch type or a - IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTapRulePatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkTapRule or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkTapRule] = 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, - network_tap_rule_name=network_tap_rule_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkTapRule", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, network_tap_rule_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - network_tap_rule_name=network_tap_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: 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) - - 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) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}" - } - - @distributed_trace - def begin_delete(self, resource_group_name: str, network_tap_rule_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a Network Tap Rule. - - Delete Network Tap Rule resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_rule_name: Name of the Network Tap Rule. Required. - :type network_tap_rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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_tap_rule_name=network_tap_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, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}" - } - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.NetworkTapRule"]: - """List Network Tap Rules by resource group. - - List all the Network Tap Rule resources in the given resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkTapRule or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkTapRulesListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkTapRulesListResult", 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.NetworkTapRule"]: - """List NetworkTapRules by subscription. - - List all the Network Tap Rule resources in the given subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkTapRule or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkTapRulesListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkTapRulesListResult", 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkTapRules" - } - - def _update_administrative_state_initial( - self, - resource_group_name: str, - network_tap_rule_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_administrative_state_request( - resource_group_name=resource_group_name, - network_tap_rule_name=network_tap_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_administrative_state_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_administrative_state_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}/updateAdministrativeState" - } - - @overload - def begin_update_administrative_state( - self, - resource_group_name: str, - network_tap_rule_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Updates administrative state of Network Tap Rules. - - Implements the operation to the underlying resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_rule_name: Name of the Network Tap Rule. Required. - :type network_tap_rule_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_administrative_state( - self, - resource_group_name: str, - network_tap_rule_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Updates administrative state of Network Tap Rules. - - Implements the operation to the underlying resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_rule_name: Name of the Network Tap Rule. Required. - :type network_tap_rule_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update_administrative_state( - self, - resource_group_name: str, - network_tap_rule_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Updates administrative state of Network Tap Rules. - - Implements the operation to the underlying resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_rule_name: Name of the Network Tap Rule. Required. - :type network_tap_rule_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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_administrative_state_initial( - resource_group_name=resource_group_name, - network_tap_rule_name=network_tap_rule_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_administrative_state.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}/updateAdministrativeState" - } - - def _resync_initial( - self, resource_group_name: str, network_tap_rule_name: str, **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - request = build_resync_request( - resource_group_name=resource_group_name, - network_tap_rule_name=network_tap_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._resync_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _resync_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}/resync" - } - - @distributed_trace - def begin_resync( - self, resource_group_name: str, network_tap_rule_name: str, **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Resync the Network Tap Rule. - - Implements the operation to the underlying resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_rule_name: Name of the Network Tap Rule. Required. - :type network_tap_rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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._resync_initial( - resource_group_name=resource_group_name, - network_tap_rule_name=network_tap_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): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_resync.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}/resync" - } - - def _validate_configuration_initial( - self, resource_group_name: str, network_tap_rule_name: str, **kwargs: Any - ) -> _models.ValidateConfigurationResponse: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ValidateConfigurationResponse] = kwargs.pop("cls", None) - - request = build_validate_configuration_request( - resource_group_name=resource_group_name, - network_tap_rule_name=network_tap_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._validate_configuration_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _validate_configuration_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}/validateConfiguration" - } - - @distributed_trace - def begin_validate_configuration( - self, resource_group_name: str, network_tap_rule_name: str, **kwargs: Any - ) -> LROPoller[_models.ValidateConfigurationResponse]: - """Validates the configuration of the Network Tap Rule. - - Implements the operation to the underlying resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_rule_name: Name of the Network Tap Rule. Required. - :type network_tap_rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ValidateConfigurationResponse or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ValidateConfigurationResponse] = 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._validate_configuration_initial( - resource_group_name=resource_group_name, - network_tap_rule_name=network_tap_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): - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}/validateConfiguration" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_taps_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_taps_operations.py deleted file mode 100644 index b1c6c9d14e9a..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_taps_operations.py +++ /dev/null @@ -1,1497 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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 _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_request( - resource_group_name: str, network_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-06-15")) - 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.ManagedNetworkFabric/networkTaps/{networkTapName}", - ) # 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", max_length=90, min_length=1 - ), - "networkTapName": _SERIALIZER.url("network_tap_name", network_tap_name, "str"), - } - - _url: str = _format_url_section(_url, **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_get_request( - resource_group_name: str, network_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}", - ) # 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", max_length=90, min_length=1 - ), - "networkTapName": _SERIALIZER.url("network_tap_name", network_tap_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, network_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-06-15")) - 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.ManagedNetworkFabric/networkTaps/{networkTapName}", - ) # 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", max_length=90, min_length=1 - ), - "networkTapName": _SERIALIZER.url("network_tap_name", network_tap_name, "str"), - } - - _url: str = _format_url_section(_url, **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_delete_request( - resource_group_name: str, network_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}", - ) # 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", max_length=90, min_length=1 - ), - "networkTapName": _SERIALIZER.url("network_tap_name", network_tap_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_list_by_resource_group_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps", - ) # 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", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_subscription_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkTaps" - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_administrative_state_request( - resource_group_name: str, network_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-06-15")) - 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.ManagedNetworkFabric/networkTaps/{networkTapName}/updateAdministrativeState", - ) # 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", max_length=90, min_length=1 - ), - "networkTapName": _SERIALIZER.url("network_tap_name", network_tap_name, "str"), - } - - _url: str = _format_url_section(_url, **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_resync_request( - resource_group_name: str, network_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}/resync", - ) # 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", max_length=90, min_length=1 - ), - "networkTapName": _SERIALIZER.url("network_tap_name", network_tap_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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) - - -class NetworkTapsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricMgmtClient`'s - :attr:`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") - - def _create_initial( - self, resource_group_name: str, network_tap_name: str, body: Union[_models.NetworkTap, IO], **kwargs: Any - ) -> _models.NetworkTap: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkTap] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkTap") - - request = build_create_request( - resource_group_name=resource_group_name, - network_tap_name=network_tap_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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("NetworkTap", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("NetworkTap", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}" - } - - @overload - def begin_create( - self, - resource_group_name: str, - network_tap_name: str, - body: _models.NetworkTap, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkTap]: - """Create Network Tap. - - Creates a Network Tap. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_name: Name of the Network Tap. Required. - :type network_tap_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTap - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkTap or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTap] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - network_tap_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkTap]: - """Create Network Tap. - - Creates a Network Tap. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_name: Name of the Network Tap. Required. - :type network_tap_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkTap or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTap] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, resource_group_name: str, network_tap_name: str, body: Union[_models.NetworkTap, IO], **kwargs: Any - ) -> LROPoller[_models.NetworkTap]: - """Create Network Tap. - - Creates a Network Tap. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_name: Name of the Network Tap. Required. - :type network_tap_name: str - :param body: Request payload. Is either a NetworkTap type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTap or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkTap or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTap] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkTap] = 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_tap_name=network_tap_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkTap", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}" - } - - @distributed_trace - def get(self, resource_group_name: str, network_tap_name: str, **kwargs: Any) -> _models.NetworkTap: - """Gets a Network Tap. - - Retrieves details of this Network Tap. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_name: Name of the Network Tap. Required. - :type network_tap_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkTap or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkTap - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkTap] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - network_tap_name=network_tap_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("NetworkTap", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}" - } - - def _update_initial( - self, resource_group_name: str, network_tap_name: str, body: Union[_models.NetworkTapPatch, IO], **kwargs: Any - ) -> Optional[_models.NetworkTap]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.NetworkTap]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkTapPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - network_tap_name=network_tap_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("NetworkTap", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}" - } - - @overload - def begin_update( - self, - resource_group_name: str, - network_tap_name: str, - body: _models.NetworkTapPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkTap]: - """Updates the Network Taps. - - API to update certain properties of the Network Tap resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_name: Name of the Network Tap. Required. - :type network_tap_name: str - :param body: Network Tap properties to update. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTapPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkTap or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTap] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - network_tap_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkTap]: - """Updates the Network Taps. - - API to update certain properties of the Network Tap resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_name: Name of the Network Tap. Required. - :type network_tap_name: str - :param body: Network Tap properties to update. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkTap or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTap] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, resource_group_name: str, network_tap_name: str, body: Union[_models.NetworkTapPatch, IO], **kwargs: Any - ) -> LROPoller[_models.NetworkTap]: - """Updates the Network Taps. - - API to update certain properties of the Network Tap resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_name: Name of the Network Tap. Required. - :type network_tap_name: str - :param body: Network Tap properties to update. Is either a NetworkTapPatch type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTapPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkTap or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTap] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkTap] = 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, - network_tap_name=network_tap_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkTap", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, network_tap_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - network_tap_name=network_tap_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}" - } - - @distributed_trace - def begin_delete(self, resource_group_name: str, network_tap_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a Network Tap. - - Deletes Network Tap. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_name: Name of the Network Tap. Required. - :type network_tap_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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_tap_name=network_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, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}" - } - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.NetworkTap"]: - """List Network Taps by resource group. - - Displays Network Taps list by resource group GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkTap or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkTap] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkTapsListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkTapsListResult", 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.NetworkTap"]: - """List Network Taps by subscription. - - Displays Network Taps list by subscription GET method. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkTap or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkTap] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkTapsListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkTapsListResult", 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkTaps" - } - - def _update_administrative_state_initial( - self, - resource_group_name: str, - network_tap_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForDeviceUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForDeviceUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_administrative_state_request( - resource_group_name=resource_group_name, - network_tap_name=network_tap_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_administrative_state_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_administrative_state_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}/updateAdministrativeState" - } - - @overload - def begin_update_administrative_state( - self, - resource_group_name: str, - network_tap_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForDeviceUpdate]: - """Updates administrative state of Network Tap. - - Implements the operation to the underlying resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_name: Name of the Network Tap. Required. - :type network_tap_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForDeviceUpdate - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_administrative_state( - self, - resource_group_name: str, - network_tap_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForDeviceUpdate]: - """Updates administrative state of Network Tap. - - Implements the operation to the underlying resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_name: Name of the Network Tap. Required. - :type network_tap_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForDeviceUpdate - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update_administrative_state( - self, - resource_group_name: str, - network_tap_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForDeviceUpdate]: - """Updates administrative state of Network Tap. - - Implements the operation to the underlying resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_name: Name of the Network Tap. Required. - :type network_tap_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForDeviceUpdate - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForDeviceUpdate] = 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_administrative_state_initial( - resource_group_name=resource_group_name, - network_tap_name=network_tap_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_administrative_state.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}/updateAdministrativeState" - } - - def _resync_initial( - self, resource_group_name: str, network_tap_name: str, **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - request = build_resync_request( - resource_group_name=resource_group_name, - network_tap_name=network_tap_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._resync_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _resync_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}/resync" - } - - @distributed_trace - def begin_resync( - self, resource_group_name: str, network_tap_name: str, **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Resync operation on the Network Tap. - - Implements the operation to the underlying resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_tap_name: Name of the Network Tap. Required. - :type network_tap_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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._resync_initial( - resource_group_name=resource_group_name, - network_tap_name=network_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): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_resync.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}/resync" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_to_network_interconnects_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_to_network_interconnects_operations.py deleted file mode 100644 index 85d7e2cd28b3..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_network_to_network_interconnects_operations.py +++ /dev/null @@ -1,1662 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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 _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_request( - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}", - ) # 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", max_length=90, min_length=1 - ), - "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_name, "str"), - "networkToNetworkInterconnectName": _SERIALIZER.url( - "network_to_network_interconnect_name", network_to_network_interconnect_name, "str" - ), - } - - _url: str = _format_url_section(_url, **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_get_request( - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}", - ) # 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", max_length=90, min_length=1 - ), - "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_name, "str"), - "networkToNetworkInterconnectName": _SERIALIZER.url( - "network_to_network_interconnect_name", network_to_network_interconnect_name, "str" - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}", - ) # 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", max_length=90, min_length=1 - ), - "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_name, "str"), - "networkToNetworkInterconnectName": _SERIALIZER.url( - "network_to_network_interconnect_name", network_to_network_interconnect_name, "str" - ), - } - - _url: str = _format_url_section(_url, **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_delete_request( - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}", - ) # 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", max_length=90, min_length=1 - ), - "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_name, "str"), - "networkToNetworkInterconnectName": _SERIALIZER.url( - "network_to_network_interconnect_name", network_to_network_interconnect_name, "str" - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_list_by_network_fabric_request( - resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects", - ) # 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", max_length=90, min_length=1 - ), - "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_npb_static_route_bfd_administrative_state_request( - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}/updateNpbStaticRouteBfdAdministrativeState", - ) # 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", max_length=90, min_length=1 - ), - "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_name, "str"), - "networkToNetworkInterconnectName": _SERIALIZER.url( - "network_to_network_interconnect_name", network_to_network_interconnect_name, "str" - ), - } - - _url: str = _format_url_section(_url, **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_update_administrative_state_request( - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-15")) - 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.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}/updateAdministrativeState", - ) # 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", max_length=90, min_length=1 - ), - "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_name, "str"), - "networkToNetworkInterconnectName": _SERIALIZER.url( - "network_to_network_interconnect_name", network_to_network_interconnect_name, "str" - ), - } - - _url: str = _format_url_section(_url, **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) - - -class NetworkToNetworkInterconnectsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricMgmtClient`'s - :attr:`network_to_network_interconnects` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - def _create_initial( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: Union[_models.NetworkToNetworkInterconnect, IO], - **kwargs: Any - ) -> _models.NetworkToNetworkInterconnect: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkToNetworkInterconnect] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkToNetworkInterconnect") - - request = build_create_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - network_to_network_interconnect_name=network_to_network_interconnect_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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("NetworkToNetworkInterconnect", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("NetworkToNetworkInterconnect", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}" - } - - @overload - def begin_create( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: _models.NetworkToNetworkInterconnect, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkToNetworkInterconnect]: - """Configuration used to setup CE-PE connectivity. - - Configuration used to setup CE-PE connectivity PUT Method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. - Required. - :type network_to_network_interconnect_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkToNetworkInterconnect or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkToNetworkInterconnect]: - """Configuration used to setup CE-PE connectivity. - - Configuration used to setup CE-PE connectivity PUT Method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. - Required. - :type network_to_network_interconnect_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkToNetworkInterconnect or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: Union[_models.NetworkToNetworkInterconnect, IO], - **kwargs: Any - ) -> LROPoller[_models.NetworkToNetworkInterconnect]: - """Configuration used to setup CE-PE connectivity. - - Configuration used to setup CE-PE connectivity PUT Method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. - Required. - :type network_to_network_interconnect_name: str - :param body: Request payload. Is either a NetworkToNetworkInterconnect type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkToNetworkInterconnect or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkToNetworkInterconnect] = 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_fabric_name=network_fabric_name, - network_to_network_interconnect_name=network_to_network_interconnect_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkToNetworkInterconnect", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}" - } - - @distributed_trace - def get( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - **kwargs: Any - ) -> _models.NetworkToNetworkInterconnect: - """Configuration used to setup CE-PE connectivity. - - Implements NetworkToNetworkInterconnects GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. - Required. - :type network_to_network_interconnect_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkToNetworkInterconnect or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkToNetworkInterconnect] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - network_to_network_interconnect_name=network_to_network_interconnect_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("NetworkToNetworkInterconnect", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}" - } - - def _update_initial( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: Union[_models.NetworkToNetworkInterconnectPatch, IO], - **kwargs: Any - ) -> Optional[_models.NetworkToNetworkInterconnect]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.NetworkToNetworkInterconnect]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "NetworkToNetworkInterconnectPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - network_to_network_interconnect_name=network_to_network_interconnect_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("NetworkToNetworkInterconnect", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}" - } - - @overload - def begin_update( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: _models.NetworkToNetworkInterconnectPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkToNetworkInterconnect]: - """Updates a Network To NetworkInterconnects. - - Update certain properties of the Network To NetworkInterconnects resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. - Required. - :type network_to_network_interconnect_name: str - :param body: Network to Network Interconnect properties to update. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnectPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkToNetworkInterconnect or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NetworkToNetworkInterconnect]: - """Updates a Network To NetworkInterconnects. - - Update certain properties of the Network To NetworkInterconnects resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. - Required. - :type network_to_network_interconnect_name: str - :param body: Network to Network Interconnect properties to update. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkToNetworkInterconnect or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: Union[_models.NetworkToNetworkInterconnectPatch, IO], - **kwargs: Any - ) -> LROPoller[_models.NetworkToNetworkInterconnect]: - """Updates a Network To NetworkInterconnects. - - Update certain properties of the Network To NetworkInterconnects resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. - Required. - :type network_to_network_interconnect_name: str - :param body: Network to Network Interconnect properties to update. Is either a - NetworkToNetworkInterconnectPatch type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnectPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkToNetworkInterconnect or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkToNetworkInterconnect] = 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, - network_fabric_name=network_fabric_name, - network_to_network_interconnect_name=network_to_network_interconnect_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkToNetworkInterconnect", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - network_to_network_interconnect_name=network_to_network_interconnect_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}" - } - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - **kwargs: Any - ) -> LROPoller[None]: - """Deletes a NetworkToNetworkInterconnects. - - Implements NetworkToNetworkInterconnects DELETE method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. - Required. - :type network_to_network_interconnect_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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_fabric_name=network_fabric_name, - network_to_network_interconnect_name=network_to_network_interconnect_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}" - } - - @distributed_trace - def list_by_network_fabric( - self, resource_group_name: str, network_fabric_name: str, **kwargs: Any - ) -> Iterable["_models.NetworkToNetworkInterconnect"]: - """Executes list operation to display Network To Network Interconnects within a Network Fabric. - - Implements Network To Network Interconnects list by Network Fabric GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkToNetworkInterconnect or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkToNetworkInterconnectsList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_network_fabric_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_network_fabric.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkToNetworkInterconnectsList", 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) - - list_by_network_fabric.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects" - } - - def _update_npb_static_route_bfd_administrative_state_initial( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_npb_static_route_bfd_administrative_state_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - network_to_network_interconnect_name=network_to_network_interconnect_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_npb_static_route_bfd_administrative_state_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_npb_static_route_bfd_administrative_state_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}/updateNpbStaticRouteBfdAdministrativeState" - } - - @overload - def begin_update_npb_static_route_bfd_administrative_state( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Updates the NPB Static Route BFD Administrative State. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. - Required. - :type network_to_network_interconnect_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_npb_static_route_bfd_administrative_state( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Updates the NPB Static Route BFD Administrative State. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. - Required. - :type network_to_network_interconnect_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update_npb_static_route_bfd_administrative_state( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Updates the NPB Static Route BFD Administrative State. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. - Required. - :type network_to_network_interconnect_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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_npb_static_route_bfd_administrative_state_initial( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - network_to_network_interconnect_name=network_to_network_interconnect_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_npb_static_route_bfd_administrative_state.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}/updateNpbStaticRouteBfdAdministrativeState" - } - - def _update_administrative_state_initial( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_administrative_state_request( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - network_to_network_interconnect_name=network_to_network_interconnect_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_administrative_state_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_administrative_state_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}/updateAdministrativeState" - } - - @overload - def begin_update_administrative_state( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Updates the Admin State. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. - Required. - :type network_to_network_interconnect_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_administrative_state( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Updates the Admin State. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. - Required. - :type network_to_network_interconnect_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update_administrative_state( - self, - resource_group_name: str, - network_fabric_name: str, - network_to_network_interconnect_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Implements the operation to the underlying resources. - - Updates the Admin State. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param network_fabric_name: Name of the Network Fabric. Required. - :type network_fabric_name: str - :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. - Required. - :type network_to_network_interconnect_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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_administrative_state_initial( - resource_group_name=resource_group_name, - network_fabric_name=network_fabric_name, - network_to_network_interconnect_name=network_to_network_interconnect_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_administrative_state.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}/updateAdministrativeState" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_operations.py index 371bfc6efbe1..5092b68a9914 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_operations.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_operations.py @@ -1,50 +1,61 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +from collections.abc import MutableMapping +from io import IOBase +import json +from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest, HttpResponse 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 _convert_request +from .._configuration import ManagedNetworkFabricClientConfiguration +from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from .._utils.serialization import Deserializer, Serializer +from .._validation import api_version_validation T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] +JSON = MutableMapping[str, Any] +List = list _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False -def build_list_request(**kwargs: Any) -> HttpRequest: +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-06-15")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.ManagedNetworkFabric/operations") + _url = "/providers/Microsoft.ManagedNetworkFabric/operations" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -55,41 +66,40420 @@ def build_list_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_access_control_lists_get_request( + resource_group_name: str, access_control_list_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "accessControlListName": _SERIALIZER.url("access_control_list_name", access_control_list_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_access_control_lists_create_request( # pylint: disable=name-too-long + resource_group_name: str, access_control_list_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "accessControlListName": _SERIALIZER.url("access_control_list_name", access_control_list_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_access_control_lists_update_request( # pylint: disable=name-too-long + resource_group_name: str, access_control_list_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "accessControlListName": _SERIALIZER.url("access_control_list_name", access_control_list_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_access_control_lists_delete_request( # pylint: disable=name-too-long + resource_group_name: str, access_control_list_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "accessControlListName": _SERIALIZER.url("access_control_list_name", access_control_list_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_access_control_lists_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists" + 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_access_control_lists_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/accessControlLists" + 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_access_control_lists_update_administrative_state_request( # pylint: disable=name-too-long + resource_group_name: str, access_control_list_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}/updateAdministrativeState" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "accessControlListName": _SERIALIZER.url("access_control_list_name", access_control_list_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_access_control_lists_resync_request( # pylint: disable=name-too-long + resource_group_name: str, access_control_list_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}/resync" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "accessControlListName": _SERIALIZER.url("access_control_list_name", access_control_list_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_access_control_lists_validate_configuration_request( # pylint: disable=name-too-long + resource_group_name: str, access_control_list_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}/validateConfiguration" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "accessControlListName": _SERIALIZER.url("access_control_list_name", access_control_list_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_internet_gateway_rules_get_request( + resource_group_name: str, internet_gateway_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "internetGatewayRuleName": _SERIALIZER.url("internet_gateway_rule_name", internet_gateway_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_internet_gateway_rules_create_request( # pylint: disable=name-too-long + resource_group_name: str, internet_gateway_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "internetGatewayRuleName": _SERIALIZER.url("internet_gateway_rule_name", internet_gateway_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_internet_gateway_rules_update_request( # pylint: disable=name-too-long + resource_group_name: str, internet_gateway_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "internetGatewayRuleName": _SERIALIZER.url("internet_gateway_rule_name", internet_gateway_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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_internet_gateway_rules_delete_request( # pylint: disable=name-too-long + resource_group_name: str, internet_gateway_rule_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "internetGatewayRuleName": _SERIALIZER.url("internet_gateway_rule_name", internet_gateway_rule_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_internet_gateway_rules_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules" + 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_internet_gateway_rules_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules" + 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_internet_gateways_get_request( + resource_group_name: str, internet_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "internetGatewayName": _SERIALIZER.url("internet_gateway_name", internet_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_internet_gateways_create_request( + resource_group_name: str, internet_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "internetGatewayName": _SERIALIZER.url("internet_gateway_name", internet_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_internet_gateways_update_request( + resource_group_name: str, internet_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "internetGatewayName": _SERIALIZER.url("internet_gateway_name", internet_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_internet_gateways_delete_request( + resource_group_name: str, internet_gateway_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "internetGatewayName": _SERIALIZER.url("internet_gateway_name", internet_gateway_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_internet_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways" + 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_internet_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/internetGateways" + 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_communities_get_request( + resource_group_name: str, ip_community_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities/{ipCommunityName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "ipCommunityName": _SERIALIZER.url("ip_community_name", ip_community_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_ip_communities_create_request( + resource_group_name: str, ip_community_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities/{ipCommunityName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "ipCommunityName": _SERIALIZER.url("ip_community_name", ip_community_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_ip_communities_update_request( + resource_group_name: str, ip_community_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities/{ipCommunityName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "ipCommunityName": _SERIALIZER.url("ip_community_name", ip_community_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_ip_communities_delete_request( + resource_group_name: str, ip_community_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities/{ipCommunityName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "ipCommunityName": _SERIALIZER.url("ip_community_name", ip_community_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_ip_communities_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities" + 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_ip_communities_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/ipCommunities" + 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_extended_communities_get_request( # pylint: disable=name-too-long + resource_group_name: str, ip_extended_community_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "ipExtendedCommunityName": _SERIALIZER.url("ip_extended_community_name", ip_extended_community_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_ip_extended_communities_create_request( # pylint: disable=name-too-long + resource_group_name: str, ip_extended_community_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "ipExtendedCommunityName": _SERIALIZER.url("ip_extended_community_name", ip_extended_community_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_ip_extended_communities_update_request( # pylint: disable=name-too-long + resource_group_name: str, ip_extended_community_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "ipExtendedCommunityName": _SERIALIZER.url("ip_extended_community_name", ip_extended_community_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_ip_extended_communities_delete_request( # pylint: disable=name-too-long + resource_group_name: str, ip_extended_community_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "ipExtendedCommunityName": _SERIALIZER.url("ip_extended_community_name", ip_extended_community_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_ip_extended_communities_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities" + 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_ip_extended_communities_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities" + 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_prefixes_get_request( + resource_group_name: str, 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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/{ipPrefixName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "ipPrefixName": _SERIALIZER.url("ip_prefix_name", ip_prefix_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_ip_prefixes_create_request( + resource_group_name: str, 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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/{ipPrefixName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "ipPrefixName": _SERIALIZER.url("ip_prefix_name", ip_prefix_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_ip_prefixes_update_request( + resource_group_name: str, 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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/{ipPrefixName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "ipPrefixName": _SERIALIZER.url("ip_prefix_name", ip_prefix_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_ip_prefixes_delete_request( + resource_group_name: str, ip_prefix_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/{ipPrefixName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "ipPrefixName": _SERIALIZER.url("ip_prefix_name", ip_prefix_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_ip_prefixes_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes" + 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_ip_prefixes_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes" + 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_l2_isolation_domains_get_request( + resource_group_name: str, l2_isolation_domain_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l2IsolationDomainName": _SERIALIZER.url("l2_isolation_domain_name", l2_isolation_domain_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_l2_isolation_domains_create_request( # pylint: disable=name-too-long + resource_group_name: str, l2_isolation_domain_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l2IsolationDomainName": _SERIALIZER.url("l2_isolation_domain_name", l2_isolation_domain_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_l2_isolation_domains_update_request( # pylint: disable=name-too-long + resource_group_name: str, l2_isolation_domain_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l2IsolationDomainName": _SERIALIZER.url("l2_isolation_domain_name", l2_isolation_domain_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_l2_isolation_domains_delete_request( # pylint: disable=name-too-long + resource_group_name: str, l2_isolation_domain_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l2IsolationDomainName": _SERIALIZER.url("l2_isolation_domain_name", l2_isolation_domain_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_l2_isolation_domains_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains" + 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_l2_isolation_domains_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains" + 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_l2_isolation_domains_update_administrative_state_request( # pylint: disable=name-too-long + resource_group_name: str, l2_isolation_domain_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/updateAdministrativeState" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l2IsolationDomainName": _SERIALIZER.url("l2_isolation_domain_name", l2_isolation_domain_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_l2_isolation_domains_validate_configuration_request( # pylint: disable=name-too-long + resource_group_name: str, l2_isolation_domain_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/validateConfiguration" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l2IsolationDomainName": _SERIALIZER.url("l2_isolation_domain_name", l2_isolation_domain_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_l2_isolation_domains_commit_configuration_request( # pylint: disable=name-too-long + resource_group_name: str, l2_isolation_domain_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/commitConfiguration" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l2IsolationDomainName": _SERIALIZER.url("l2_isolation_domain_name", l2_isolation_domain_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_l3_isolation_domains_get_request( + resource_group_name: str, l3_isolation_domain_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_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_l3_isolation_domains_create_request( # pylint: disable=name-too-long + resource_group_name: str, l3_isolation_domain_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_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_l3_isolation_domains_update_request( # pylint: disable=name-too-long + resource_group_name: str, l3_isolation_domain_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_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_l3_isolation_domains_delete_request( # pylint: disable=name-too-long + resource_group_name: str, l3_isolation_domain_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_l3_isolation_domains_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains" + 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_l3_isolation_domains_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains" + 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_l3_isolation_domains_update_administrative_state_request( # pylint: disable=name-too-long + resource_group_name: str, l3_isolation_domain_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/updateAdministrativeState" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_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_l3_isolation_domains_validate_configuration_request( # pylint: disable=name-too-long + resource_group_name: str, l3_isolation_domain_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/validateConfiguration" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_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_l3_isolation_domains_commit_configuration_request( # pylint: disable=name-too-long + resource_group_name: str, l3_isolation_domain_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/commitConfiguration" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_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_internal_networks_get_request( + resource_group_name: str, + l3_isolation_domain_name: str, + internal_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), + "internalNetworkName": _SERIALIZER.url("internal_network_name", internal_network_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_internal_networks_create_request( + resource_group_name: str, + l3_isolation_domain_name: str, + internal_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), + "internalNetworkName": _SERIALIZER.url("internal_network_name", internal_network_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_internal_networks_update_request( + resource_group_name: str, + l3_isolation_domain_name: str, + internal_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), + "internalNetworkName": _SERIALIZER.url("internal_network_name", internal_network_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_internal_networks_delete_request( + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), + "internalNetworkName": _SERIALIZER.url("internal_network_name", internal_network_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_internal_networks_list_by_l3_isolation_domain_request( # pylint: disable=name-too-long + resource_group_name: str, l3_isolation_domain_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_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_internal_networks_update_administrative_state_request( # pylint: disable=name-too-long + resource_group_name: str, + l3_isolation_domain_name: str, + internal_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateAdministrativeState" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), + "internalNetworkName": _SERIALIZER.url("internal_network_name", internal_network_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_internal_networks_update_bgp_administrative_state_request( # pylint: disable=name-too-long + resource_group_name: str, + l3_isolation_domain_name: str, + internal_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateBgpAdministrativeState" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), + "internalNetworkName": _SERIALIZER.url("internal_network_name", internal_network_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_internal_networks_update_static_route_bfd_administrative_state_request( # pylint: disable=name-too-long + resource_group_name: str, + l3_isolation_domain_name: str, + internal_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateStaticRouteBfdAdministrativeState" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), + "internalNetworkName": _SERIALIZER.url("internal_network_name", internal_network_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_internal_networks_update_bfd_administrative_state_request( # pylint: disable=name-too-long + resource_group_name: str, + l3_isolation_domain_name: str, + internal_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateBfdAdministrativeState" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), + "internalNetworkName": _SERIALIZER.url("internal_network_name", internal_network_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_external_networks_get_request( + resource_group_name: str, + l3_isolation_domain_name: str, + external_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), + "externalNetworkName": _SERIALIZER.url("external_network_name", external_network_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_external_networks_create_request( + resource_group_name: str, + l3_isolation_domain_name: str, + external_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), + "externalNetworkName": _SERIALIZER.url("external_network_name", external_network_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_external_networks_update_request( + resource_group_name: str, + l3_isolation_domain_name: str, + external_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), + "externalNetworkName": _SERIALIZER.url("external_network_name", external_network_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_external_networks_delete_request( + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), + "externalNetworkName": _SERIALIZER.url("external_network_name", external_network_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_external_networks_list_by_l3_isolation_domain_request( # pylint: disable=name-too-long + resource_group_name: str, l3_isolation_domain_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_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_external_networks_update_administrative_state_request( # pylint: disable=name-too-long + resource_group_name: str, + l3_isolation_domain_name: str, + external_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}/updateAdministrativeState" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), + "externalNetworkName": _SERIALIZER.url("external_network_name", external_network_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_external_networks_update_static_route_bfd_administrative_state_request( # pylint: disable=name-too-long + resource_group_name: str, + l3_isolation_domain_name: str, + external_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}/updateStaticRouteBfdAdministrativeState" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), + "externalNetworkName": _SERIALIZER.url("external_network_name", external_network_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_external_networks_update_bfd_administrative_state_request( # pylint: disable=name-too-long + resource_group_name: str, + l3_isolation_domain_name: str, + external_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}/updateBfdAdministrativeState" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "l3IsolationDomainName": _SERIALIZER.url("l3_isolation_domain_name", l3_isolation_domain_name, "str"), + "externalNetworkName": _SERIALIZER.url("external_network_name", external_network_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_neighbor_groups_get_request( + resource_group_name: str, neighbor_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups/{neighborGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "neighborGroupName": _SERIALIZER.url("neighbor_group_name", neighbor_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_neighbor_groups_create_request( + resource_group_name: str, neighbor_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups/{neighborGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "neighborGroupName": _SERIALIZER.url("neighbor_group_name", neighbor_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_neighbor_groups_update_request( + resource_group_name: str, neighbor_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups/{neighborGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "neighborGroupName": _SERIALIZER.url("neighbor_group_name", neighbor_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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_neighbor_groups_delete_request( + resource_group_name: str, neighbor_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups/{neighborGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "neighborGroupName": _SERIALIZER.url("neighbor_group_name", neighbor_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_neighbor_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups" + 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_neighbor_groups_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/neighborGroups" + 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_neighbor_groups_resync_request( + resource_group_name: str, neighbor_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups/{neighborGroupName}/resync" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "neighborGroupName": _SERIALIZER.url("neighbor_group_name", neighbor_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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_device_skus_get_request( + network_device_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkDeviceSkus/{networkDeviceSkuName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "networkDeviceSkuName": _SERIALIZER.url("network_device_sku_name", network_device_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_network_device_skus_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkDeviceSkus" + 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_devices_get_request( + resource_group_name: str, network_device_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_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_devices_create_request( + resource_group_name: str, network_device_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_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_devices_update_request( + resource_group_name: str, network_device_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_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_devices_delete_request( + resource_group_name: str, network_device_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_network_devices_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices" + 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_network_devices_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkDevices" + 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_devices_reboot_request( + resource_group_name: str, network_device_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/reboot" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_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_devices_refresh_configuration_request( # pylint: disable=name-too-long + resource_group_name: str, network_device_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/refreshConfiguration" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_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_network_devices_update_administrative_state_request( # pylint: disable=name-too-long + resource_group_name: str, network_device_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/updateAdministrativeState" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_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_devices_upgrade_request( + resource_group_name: str, network_device_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/upgrade" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_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_devices_run_ro_command_request( # pylint: disable=name-too-long + resource_group_name: str, network_device_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/runRoCommand" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_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_devices_run_rw_command_request( # pylint: disable=name-too-long + resource_group_name: str, network_device_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/runRwCommand" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_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_devices_resync_passwords_request( # pylint: disable=name-too-long + resource_group_name: str, network_device_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/resyncPasswords" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_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_network_devices_resync_certificates_request( # pylint: disable=name-too-long + resource_group_name: str, network_device_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/resyncCertificates" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_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_network_interfaces_get_request( + resource_group_name: str, network_device_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_name, "str"), + "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_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_interfaces_create_request( + resource_group_name: str, network_device_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_name, "str"), + "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_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_interfaces_update_request( + resource_group_name: str, network_device_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_name, "str"), + "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_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_interfaces_delete_request( + resource_group_name: str, network_device_name: str, network_interface_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_name, "str"), + "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_network_interfaces_list_by_network_device_request( # pylint: disable=name-too-long + resource_group_name: str, network_device_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_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_interfaces_update_administrative_state_request( # pylint: disable=name-too-long + resource_group_name: str, network_device_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}/updateAdministrativeState" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkDeviceName": _SERIALIZER.url("network_device_name", network_device_name, "str"), + "networkInterfaceName": _SERIALIZER.url("network_interface_name", network_interface_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_fabric_controllers_get_request( # pylint: disable=name-too-long + resource_group_name: str, network_fabric_controller_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricControllerName": _SERIALIZER.url( + "network_fabric_controller_name", network_fabric_controller_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_fabric_controllers_create_request( # pylint: disable=name-too-long + resource_group_name: str, network_fabric_controller_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricControllerName": _SERIALIZER.url( + "network_fabric_controller_name", network_fabric_controller_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_fabric_controllers_update_request( # pylint: disable=name-too-long + resource_group_name: str, network_fabric_controller_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricControllerName": _SERIALIZER.url( + "network_fabric_controller_name", network_fabric_controller_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_fabric_controllers_delete_request( # pylint: disable=name-too-long + resource_group_name: str, network_fabric_controller_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricControllerName": _SERIALIZER.url( + "network_fabric_controller_name", network_fabric_controller_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_network_fabric_controllers_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers" + 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_network_fabric_controllers_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers" + 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_fabric_skus_get_request( + network_fabric_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkFabricSkus/{networkFabricSkuName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "networkFabricSkuName": _SERIALIZER.url("network_fabric_sku_name", network_fabric_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_network_fabric_skus_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkFabricSkus" + 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_fabrics_get_request( + resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_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_fabrics_create_request( + resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_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_fabrics_update_request( + resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_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_fabrics_delete_request( + resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_network_fabrics_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics" + 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_network_fabrics_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkFabrics" + 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_fabrics_provision_request( + resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/provision" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_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_network_fabrics_deprovision_request( # pylint: disable=name-too-long + resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/deprovision" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_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_network_fabrics_upgrade_request( + resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/upgrade" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_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_fabrics_refresh_configuration_request( # pylint: disable=name-too-long + resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/refreshConfiguration" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_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_network_fabrics_update_workload_management_bfd_configuration_request( # pylint: disable=name-too-long + resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/updateWorkloadManagementBfdConfiguration" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_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_fabrics_update_infra_management_bfd_configuration_request( # pylint: disable=name-too-long + resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/updateInfraManagementBfdConfiguration" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_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_fabrics_validate_configuration_request( # pylint: disable=name-too-long + resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/validateConfiguration" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_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_fabrics_get_topology_request( # pylint: disable=name-too-long + resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/getTopology" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_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_network_fabrics_commit_configuration_request( # pylint: disable=name-too-long + resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/commitConfiguration" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_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_fabrics_commit_batch_status_request( # pylint: disable=name-too-long + resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/commitBatchStatus" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_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_fabrics_discard_commit_batch_request( # pylint: disable=name-too-long + resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/discardCommitBatch" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_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_fabrics_lock_fabric_request( # pylint: disable=name-too-long + resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/lockFabric" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_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_fabrics_view_device_configuration_request( # pylint: disable=name-too-long + resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/viewDeviceConfiguration" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_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_network_fabrics_arm_configuration_diff_request( # pylint: disable=name-too-long + resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/armConfigurationDiff" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_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_network_fabrics_rotate_passwords_request( # pylint: disable=name-too-long + resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/rotatePasswords" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_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_network_fabrics_resync_passwords_request( # pylint: disable=name-too-long + resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/resyncPasswords" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_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_network_fabrics_rotate_certificates_request( # pylint: disable=name-too-long + resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/rotateCertificates" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_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_network_fabrics_resync_certificates_request( # pylint: disable=name-too-long + resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/resyncCertificates" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_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_network_to_network_interconnects_get_request( # pylint: disable=name-too-long + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_name, "str"), + "networkToNetworkInterconnectName": _SERIALIZER.url( + "network_to_network_interconnect_name", network_to_network_interconnect_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_to_network_interconnects_create_request( # pylint: disable=name-too-long + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_name, "str"), + "networkToNetworkInterconnectName": _SERIALIZER.url( + "network_to_network_interconnect_name", network_to_network_interconnect_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_to_network_interconnects_update_request( # pylint: disable=name-too-long + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_name, "str"), + "networkToNetworkInterconnectName": _SERIALIZER.url( + "network_to_network_interconnect_name", network_to_network_interconnect_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_to_network_interconnects_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_name, "str"), + "networkToNetworkInterconnectName": _SERIALIZER.url( + "network_to_network_interconnect_name", network_to_network_interconnect_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_network_to_network_interconnects_list_by_network_fabric_request( # pylint: disable=name-too-long + resource_group_name: str, network_fabric_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_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_to_network_interconnects_update_npb_static_route_bfd_administrative_state_request( # pylint: disable=name-too-long + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}/updateNpbStaticRouteBfdAdministrativeState" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_name, "str"), + "networkToNetworkInterconnectName": _SERIALIZER.url( + "network_to_network_interconnect_name", network_to_network_interconnect_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_to_network_interconnects_update_administrative_state_request( # pylint: disable=name-too-long + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}/updateAdministrativeState" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_name, "str"), + "networkToNetworkInterconnectName": _SERIALIZER.url( + "network_to_network_interconnect_name", network_to_network_interconnect_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_to_network_interconnects_update_bfd_administrative_state_request( # pylint: disable=name-too-long + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}/updateBfdAdministrativeState" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkFabricName": _SERIALIZER.url("network_fabric_name", network_fabric_name, "str"), + "networkToNetworkInterconnectName": _SERIALIZER.url( + "network_to_network_interconnect_name", network_to_network_interconnect_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_packet_brokers_get_request( + resource_group_name: str, network_packet_broker_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/{networkPacketBrokerName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkPacketBrokerName": _SERIALIZER.url("network_packet_broker_name", network_packet_broker_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_packet_brokers_create_request( # pylint: disable=name-too-long + resource_group_name: str, network_packet_broker_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/{networkPacketBrokerName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkPacketBrokerName": _SERIALIZER.url("network_packet_broker_name", network_packet_broker_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_packet_brokers_update_request( # pylint: disable=name-too-long + resource_group_name: str, network_packet_broker_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/{networkPacketBrokerName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkPacketBrokerName": _SERIALIZER.url("network_packet_broker_name", network_packet_broker_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_packet_brokers_delete_request( # pylint: disable=name-too-long + resource_group_name: str, network_packet_broker_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/{networkPacketBrokerName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkPacketBrokerName": _SERIALIZER.url("network_packet_broker_name", network_packet_broker_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_network_packet_brokers_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers" + 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_network_packet_brokers_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers" + 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_racks_get_request( + resource_group_name: str, network_rack_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks/{networkRackName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkRackName": _SERIALIZER.url("network_rack_name", network_rack_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_racks_create_request( + resource_group_name: str, network_rack_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks/{networkRackName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkRackName": _SERIALIZER.url("network_rack_name", network_rack_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_racks_update_request( + resource_group_name: str, network_rack_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks/{networkRackName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkRackName": _SERIALIZER.url("network_rack_name", network_rack_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_racks_delete_request( + resource_group_name: str, network_rack_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks/{networkRackName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkRackName": _SERIALIZER.url("network_rack_name", network_rack_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_network_racks_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks" + 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_network_racks_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkRacks" + 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_tap_rules_get_request( + resource_group_name: str, network_tap_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkTapRuleName": _SERIALIZER.url("network_tap_rule_name", network_tap_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_network_tap_rules_create_request( + resource_group_name: str, network_tap_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkTapRuleName": _SERIALIZER.url("network_tap_rule_name", network_tap_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_network_tap_rules_update_request( + resource_group_name: str, network_tap_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkTapRuleName": _SERIALIZER.url("network_tap_rule_name", network_tap_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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_tap_rules_delete_request( + resource_group_name: str, network_tap_rule_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkTapRuleName": _SERIALIZER.url("network_tap_rule_name", network_tap_rule_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_network_tap_rules_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules" + 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_network_tap_rules_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkTapRules" + 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_tap_rules_update_administrative_state_request( # pylint: disable=name-too-long + resource_group_name: str, network_tap_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}/updateAdministrativeState" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkTapRuleName": _SERIALIZER.url("network_tap_rule_name", network_tap_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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_tap_rules_resync_request( + resource_group_name: str, network_tap_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}/resync" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkTapRuleName": _SERIALIZER.url("network_tap_rule_name", network_tap_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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_tap_rules_validate_configuration_request( # pylint: disable=name-too-long + resource_group_name: str, network_tap_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName}/validateConfiguration" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkTapRuleName": _SERIALIZER.url("network_tap_rule_name", network_tap_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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_taps_get_request( + resource_group_name: str, network_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkTapName": _SERIALIZER.url("network_tap_name", network_tap_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_taps_create_request( + resource_group_name: str, network_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkTapName": _SERIALIZER.url("network_tap_name", network_tap_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_taps_update_request( + resource_group_name: str, network_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkTapName": _SERIALIZER.url("network_tap_name", network_tap_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_taps_delete_request( + resource_group_name: str, network_tap_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkTapName": _SERIALIZER.url("network_tap_name", network_tap_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps" + 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_network_taps_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkTaps" + 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_taps_update_administrative_state_request( # pylint: disable=name-too-long + resource_group_name: str, network_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}/updateAdministrativeState" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkTapName": _SERIALIZER.url("network_tap_name", network_tap_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_taps_resync_request( + resource_group_name: str, network_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName}/resync" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkTapName": _SERIALIZER.url("network_tap_name", network_tap_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_route_policies_get_request( + resource_group_name: str, route_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "routePolicyName": _SERIALIZER.url("route_policy_name", route_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_route_policies_create_request( + resource_group_name: str, route_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "routePolicyName": _SERIALIZER.url("route_policy_name", route_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 + 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_policies_update_request( + resource_group_name: str, route_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "routePolicyName": _SERIALIZER.url("route_policy_name", route_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 + 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_policies_delete_request( + resource_group_name: str, route_policy_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "routePolicyName": _SERIALIZER.url("route_policy_name", route_policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_route_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies" + 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_route_policies_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/routePolicies" + 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_policies_update_administrative_state_request( # pylint: disable=name-too-long + resource_group_name: str, route_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/updateAdministrativeState" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "routePolicyName": _SERIALIZER.url("route_policy_name", route_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 + 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_policies_validate_configuration_request( # pylint: disable=name-too-long + resource_group_name: str, route_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/validateConfiguration" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "routePolicyName": _SERIALIZER.url("route_policy_name", route_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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_route_policies_commit_configuration_request( # pylint: disable=name-too-long + resource_group_name: str, route_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/commitConfiguration" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "routePolicyName": _SERIALIZER.url("route_policy_name", route_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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_monitors_get_request( + resource_group_name: str, network_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkMonitorName": _SERIALIZER.url("network_monitor_name", network_monitor_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_monitors_create_request( + resource_group_name: str, network_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkMonitorName": _SERIALIZER.url("network_monitor_name", network_monitor_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_monitors_update_request( + resource_group_name: str, network_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkMonitorName": _SERIALIZER.url("network_monitor_name", network_monitor_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_monitors_delete_request( + resource_group_name: str, network_monitor_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkMonitorName": _SERIALIZER.url("network_monitor_name", network_monitor_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_network_monitors_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors" + 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_network_monitors_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkMonitors" + 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_monitors_update_administrative_state_request( # pylint: disable=name-too-long + resource_group_name: str, network_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkMonitors/{networkMonitorName}/updateAdministrativeState" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkMonitorName": _SERIALIZER.url("network_monitor_name", network_monitor_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_bootstrap_devices_get_request( # pylint: disable=name-too-long + resource_group_name: str, network_bootstrap_device_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkBootstrapDevices/{networkBootstrapDeviceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkBootstrapDeviceName": _SERIALIZER.url( + "network_bootstrap_device_name", network_bootstrap_device_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_bootstrap_devices_create_request( # pylint: disable=name-too-long + resource_group_name: str, network_bootstrap_device_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkBootstrapDevices/{networkBootstrapDeviceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkBootstrapDeviceName": _SERIALIZER.url( + "network_bootstrap_device_name", network_bootstrap_device_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_bootstrap_devices_update_request( # pylint: disable=name-too-long + resource_group_name: str, network_bootstrap_device_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkBootstrapDevices/{networkBootstrapDeviceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkBootstrapDeviceName": _SERIALIZER.url( + "network_bootstrap_device_name", network_bootstrap_device_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_bootstrap_devices_delete_request( # pylint: disable=name-too-long + resource_group_name: str, network_bootstrap_device_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkBootstrapDevices/{networkBootstrapDeviceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkBootstrapDeviceName": _SERIALIZER.url( + "network_bootstrap_device_name", network_bootstrap_device_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_network_bootstrap_devices_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkBootstrapDevices" + 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_network_bootstrap_devices_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkBootstrapDevices" + 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_bootstrap_devices_reboot_request( # pylint: disable=name-too-long + resource_group_name: str, network_bootstrap_device_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkBootstrapDevices/{networkBootstrapDeviceName}/reboot" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkBootstrapDeviceName": _SERIALIZER.url( + "network_bootstrap_device_name", network_bootstrap_device_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_network_bootstrap_devices_refresh_configuration_request( # pylint: disable=name-too-long + resource_group_name: str, network_bootstrap_device_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkBootstrapDevices/{networkBootstrapDeviceName}/refreshConfiguration" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkBootstrapDeviceName": _SERIALIZER.url( + "network_bootstrap_device_name", network_bootstrap_device_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_network_bootstrap_devices_upgrade_request( # pylint: disable=name-too-long + resource_group_name: str, network_bootstrap_device_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkBootstrapDevices/{networkBootstrapDeviceName}/upgrade" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkBootstrapDeviceName": _SERIALIZER.url( + "network_bootstrap_device_name", network_bootstrap_device_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_bootstrap_devices_update_administrative_state_request( # pylint: disable=name-too-long + resource_group_name: str, network_bootstrap_device_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkBootstrapDevices/{networkBootstrapDeviceName}/updateAdministrativeState" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkBootstrapDeviceName": _SERIALIZER.url( + "network_bootstrap_device_name", network_bootstrap_device_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_bootstrap_devices_resync_passwords_request( # pylint: disable=name-too-long + resource_group_name: str, network_bootstrap_device_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkBootstrapDevices/{networkBootstrapDeviceName}/resyncPasswords" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkBootstrapDeviceName": _SERIALIZER.url( + "network_bootstrap_device_name", network_bootstrap_device_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_network_bootstrap_interfaces_get_request( # pylint: disable=name-too-long + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_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", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkBootstrapDevices/{networkBootstrapDeviceName}/networkBootstrapInterfaces/{networkBootstrapInterfaceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkBootstrapDeviceName": _SERIALIZER.url( + "network_bootstrap_device_name", network_bootstrap_device_name, "str" + ), + "networkBootstrapInterfaceName": _SERIALIZER.url( + "network_bootstrap_interface_name", network_bootstrap_interface_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_bootstrap_interfaces_create_request( # pylint: disable=name-too-long + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkBootstrapDevices/{networkBootstrapDeviceName}/networkBootstrapInterfaces/{networkBootstrapInterfaceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkBootstrapDeviceName": _SERIALIZER.url( + "network_bootstrap_device_name", network_bootstrap_device_name, "str" + ), + "networkBootstrapInterfaceName": _SERIALIZER.url( + "network_bootstrap_interface_name", network_bootstrap_interface_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_bootstrap_interfaces_update_request( # pylint: disable=name-too-long + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkBootstrapDevices/{networkBootstrapDeviceName}/networkBootstrapInterfaces/{networkBootstrapInterfaceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkBootstrapDeviceName": _SERIALIZER.url( + "network_bootstrap_device_name", network_bootstrap_device_name, "str" + ), + "networkBootstrapInterfaceName": _SERIALIZER.url( + "network_bootstrap_interface_name", network_bootstrap_interface_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_bootstrap_interfaces_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkBootstrapDevices/{networkBootstrapDeviceName}/networkBootstrapInterfaces/{networkBootstrapInterfaceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkBootstrapDeviceName": _SERIALIZER.url( + "network_bootstrap_device_name", network_bootstrap_device_name, "str" + ), + "networkBootstrapInterfaceName": _SERIALIZER.url( + "network_bootstrap_interface_name", network_bootstrap_interface_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_network_bootstrap_interfaces_list_by_network_bootstrap_device_request( # pylint: disable=name-too-long + resource_group_name: str, network_bootstrap_device_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkBootstrapDevices/{networkBootstrapDeviceName}/networkBootstrapInterfaces" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkBootstrapDeviceName": _SERIALIZER.url( + "network_bootstrap_device_name", network_bootstrap_device_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_bootstrap_interfaces_update_administrative_state_request( # pylint: disable=name-too-long + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-07-15")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkBootstrapDevices/{networkBootstrapDeviceName}/networkBootstrapInterfaces/{networkBootstrapInterfaceName}/updateAdministrativeState" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "networkBootstrapDeviceName": _SERIALIZER.url( + "network_bootstrap_device_name", network_bootstrap_device_name, "str" + ), + "networkBootstrapInterfaceName": _SERIALIZER.url( + "network_bootstrap_interface_name", network_bootstrap_interface_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) + + class Operations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricMgmtClient`'s - :attr:`operations` attribute. + :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricClient`'s + :attr:`operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: + """List the operations for the provider. + + :return: An iterator like instance of Operation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Operation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class AccessControlListsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricClient`'s + :attr:`access_control_lists` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, access_control_list_name: str, **kwargs: Any) -> _models.AccessControlList: + """Implements Access Control List GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :return: AccessControlList. The AccessControlList is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.AccessControlList + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AccessControlList] = kwargs.pop("cls", None) + + _request = build_access_control_lists_get_request( + resource_group_name=resource_group_name, + access_control_list_name=access_control_list_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.AccessControlList, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( + self, + resource_group_name: str, + access_control_list_name: str, + body: Union[_models.AccessControlList, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_access_control_lists_create_request( + resource_group_name=resource_group_name, + access_control_list_name=access_control_list_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + access_control_list_name: str, + body: _models.AccessControlList, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AccessControlList]: + """Implements Access Control List PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.AccessControlList + :keyword content_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 AccessControlList. The AccessControlList is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.AccessControlList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + access_control_list_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AccessControlList]: + """Implements Access Control List PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 AccessControlList. The AccessControlList is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.AccessControlList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + access_control_list_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AccessControlList]: + """Implements Access Control List PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :param body: Request payload. Required. + :type body: IO[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 AccessControlList. The AccessControlList is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.AccessControlList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + access_control_list_name: str, + body: Union[_models.AccessControlList, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.AccessControlList]: + """Implements Access Control List PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :param body: Request payload. Is one of the following types: AccessControlList, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.AccessControlList or JSON or IO[bytes] + :return: An instance of LROPoller that returns AccessControlList. The AccessControlList is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.AccessControlList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AccessControlList] = 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, + access_control_list_name=access_control_list_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.AccessControlList, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.AccessControlList].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AccessControlList]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + access_control_list_name: str, + body: Union[_models.AccessControlListPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_access_control_lists_update_request( + resource_group_name=resource_group_name, + access_control_list_name=access_control_list_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + access_control_list_name: str, + body: _models.AccessControlListPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AccessControlList]: + """API to update certain properties of the Access Control List resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :param body: Access Control List properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.AccessControlListPatch + :keyword content_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 AccessControlList. The AccessControlList is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.AccessControlList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + access_control_list_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AccessControlList]: + """API to update certain properties of the Access Control List resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :param body: Access Control List properties to update. Required. + :type body: JSON + :keyword content_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 AccessControlList. The AccessControlList is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.AccessControlList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + access_control_list_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AccessControlList]: + """API to update certain properties of the Access Control List resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :param body: Access Control List properties to update. Required. + :type body: IO[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 AccessControlList. The AccessControlList is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.AccessControlList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + access_control_list_name: str, + body: Union[_models.AccessControlListPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.AccessControlList]: + """API to update certain properties of the Access Control List resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :param body: Access Control List properties to update. Is one of the following types: + AccessControlListPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.AccessControlListPatch or JSON or IO[bytes] + :return: An instance of LROPoller that returns AccessControlList. The AccessControlList is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.AccessControlList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AccessControlList] = 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, + access_control_list_name=access_control_list_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.AccessControlList, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.AccessControlList].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AccessControlList]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, access_control_list_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_access_control_lists_delete_request( + resource_group_name=resource_group_name, + access_control_list_name=access_control_list_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: 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]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, access_control_list_name: str, **kwargs: Any) -> LROPoller[None]: + """Implements Access Control List DELETE method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + access_control_list_name=access_control_list_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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) -> ItemPaged["_models.AccessControlList"]: + """Implements AccessControlLists list by resource group GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of AccessControlList + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.AccessControlList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AccessControlList]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_access_control_lists_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.AccessControlList], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> ItemPaged["_models.AccessControlList"]: + """Implements AccessControlLists list by subscription GET method. + + :return: An iterator like instance of AccessControlList + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.AccessControlList] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AccessControlList]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_access_control_lists_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.AccessControlList], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "access_control_list_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _update_administrative_state_initial( + self, + resource_group_name: str, + access_control_list_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_access_control_lists_update_administrative_state_request( + resource_group_name=resource_group_name, + access_control_list_name=access_control_list_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + access_control_list_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + access_control_list_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + access_control_list_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :param body: Request payload. Required. + :type body: IO[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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "access_control_list_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_update_administrative_state( + self, + resource_group_name: str, + access_control_list_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of LROPoller that returns UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateAdministrativeStateResponse] = 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_administrative_state_initial( + resource_group_name=resource_group_name, + access_control_list_name=access_control_list_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.UpdateAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.UpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.UpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _resync_initial( + self, resource_group_name: str, access_control_list_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_access_control_lists_resync_request( + resource_group_name=resource_group_name, + access_control_list_name=access_control_list_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_resync( + self, resource_group_name: str, access_control_list_name: str, **kwargs: Any + ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :return: An instance of LROPoller that returns CommonPostActionResponseForStateUpdate. The + CommonPostActionResponseForStateUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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._resync_initial( + resource_group_name=resource_group_name, + access_control_list_name=access_control_list_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.CommonPostActionResponseForStateUpdate, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.CommonPostActionResponseForStateUpdate].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.CommonPostActionResponseForStateUpdate]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _validate_configuration_initial( + self, resource_group_name: str, access_control_list_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_access_control_lists_validate_configuration_request( + resource_group_name=resource_group_name, + access_control_list_name=access_control_list_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_validate_configuration( + self, resource_group_name: str, access_control_list_name: str, **kwargs: Any + ) -> LROPoller[_models.ValidateConfigurationResponse]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param access_control_list_name: Name of the Access Control List. Required. + :type access_control_list_name: str + :return: An instance of LROPoller that returns ValidateConfigurationResponse. The + ValidateConfigurationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ValidateConfigurationResponse] = 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._validate_configuration_initial( + resource_group_name=resource_group_name, + access_control_list_name=access_control_list_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ValidateConfigurationResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ValidateConfigurationResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ValidateConfigurationResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class InternetGatewayRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricClient`'s + :attr:`internet_gateway_rules` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, internet_gateway_rule_name: str, **kwargs: Any + ) -> _models.InternetGatewayRule: + """Gets an Internet Gateway Rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. + :type internet_gateway_rule_name: str + :return: InternetGatewayRule. The InternetGatewayRule is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.InternetGatewayRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.InternetGatewayRule] = kwargs.pop("cls", None) + + _request = build_internet_gateway_rules_get_request( + resource_group_name=resource_group_name, + internet_gateway_rule_name=internet_gateway_rule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.InternetGatewayRule, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( + self, + resource_group_name: str, + internet_gateway_rule_name: str, + body: Union[_models.InternetGatewayRule, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_internet_gateway_rules_create_request( + resource_group_name=resource_group_name, + internet_gateway_rule_name=internet_gateway_rule_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + internet_gateway_rule_name: str, + body: _models.InternetGatewayRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InternetGatewayRule]: + """Creates an Internet Gateway rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. + :type internet_gateway_rule_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.InternetGatewayRule + :keyword content_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 InternetGatewayRule. The InternetGatewayRule is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + internet_gateway_rule_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InternetGatewayRule]: + """Creates an Internet Gateway rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. + :type internet_gateway_rule_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 InternetGatewayRule. The InternetGatewayRule is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + internet_gateway_rule_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InternetGatewayRule]: + """Creates an Internet Gateway rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. + :type internet_gateway_rule_name: str + :param body: Request payload. Required. + :type body: IO[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 InternetGatewayRule. The InternetGatewayRule is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + internet_gateway_rule_name: str, + body: Union[_models.InternetGatewayRule, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.InternetGatewayRule]: + """Creates an Internet Gateway rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. + :type internet_gateway_rule_name: str + :param body: Request payload. Is one of the following types: InternetGatewayRule, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.InternetGatewayRule or JSON or IO[bytes] + :return: An instance of LROPoller that returns InternetGatewayRule. The InternetGatewayRule is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InternetGatewayRule] = 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, + internet_gateway_rule_name=internet_gateway_rule_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.InternetGatewayRule, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.InternetGatewayRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.InternetGatewayRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + internet_gateway_rule_name: str, + body: Union[_models.InternetGatewayRulePatch, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_internet_gateway_rules_update_request( + resource_group_name=resource_group_name, + internet_gateway_rule_name=internet_gateway_rule_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + internet_gateway_rule_name: str, + body: _models.InternetGatewayRulePatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InternetGatewayRule]: + """API to update certain properties of the Internet Gateway Rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. + :type internet_gateway_rule_name: str + :param body: Internet Gateway Rule properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.InternetGatewayRulePatch + :keyword content_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 InternetGatewayRule. The InternetGatewayRule is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + internet_gateway_rule_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InternetGatewayRule]: + """API to update certain properties of the Internet Gateway Rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. + :type internet_gateway_rule_name: str + :param body: Internet Gateway Rule properties to update. Required. + :type body: JSON + :keyword content_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 InternetGatewayRule. The InternetGatewayRule is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + internet_gateway_rule_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InternetGatewayRule]: + """API to update certain properties of the Internet Gateway Rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. + :type internet_gateway_rule_name: str + :param body: Internet Gateway Rule properties to update. Required. + :type body: IO[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 InternetGatewayRule. The InternetGatewayRule is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + internet_gateway_rule_name: str, + body: Union[_models.InternetGatewayRulePatch, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.InternetGatewayRule]: + """API to update certain properties of the Internet Gateway Rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. + :type internet_gateway_rule_name: str + :param body: Internet Gateway Rule properties to update. Is one of the following types: + InternetGatewayRulePatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.InternetGatewayRulePatch or JSON or + IO[bytes] + :return: An instance of LROPoller that returns InternetGatewayRule. The InternetGatewayRule is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InternetGatewayRule] = 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, + internet_gateway_rule_name=internet_gateway_rule_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.InternetGatewayRule, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.InternetGatewayRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.InternetGatewayRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, internet_gateway_rule_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_internet_gateway_rules_delete_request( + resource_group_name=resource_group_name, + internet_gateway_rule_name=internet_gateway_rule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: 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]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, internet_gateway_rule_name: str, **kwargs: Any) -> LROPoller[None]: + """Implements Internet Gateway Rules DELETE method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_rule_name: Name of the Internet Gateway rule. Required. + :type internet_gateway_rule_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + internet_gateway_rule_name=internet_gateway_rule_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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 + ) -> ItemPaged["_models.InternetGatewayRule"]: + """Implements Internet Gateway Rules list by resource group GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of InternetGatewayRule + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.InternetGatewayRule]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_internet_gateway_rules_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.InternetGatewayRule], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> ItemPaged["_models.InternetGatewayRule"]: + """List all Internet Gateway rules in the given subscription. + + :return: An iterator like instance of InternetGatewayRule + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.InternetGatewayRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.InternetGatewayRule]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_internet_gateway_rules_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.InternetGatewayRule], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class InternetGatewaysOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricClient`'s + :attr:`internet_gateways` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, internet_gateway_name: str, **kwargs: Any) -> _models.InternetGateway: + """Implements Gateway GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_name: Name of the Internet Gateway. Required. + :type internet_gateway_name: str + :return: InternetGateway. The InternetGateway is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.InternetGateway + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.InternetGateway] = kwargs.pop("cls", None) + + _request = build_internet_gateways_get_request( + resource_group_name=resource_group_name, + internet_gateway_name=internet_gateway_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.InternetGateway, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( + self, + resource_group_name: str, + internet_gateway_name: str, + body: Union[_models.InternetGateway, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_internet_gateways_create_request( + resource_group_name=resource_group_name, + internet_gateway_name=internet_gateway_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + internet_gateway_name: str, + body: _models.InternetGateway, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InternetGateway]: + """Creates a Network Fabric Service Internet Gateway resource instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_name: Name of the Internet Gateway. Required. + :type internet_gateway_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.InternetGateway + :keyword content_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 InternetGateway. The InternetGateway is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternetGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + internet_gateway_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InternetGateway]: + """Creates a Network Fabric Service Internet Gateway resource instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_name: Name of the Internet Gateway. Required. + :type internet_gateway_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 InternetGateway. The InternetGateway is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternetGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + internet_gateway_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InternetGateway]: + """Creates a Network Fabric Service Internet Gateway resource instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_name: Name of the Internet Gateway. Required. + :type internet_gateway_name: str + :param body: Request payload. Required. + :type body: IO[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 InternetGateway. The InternetGateway is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternetGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + internet_gateway_name: str, + body: Union[_models.InternetGateway, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.InternetGateway]: + """Creates a Network Fabric Service Internet Gateway resource instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_name: Name of the Internet Gateway. Required. + :type internet_gateway_name: str + :param body: Request payload. Is one of the following types: InternetGateway, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.InternetGateway or JSON or IO[bytes] + :return: An instance of LROPoller that returns InternetGateway. The InternetGateway is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternetGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InternetGateway] = 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, + internet_gateway_name=internet_gateway_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.InternetGateway, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.InternetGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.InternetGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + internet_gateway_name: str, + body: Union[_models.InternetGatewayPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_internet_gateways_update_request( + resource_group_name=resource_group_name, + internet_gateway_name=internet_gateway_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + internet_gateway_name: str, + body: _models.InternetGatewayPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InternetGateway]: + """Execute patch on Network Fabric Service Internet Gateway. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_name: Name of the Internet Gateway. Required. + :type internet_gateway_name: str + :param body: API to update certain properties of the InternetGateway resource.. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.InternetGatewayPatch + :keyword content_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 InternetGateway. The InternetGateway is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternetGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + internet_gateway_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InternetGateway]: + """Execute patch on Network Fabric Service Internet Gateway. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_name: Name of the Internet Gateway. Required. + :type internet_gateway_name: str + :param body: API to update certain properties of the InternetGateway resource.. Required. + :type body: JSON + :keyword content_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 InternetGateway. The InternetGateway is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternetGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + internet_gateway_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InternetGateway]: + """Execute patch on Network Fabric Service Internet Gateway. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_name: Name of the Internet Gateway. Required. + :type internet_gateway_name: str + :param body: API to update certain properties of the InternetGateway resource.. Required. + :type body: IO[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 InternetGateway. The InternetGateway is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternetGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + internet_gateway_name: str, + body: Union[_models.InternetGatewayPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.InternetGateway]: + """Execute patch on Network Fabric Service Internet Gateway. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_name: Name of the Internet Gateway. Required. + :type internet_gateway_name: str + :param body: API to update certain properties of the InternetGateway resource.. Is one of the + following types: InternetGatewayPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.InternetGatewayPatch or JSON or IO[bytes] + :return: An instance of LROPoller that returns InternetGateway. The InternetGateway is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternetGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InternetGateway] = 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, + internet_gateway_name=internet_gateway_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.InternetGateway, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.InternetGateway].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.InternetGateway]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, resource_group_name: str, internet_gateway_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_internet_gateways_delete_request( + resource_group_name=resource_group_name, + internet_gateway_name=internet_gateway_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: 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]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, internet_gateway_name: str, **kwargs: Any) -> LROPoller[None]: + """Execute a delete on Network Fabric Service Internet Gateway. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param internet_gateway_name: Name of the Internet Gateway. Required. + :type internet_gateway_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + internet_gateway_name=internet_gateway_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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) -> ItemPaged["_models.InternetGateway"]: + """Displays Internet Gateways list by resource group GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of InternetGateway + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.InternetGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.InternetGateway]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_internet_gateways_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.InternetGateway], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> ItemPaged["_models.InternetGateway"]: + """Displays Internet Gateways list by subscription GET method. + + :return: An iterator like instance of InternetGateway + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.InternetGateway] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.InternetGateway]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_internet_gateways_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.InternetGateway], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class IpCommunitiesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricClient`'s + :attr:`ip_communities` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, ip_community_name: str, **kwargs: Any) -> _models.IpCommunity: + """Implements an IP Community GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_community_name: Name of the IP Community. Required. + :type ip_community_name: str + :return: IpCommunity. The IpCommunity is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.IpCommunity + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.IpCommunity] = kwargs.pop("cls", None) + + _request = build_ip_communities_get_request( + resource_group_name=resource_group_name, + ip_community_name=ip_community_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.IpCommunity, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( + self, + resource_group_name: str, + ip_community_name: str, + body: Union[_models.IpCommunity, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ip_communities_create_request( + resource_group_name=resource_group_name, + ip_community_name=ip_community_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + ip_community_name: str, + body: _models.IpCommunity, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IpCommunity]: + """Implements an IP Community PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_community_name: Name of the IP Community. Required. + :type ip_community_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.IpCommunity + :keyword content_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 IpCommunity. The IpCommunity is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + ip_community_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IpCommunity]: + """Implements an IP Community PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_community_name: Name of the IP Community. Required. + :type ip_community_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 IpCommunity. The IpCommunity is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + ip_community_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IpCommunity]: + """Implements an IP Community PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_community_name: Name of the IP Community. Required. + :type ip_community_name: str + :param body: Request payload. Required. + :type body: IO[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 IpCommunity. The IpCommunity is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + ip_community_name: str, + body: Union[_models.IpCommunity, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.IpCommunity]: + """Implements an IP Community PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_community_name: Name of the IP Community. Required. + :type ip_community_name: str + :param body: Request payload. Is one of the following types: IpCommunity, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.IpCommunity or JSON or IO[bytes] + :return: An instance of LROPoller that returns IpCommunity. The IpCommunity is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IpCommunity] = 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, + ip_community_name=ip_community_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.IpCommunity, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.IpCommunity].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.IpCommunity]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + ip_community_name: str, + body: Union[_models.IpCommunityPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ip_communities_update_request( + resource_group_name=resource_group_name, + ip_community_name=ip_community_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + ip_community_name: str, + body: _models.IpCommunityPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IpCommunity]: + """API to update certain properties of the IP Community resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_community_name: Name of the IP Community. Required. + :type ip_community_name: str + :param body: IP Community properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.IpCommunityPatch + :keyword content_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 IpCommunity. The IpCommunity is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + ip_community_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IpCommunity]: + """API to update certain properties of the IP Community resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_community_name: Name of the IP Community. Required. + :type ip_community_name: str + :param body: IP Community properties to update. Required. + :type body: JSON + :keyword content_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 IpCommunity. The IpCommunity is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + ip_community_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IpCommunity]: + """API to update certain properties of the IP Community resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_community_name: Name of the IP Community. Required. + :type ip_community_name: str + :param body: IP Community properties to update. Required. + :type body: IO[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 IpCommunity. The IpCommunity is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + ip_community_name: str, + body: Union[_models.IpCommunityPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.IpCommunity]: + """API to update certain properties of the IP Community resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_community_name: Name of the IP Community. Required. + :type ip_community_name: str + :param body: IP Community properties to update. Is one of the following types: + IpCommunityPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.IpCommunityPatch or JSON or IO[bytes] + :return: An instance of LROPoller that returns IpCommunity. The IpCommunity is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IpCommunity] = 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, + ip_community_name=ip_community_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.IpCommunity, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.IpCommunity].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.IpCommunity]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, resource_group_name: str, ip_community_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_ip_communities_delete_request( + resource_group_name=resource_group_name, + ip_community_name=ip_community_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: 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]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, ip_community_name: str, **kwargs: Any) -> LROPoller[None]: + """Implements IP Community DELETE method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_community_name: Name of the IP Community. Required. + :type ip_community_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + ip_community_name=ip_community_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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) -> ItemPaged["_models.IpCommunity"]: + """Implements IP Communities list by resource group GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of IpCommunity + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.IpCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.IpCommunity]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_communities_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.IpCommunity], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> ItemPaged["_models.IpCommunity"]: + """Implements IP Communities list by subscription GET method. + + :return: An iterator like instance of IpCommunity + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.IpCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.IpCommunity]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_communities_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.IpCommunity], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class IpExtendedCommunitiesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricClient`'s + :attr:`ip_extended_communities` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, ip_extended_community_name: str, **kwargs: Any + ) -> _models.IpExtendedCommunity: + """Implements IP Extended Community GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_extended_community_name: Name of the IP Extended Community. Required. + :type ip_extended_community_name: str + :return: IpExtendedCommunity. The IpExtendedCommunity is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.IpExtendedCommunity] = kwargs.pop("cls", None) + + _request = build_ip_extended_communities_get_request( + resource_group_name=resource_group_name, + ip_extended_community_name=ip_extended_community_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.IpExtendedCommunity, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( + self, + resource_group_name: str, + ip_extended_community_name: str, + body: Union[_models.IpExtendedCommunity, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ip_extended_communities_create_request( + resource_group_name=resource_group_name, + ip_extended_community_name=ip_extended_community_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + ip_extended_community_name: str, + body: _models.IpExtendedCommunity, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IpExtendedCommunity]: + """Implements IP Extended Community PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_extended_community_name: Name of the IP Extended Community. Required. + :type ip_extended_community_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity + :keyword content_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 IpExtendedCommunity. The IpExtendedCommunity is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + ip_extended_community_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IpExtendedCommunity]: + """Implements IP Extended Community PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_extended_community_name: Name of the IP Extended Community. Required. + :type ip_extended_community_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 IpExtendedCommunity. The IpExtendedCommunity is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + ip_extended_community_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IpExtendedCommunity]: + """Implements IP Extended Community PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_extended_community_name: Name of the IP Extended Community. Required. + :type ip_extended_community_name: str + :param body: Request payload. Required. + :type body: IO[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 IpExtendedCommunity. The IpExtendedCommunity is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + ip_extended_community_name: str, + body: Union[_models.IpExtendedCommunity, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.IpExtendedCommunity]: + """Implements IP Extended Community PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_extended_community_name: Name of the IP Extended Community. Required. + :type ip_extended_community_name: str + :param body: Request payload. Is one of the following types: IpExtendedCommunity, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity or JSON or IO[bytes] + :return: An instance of LROPoller that returns IpExtendedCommunity. The IpExtendedCommunity is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IpExtendedCommunity] = 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, + ip_extended_community_name=ip_extended_community_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.IpExtendedCommunity, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.IpExtendedCommunity].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.IpExtendedCommunity]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + ip_extended_community_name: str, + body: Union[_models.IpExtendedCommunityPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ip_extended_communities_update_request( + resource_group_name=resource_group_name, + ip_extended_community_name=ip_extended_community_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + ip_extended_community_name: str, + body: _models.IpExtendedCommunityPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IpExtendedCommunity]: + """API to update certain properties of the IP Extended Community resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_extended_community_name: Name of the IP Extended Community. Required. + :type ip_extended_community_name: str + :param body: IP Extended Community properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityPatch + :keyword content_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 IpExtendedCommunity. The IpExtendedCommunity is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + ip_extended_community_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IpExtendedCommunity]: + """API to update certain properties of the IP Extended Community resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_extended_community_name: Name of the IP Extended Community. Required. + :type ip_extended_community_name: str + :param body: IP Extended Community properties to update. Required. + :type body: JSON + :keyword content_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 IpExtendedCommunity. The IpExtendedCommunity is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + ip_extended_community_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IpExtendedCommunity]: + """API to update certain properties of the IP Extended Community resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_extended_community_name: Name of the IP Extended Community. Required. + :type ip_extended_community_name: str + :param body: IP Extended Community properties to update. Required. + :type body: IO[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 IpExtendedCommunity. The IpExtendedCommunity is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + ip_extended_community_name: str, + body: Union[_models.IpExtendedCommunityPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.IpExtendedCommunity]: + """API to update certain properties of the IP Extended Community resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_extended_community_name: Name of the IP Extended Community. Required. + :type ip_extended_community_name: str + :param body: IP Extended Community properties to update. Is one of the following types: + IpExtendedCommunityPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.IpExtendedCommunityPatch or JSON or + IO[bytes] + :return: An instance of LROPoller that returns IpExtendedCommunity. The IpExtendedCommunity is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IpExtendedCommunity] = 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, + ip_extended_community_name=ip_extended_community_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.IpExtendedCommunity, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.IpExtendedCommunity].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.IpExtendedCommunity]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, ip_extended_community_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_ip_extended_communities_delete_request( + resource_group_name=resource_group_name, + ip_extended_community_name=ip_extended_community_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: 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]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, ip_extended_community_name: str, **kwargs: Any) -> LROPoller[None]: + """Implements IP Extended Community DELETE method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_extended_community_name: Name of the IP Extended Community. Required. + :type ip_extended_community_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + ip_extended_community_name=ip_extended_community_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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 + ) -> ItemPaged["_models.IpExtendedCommunity"]: + """Implements IpExtendedCommunities list by resource group GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of IpExtendedCommunity + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.IpExtendedCommunity]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_extended_communities_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.IpExtendedCommunity], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> ItemPaged["_models.IpExtendedCommunity"]: + """Implements IpExtendedCommunities list by subscription GET method. + + :return: An iterator like instance of IpExtendedCommunity + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.IpExtendedCommunity] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.IpExtendedCommunity]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_extended_communities_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.IpExtendedCommunity], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class IpPrefixesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricClient`'s + :attr:`ip_prefixes` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, ip_prefix_name: str, **kwargs: Any) -> _models.IpPrefix: + """Implements IP Prefix GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_prefix_name: Name of the IP Prefix. Required. + :type ip_prefix_name: str + :return: IpPrefix. The IpPrefix is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.IpPrefix + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.IpPrefix] = kwargs.pop("cls", None) + + _request = build_ip_prefixes_get_request( + resource_group_name=resource_group_name, + ip_prefix_name=ip_prefix_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.IpPrefix, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( + self, + resource_group_name: str, + ip_prefix_name: str, + body: Union[_models.IpPrefix, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ip_prefixes_create_request( + resource_group_name=resource_group_name, + ip_prefix_name=ip_prefix_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + ip_prefix_name: str, + body: _models.IpPrefix, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IpPrefix]: + """Implements IP Prefix PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_prefix_name: Name of the IP Prefix. Required. + :type ip_prefix_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.IpPrefix + :keyword content_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 IpPrefix. The IpPrefix is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + ip_prefix_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IpPrefix]: + """Implements IP Prefix PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_prefix_name: Name of the IP Prefix. Required. + :type ip_prefix_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 IpPrefix. The IpPrefix is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + ip_prefix_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IpPrefix]: + """Implements IP Prefix PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_prefix_name: Name of the IP Prefix. Required. + :type ip_prefix_name: str + :param body: Request payload. Required. + :type body: IO[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 IpPrefix. The IpPrefix is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + ip_prefix_name: str, + body: Union[_models.IpPrefix, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.IpPrefix]: + """Implements IP Prefix PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_prefix_name: Name of the IP Prefix. Required. + :type ip_prefix_name: str + :param body: Request payload. Is one of the following types: IpPrefix, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.IpPrefix or JSON or IO[bytes] + :return: An instance of LROPoller that returns IpPrefix. The IpPrefix is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IpPrefix] = 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, + ip_prefix_name=ip_prefix_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.IpPrefix, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.IpPrefix].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.IpPrefix]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + ip_prefix_name: str, + body: Union[_models.IpPrefixPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ip_prefixes_update_request( + resource_group_name=resource_group_name, + ip_prefix_name=ip_prefix_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + ip_prefix_name: str, + body: _models.IpPrefixPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IpPrefix]: + """API to update certain properties of the IP Prefix resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_prefix_name: Name of the IP Prefix. Required. + :type ip_prefix_name: str + :param body: IP Prefix properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.IpPrefixPatch + :keyword content_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 IpPrefix. The IpPrefix is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + ip_prefix_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IpPrefix]: + """API to update certain properties of the IP Prefix resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_prefix_name: Name of the IP Prefix. Required. + :type ip_prefix_name: str + :param body: IP Prefix properties to update. Required. + :type body: JSON + :keyword content_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 IpPrefix. The IpPrefix is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + ip_prefix_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IpPrefix]: + """API to update certain properties of the IP Prefix resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_prefix_name: Name of the IP Prefix. Required. + :type ip_prefix_name: str + :param body: IP Prefix properties to update. Required. + :type body: IO[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 IpPrefix. The IpPrefix is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + ip_prefix_name: str, + body: Union[_models.IpPrefixPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.IpPrefix]: + """API to update certain properties of the IP Prefix resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_prefix_name: Name of the IP Prefix. Required. + :type ip_prefix_name: str + :param body: IP Prefix properties to update. Is one of the following types: IpPrefixPatch, + JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.IpPrefixPatch or JSON or IO[bytes] + :return: An instance of LROPoller that returns IpPrefix. The IpPrefix is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.IpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IpPrefix] = 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, + ip_prefix_name=ip_prefix_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.IpPrefix, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.IpPrefix].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.IpPrefix]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, resource_group_name: str, ip_prefix_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_ip_prefixes_delete_request( + resource_group_name=resource_group_name, + ip_prefix_name=ip_prefix_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: 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]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, ip_prefix_name: str, **kwargs: Any) -> LROPoller[None]: + """Implements IP Prefix DELETE method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ip_prefix_name: Name of the IP Prefix. Required. + :type ip_prefix_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + ip_prefix_name=ip_prefix_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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) -> ItemPaged["_models.IpPrefix"]: + """Implements IpPrefixes list by resource group GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of IpPrefix + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.IpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.IpPrefix]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_prefixes_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.IpPrefix], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> ItemPaged["_models.IpPrefix"]: + """Implements IpPrefixes list by subscription GET method. + + :return: An iterator like instance of IpPrefix + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.IpPrefix] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.IpPrefix]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_prefixes_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.IpPrefix], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class L2IsolationDomainsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricClient`'s + :attr:`l2_isolation_domains` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, l2_isolation_domain_name: str, **kwargs: Any) -> _models.L2IsolationDomain: + """Implements L2 Isolation Domain GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :return: L2IsolationDomain. The L2IsolationDomain is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.L2IsolationDomain + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.L2IsolationDomain] = kwargs.pop("cls", None) + + _request = build_l2_isolation_domains_get_request( + resource_group_name=resource_group_name, + l2_isolation_domain_name=l2_isolation_domain_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.L2IsolationDomain, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( + self, + resource_group_name: str, + l2_isolation_domain_name: str, + body: Union[_models.L2IsolationDomain, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_l2_isolation_domains_create_request( + resource_group_name=resource_group_name, + l2_isolation_domain_name=l2_isolation_domain_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + l2_isolation_domain_name: str, + body: _models.L2IsolationDomain, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.L2IsolationDomain]: + """Creates layer 2 network connectivity between compute nodes within a rack and across racks.The + configuration is applied on the devices only after the isolation domain is enabled. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.L2IsolationDomain + :keyword content_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 L2IsolationDomain. The L2IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + l2_isolation_domain_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.L2IsolationDomain]: + """Creates layer 2 network connectivity between compute nodes within a rack and across racks.The + configuration is applied on the devices only after the isolation domain is enabled. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 L2IsolationDomain. The L2IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + l2_isolation_domain_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.L2IsolationDomain]: + """Creates layer 2 network connectivity between compute nodes within a rack and across racks.The + configuration is applied on the devices only after the isolation domain is enabled. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :param body: Request payload. Required. + :type body: IO[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 L2IsolationDomain. The L2IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + l2_isolation_domain_name: str, + body: Union[_models.L2IsolationDomain, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.L2IsolationDomain]: + """Creates layer 2 network connectivity between compute nodes within a rack and across racks.The + configuration is applied on the devices only after the isolation domain is enabled. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :param body: Request payload. Is one of the following types: L2IsolationDomain, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.L2IsolationDomain or JSON or IO[bytes] + :return: An instance of LROPoller that returns L2IsolationDomain. The L2IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.L2IsolationDomain] = 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, + l2_isolation_domain_name=l2_isolation_domain_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.L2IsolationDomain, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.L2IsolationDomain].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.L2IsolationDomain]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + l2_isolation_domain_name: str, + body: Union[_models.L2IsolationDomainPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_l2_isolation_domains_update_request( + resource_group_name=resource_group_name, + l2_isolation_domain_name=l2_isolation_domain_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + l2_isolation_domain_name: str, + body: _models.L2IsolationDomainPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.L2IsolationDomain]: + """API to update certain properties of the L2 Isolation Domain resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :param body: API to update certain properties of the L2 Isolation Domain resource.. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.L2IsolationDomainPatch + :keyword content_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 L2IsolationDomain. The L2IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + l2_isolation_domain_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.L2IsolationDomain]: + """API to update certain properties of the L2 Isolation Domain resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :param body: API to update certain properties of the L2 Isolation Domain resource.. Required. + :type body: JSON + :keyword content_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 L2IsolationDomain. The L2IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + l2_isolation_domain_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.L2IsolationDomain]: + """API to update certain properties of the L2 Isolation Domain resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :param body: API to update certain properties of the L2 Isolation Domain resource.. Required. + :type body: IO[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 L2IsolationDomain. The L2IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + l2_isolation_domain_name: str, + body: Union[_models.L2IsolationDomainPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.L2IsolationDomain]: + """API to update certain properties of the L2 Isolation Domain resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :param body: API to update certain properties of the L2 Isolation Domain resource.. Is one of + the following types: L2IsolationDomainPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.L2IsolationDomainPatch or JSON or IO[bytes] + :return: An instance of LROPoller that returns L2IsolationDomain. The L2IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.L2IsolationDomain] = 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, + l2_isolation_domain_name=l2_isolation_domain_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.L2IsolationDomain, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.L2IsolationDomain].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.L2IsolationDomain]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, l2_isolation_domain_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_l2_isolation_domains_delete_request( + resource_group_name=resource_group_name, + l2_isolation_domain_name=l2_isolation_domain_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: 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]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, l2_isolation_domain_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes layer 2 connectivity between compute nodes by managed by named L2 Isolation name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + l2_isolation_domain_name=l2_isolation_domain_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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) -> ItemPaged["_models.L2IsolationDomain"]: + """Displays L2IsolationDomains list by resource group GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of L2IsolationDomain + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.L2IsolationDomain]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_l2_isolation_domains_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.L2IsolationDomain], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> ItemPaged["_models.L2IsolationDomain"]: + """Displays L2IsolationDomains list by subscription GET method. + + :return: An iterator like instance of L2IsolationDomain + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.L2IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.L2IsolationDomain]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_l2_isolation_domains_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.L2IsolationDomain], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l2_isolation_domain_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _update_administrative_state_initial( + self, + resource_group_name: str, + l2_isolation_domain_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_l2_isolation_domains_update_administrative_state_request( + resource_group_name=resource_group_name, + l2_isolation_domain_name=l2_isolation_domain_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + l2_isolation_domain_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Enables isolation domain across the fabric or on specified racks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + l2_isolation_domain_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Enables isolation domain across the fabric or on specified racks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + l2_isolation_domain_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Enables isolation domain across the fabric or on specified racks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :param body: Request payload. Required. + :type body: IO[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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l2_isolation_domain_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_update_administrative_state( + self, + resource_group_name: str, + l2_isolation_domain_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Enables isolation domain across the fabric or on specified racks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of LROPoller that returns UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateAdministrativeStateResponse] = 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_administrative_state_initial( + resource_group_name=resource_group_name, + l2_isolation_domain_name=l2_isolation_domain_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.UpdateAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.UpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.UpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _validate_configuration_initial( + self, resource_group_name: str, l2_isolation_domain_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_l2_isolation_domains_validate_configuration_request( + resource_group_name=resource_group_name, + l2_isolation_domain_name=l2_isolation_domain_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_validate_configuration( + self, resource_group_name: str, l2_isolation_domain_name: str, **kwargs: Any + ) -> LROPoller[_models.ValidateConfigurationResponse]: + """Validates the configuration of the resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :return: An instance of LROPoller that returns ValidateConfigurationResponse. The + ValidateConfigurationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ValidateConfigurationResponse] = 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._validate_configuration_initial( + resource_group_name=resource_group_name, + l2_isolation_domain_name=l2_isolation_domain_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ValidateConfigurationResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ValidateConfigurationResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ValidateConfigurationResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _commit_configuration_initial( + self, resource_group_name: str, l2_isolation_domain_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_l2_isolation_domains_commit_configuration_request( + resource_group_name=resource_group_name, + l2_isolation_domain_name=l2_isolation_domain_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_commit_configuration( + self, resource_group_name: str, l2_isolation_domain_name: str, **kwargs: Any + ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: + """Commits the configuration of the given resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l2_isolation_domain_name: Name of the L2 Isolation Domain. Required. + :type l2_isolation_domain_name: str + :return: An instance of LROPoller that returns CommonPostActionResponseForStateUpdate. The + CommonPostActionResponseForStateUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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._commit_configuration_initial( + resource_group_name=resource_group_name, + l2_isolation_domain_name=l2_isolation_domain_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.CommonPostActionResponseForStateUpdate, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.CommonPostActionResponseForStateUpdate].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.CommonPostActionResponseForStateUpdate]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class L3IsolationDomainsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricClient`'s + :attr:`l3_isolation_domains` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any) -> _models.L3IsolationDomain: + """Retrieves details of this L3 Isolation Domain. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :return: L3IsolationDomain. The L3IsolationDomain is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.L3IsolationDomain + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.L3IsolationDomain] = kwargs.pop("cls", None) + + _request = build_l3_isolation_domains_get_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.L3IsolationDomain, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + body: Union[_models.L3IsolationDomain, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_l3_isolation_domains_create_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + body: _models.L3IsolationDomain, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.L3IsolationDomain]: + """Create isolation domain resources for layer 3 connectivity between compute nodes and for + communication with external services .This configuration is applied on the devices only after + the creation of networks is completed and isolation domain is enabled. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.L3IsolationDomain + :keyword content_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 L3IsolationDomain. The L3IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.L3IsolationDomain]: + """Create isolation domain resources for layer 3 connectivity between compute nodes and for + communication with external services .This configuration is applied on the devices only after + the creation of networks is completed and isolation domain is enabled. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 L3IsolationDomain. The L3IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.L3IsolationDomain]: + """Create isolation domain resources for layer 3 connectivity between compute nodes and for + communication with external services .This configuration is applied on the devices only after + the creation of networks is completed and isolation domain is enabled. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param body: Request payload. Required. + :type body: IO[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 L3IsolationDomain. The L3IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + body: Union[_models.L3IsolationDomain, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.L3IsolationDomain]: + """Create isolation domain resources for layer 3 connectivity between compute nodes and for + communication with external services .This configuration is applied on the devices only after + the creation of networks is completed and isolation domain is enabled. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param body: Request payload. Is one of the following types: L3IsolationDomain, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.L3IsolationDomain or JSON or IO[bytes] + :return: An instance of LROPoller that returns L3IsolationDomain. The L3IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.L3IsolationDomain] = 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, + l3_isolation_domain_name=l3_isolation_domain_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.L3IsolationDomain, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.L3IsolationDomain].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.L3IsolationDomain]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + body: Union[_models.L3IsolationDomainPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_l3_isolation_domains_update_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + body: _models.L3IsolationDomainPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.L3IsolationDomain]: + """API to update certain properties of the L3 Isolation Domain resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param body: API to update certain properties of the L3 Isolation Domain resource. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.L3IsolationDomainPatch + :keyword content_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 L3IsolationDomain. The L3IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.L3IsolationDomain]: + """API to update certain properties of the L3 Isolation Domain resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param body: API to update certain properties of the L3 Isolation Domain resource. Required. + :type body: JSON + :keyword content_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 L3IsolationDomain. The L3IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.L3IsolationDomain]: + """API to update certain properties of the L3 Isolation Domain resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param body: API to update certain properties of the L3 Isolation Domain resource. Required. + :type body: IO[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 L3IsolationDomain. The L3IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + body: Union[_models.L3IsolationDomainPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.L3IsolationDomain]: + """API to update certain properties of the L3 Isolation Domain resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param body: API to update certain properties of the L3 Isolation Domain resource. Is one of + the following types: L3IsolationDomainPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.L3IsolationDomainPatch or JSON or IO[bytes] + :return: An instance of LROPoller that returns L3IsolationDomain. The L3IsolationDomain is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.L3IsolationDomain] = 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, + l3_isolation_domain_name=l3_isolation_domain_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.L3IsolationDomain, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.L3IsolationDomain].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.L3IsolationDomain]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_l3_isolation_domains_delete_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: 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]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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) -> ItemPaged["_models.L3IsolationDomain"]: + """Displays L3IsolationDomains list by resource group GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of L3IsolationDomain + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.L3IsolationDomain]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_l3_isolation_domains_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.L3IsolationDomain], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> ItemPaged["_models.L3IsolationDomain"]: + """Displays L3IsolationDomains list by subscription GET method. + + :return: An iterator like instance of L3IsolationDomain + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.L3IsolationDomain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.L3IsolationDomain]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_l3_isolation_domains_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.L3IsolationDomain], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _update_administrative_state_initial( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_l3_isolation_domains_update_administrative_state_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the administrative state of the L3 Isolation Domain resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the administrative state of the L3 Isolation Domain resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the administrative state of the L3 Isolation Domain resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param body: Request payload. Required. + :type body: IO[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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_update_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the administrative state of the L3 Isolation Domain resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of LROPoller that returns UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateAdministrativeStateResponse] = 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_administrative_state_initial( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.UpdateAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.UpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.UpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _validate_configuration_initial( + self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_l3_isolation_domains_validate_configuration_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_validate_configuration( + self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any + ) -> LROPoller[_models.ValidateConfigurationResponse]: + """Validates the configuration of the resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :return: An instance of LROPoller that returns ValidateConfigurationResponse. The + ValidateConfigurationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ValidateConfigurationResponse] = 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._validate_configuration_initial( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ValidateConfigurationResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ValidateConfigurationResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ValidateConfigurationResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _commit_configuration_initial( + self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_l3_isolation_domains_commit_configuration_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_commit_configuration( + self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any + ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: + """Commits the configuration of the given resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :return: An instance of LROPoller that returns CommonPostActionResponseForStateUpdate. The + CommonPostActionResponseForStateUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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._commit_configuration_initial( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.CommonPostActionResponseForStateUpdate, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.CommonPostActionResponseForStateUpdate].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.CommonPostActionResponseForStateUpdate]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class InternalNetworksOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricClient`'s + :attr:`internal_networks` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, l3_isolation_domain_name: str, internal_network_name: str, **kwargs: Any + ) -> _models.InternalNetwork: + """Gets a InternalNetworks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :return: InternalNetwork. The InternalNetwork is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.InternalNetwork + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.InternalNetwork] = kwargs.pop("cls", None) + + _request = build_internal_networks_get_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + internal_network_name=internal_network_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.InternalNetwork, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: Union[_models.InternalNetwork, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_internal_networks_create_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + internal_network_name=internal_network_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: _models.InternalNetwork, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InternalNetwork]: + """Creates InternalNetwork PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.InternalNetwork + :keyword content_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 InternalNetwork. The InternalNetwork is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InternalNetwork]: + """Creates InternalNetwork PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 InternalNetwork. The InternalNetwork is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InternalNetwork]: + """Creates InternalNetwork PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Required. + :type body: IO[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 InternalNetwork. The InternalNetwork is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: Union[_models.InternalNetwork, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.InternalNetwork]: + """Creates InternalNetwork PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Is one of the following types: InternalNetwork, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.InternalNetwork or JSON or IO[bytes] + :return: An instance of LROPoller that returns InternalNetwork. The InternalNetwork is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InternalNetwork] = 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, + l3_isolation_domain_name=l3_isolation_domain_name, + internal_network_name=internal_network_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.InternalNetwork, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.InternalNetwork].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.InternalNetwork]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: Union[_models.InternalNetworkPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_internal_networks_update_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + internal_network_name=internal_network_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: _models.InternalNetworkPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InternalNetwork]: + """Updates a InternalNetworks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: InternalNetwork properties to update. Only annotations are supported. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.InternalNetworkPatch + :keyword content_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 InternalNetwork. The InternalNetwork is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InternalNetwork]: + """Updates a InternalNetworks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: InternalNetwork properties to update. Only annotations are supported. Required. + :type body: JSON + :keyword content_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 InternalNetwork. The InternalNetwork is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InternalNetwork]: + """Updates a InternalNetworks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: InternalNetwork properties to update. Only annotations are supported. Required. + :type body: IO[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 InternalNetwork. The InternalNetwork is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: Union[_models.InternalNetworkPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.InternalNetwork]: + """Updates a InternalNetworks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: InternalNetwork properties to update. Only annotations are supported. Is one of + the following types: InternalNetworkPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.InternalNetworkPatch or JSON or IO[bytes] + :return: An instance of LROPoller that returns InternalNetwork. The InternalNetwork is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InternalNetwork] = 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, + l3_isolation_domain_name=l3_isolation_domain_name, + internal_network_name=internal_network_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.InternalNetwork, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.InternalNetwork].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.InternalNetwork]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, l3_isolation_domain_name: str, internal_network_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_internal_networks_delete_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + internal_network_name=internal_network_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: 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]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, l3_isolation_domain_name: str, internal_network_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Implements InternalNetworks DELETE method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + internal_network_name=internal_network_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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_l3_isolation_domain( + self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any + ) -> ItemPaged["_models.InternalNetwork"]: + """Displays InternalNetworks list by resource group GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :return: An iterator like instance of InternalNetwork + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.InternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.InternalNetwork]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_internal_networks_list_by_l3_isolation_domain_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.InternalNetwork], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "internal_network_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _update_administrative_state_initial( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_internal_networks_update_administrative_state_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + internal_network_name=internal_network_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Executes update operation to enable or disable administrative State for InternalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Executes update operation to enable or disable administrative State for InternalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Executes update operation to enable or disable administrative State for InternalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Required. + :type body: IO[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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "internal_network_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_update_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Executes update operation to enable or disable administrative State for InternalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of LROPoller that returns UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateAdministrativeStateResponse] = 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_administrative_state_initial( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + internal_network_name=internal_network_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.UpdateAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.UpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.UpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "internal_network_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _update_bgp_administrative_state_initial( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: Union[_models.InternalNetworkUpdateBgpAdministrativeStateRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_internal_networks_update_bgp_administrative_state_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + internal_network_name=internal_network_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_bgp_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: _models.InternalNetworkUpdateBgpAdministrativeStateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InternalNetworkUpdateBgpAdministrativeStateResponse]: + """Update BGP state for internalNetwork. Allowed only on edge devices. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Required. + :type body: + ~azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBgpAdministrativeStateRequest + :keyword content_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 + InternalNetworkUpdateBgpAdministrativeStateResponse. The + InternalNetworkUpdateBgpAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBgpAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_bgp_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InternalNetworkUpdateBgpAdministrativeStateResponse]: + """Update BGP state for internalNetwork. Allowed only on edge devices. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 + InternalNetworkUpdateBgpAdministrativeStateResponse. The + InternalNetworkUpdateBgpAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBgpAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_bgp_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InternalNetworkUpdateBgpAdministrativeStateResponse]: + """Update BGP state for internalNetwork. Allowed only on edge devices. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Required. + :type body: IO[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 + InternalNetworkUpdateBgpAdministrativeStateResponse. The + InternalNetworkUpdateBgpAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBgpAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "internal_network_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_update_bgp_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: Union[_models.InternalNetworkUpdateBgpAdministrativeStateRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.InternalNetworkUpdateBgpAdministrativeStateResponse]: + """Update BGP state for internalNetwork. Allowed only on edge devices. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Is one of the following types: + InternalNetworkUpdateBgpAdministrativeStateRequest, JSON, IO[bytes] Required. + :type body: + ~azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBgpAdministrativeStateRequest or + JSON or IO[bytes] + :return: An instance of LROPoller that returns + InternalNetworkUpdateBgpAdministrativeStateResponse. The + InternalNetworkUpdateBgpAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBgpAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InternalNetworkUpdateBgpAdministrativeStateResponse] = 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_bgp_administrative_state_initial( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + internal_network_name=internal_network_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.InternalNetworkUpdateBgpAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.InternalNetworkUpdateBgpAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.InternalNetworkUpdateBgpAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "internal_network_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _update_static_route_bfd_administrative_state_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_internal_networks_update_static_route_bfd_administrative_state_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + internal_network_name=internal_network_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_static_route_bfd_administrative_state( # pylint: disable=name-too-long + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Update Static Route BFD administrative state for internalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_static_route_bfd_administrative_state( # pylint: disable=name-too-long + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Update Static Route BFD administrative state for internalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_static_route_bfd_administrative_state( # pylint: disable=name-too-long + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Update Static Route BFD administrative state for internalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Required. + :type body: IO[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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "internal_network_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_update_static_route_bfd_administrative_state( # pylint: disable=name-too-long + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Update Static Route BFD administrative state for internalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of LROPoller that returns UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateAdministrativeStateResponse] = 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_static_route_bfd_administrative_state_initial( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + internal_network_name=internal_network_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.UpdateAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.UpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.UpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "internal_network_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _update_bfd_administrative_state_initial( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: Union[_models.InternalNetworkUpdateBfdAdministrativeStateRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_internal_networks_update_bfd_administrative_state_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + internal_network_name=internal_network_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_bfd_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: _models.InternalNetworkUpdateBfdAdministrativeStateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InternalNetworkUpdateBfdAdministrativeStateResponse]: + """BFD administrative state for either static or bgp for internalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Required. + :type body: + ~azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBfdAdministrativeStateRequest + :keyword content_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 + InternalNetworkUpdateBfdAdministrativeStateResponse. The + InternalNetworkUpdateBfdAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBfdAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_bfd_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InternalNetworkUpdateBfdAdministrativeStateResponse]: + """BFD administrative state for either static or bgp for internalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 + InternalNetworkUpdateBfdAdministrativeStateResponse. The + InternalNetworkUpdateBfdAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBfdAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_bfd_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InternalNetworkUpdateBfdAdministrativeStateResponse]: + """BFD administrative state for either static or bgp for internalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Required. + :type body: IO[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 + InternalNetworkUpdateBfdAdministrativeStateResponse. The + InternalNetworkUpdateBfdAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBfdAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "internal_network_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_update_bfd_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + internal_network_name: str, + body: Union[_models.InternalNetworkUpdateBfdAdministrativeStateRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.InternalNetworkUpdateBfdAdministrativeStateResponse]: + """BFD administrative state for either static or bgp for internalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param internal_network_name: Name of the Internal Network. Required. + :type internal_network_name: str + :param body: Request payload. Is one of the following types: + InternalNetworkUpdateBfdAdministrativeStateRequest, JSON, IO[bytes] Required. + :type body: + ~azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBfdAdministrativeStateRequest or + JSON or IO[bytes] + :return: An instance of LROPoller that returns + InternalNetworkUpdateBfdAdministrativeStateResponse. The + InternalNetworkUpdateBfdAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.InternalNetworkUpdateBfdAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InternalNetworkUpdateBfdAdministrativeStateResponse] = 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_bfd_administrative_state_initial( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + internal_network_name=internal_network_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.InternalNetworkUpdateBfdAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.InternalNetworkUpdateBfdAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.InternalNetworkUpdateBfdAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class ExternalNetworksOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricClient`'s + :attr:`external_networks` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, l3_isolation_domain_name: str, external_network_name: str, **kwargs: Any + ) -> _models.ExternalNetwork: + """Implements ExternalNetworks GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :return: ExternalNetwork. The ExternalNetwork is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.ExternalNetwork + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ExternalNetwork] = kwargs.pop("cls", None) + + _request = build_external_networks_get_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + external_network_name=external_network_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ExternalNetwork, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: Union[_models.ExternalNetwork, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_external_networks_create_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + external_network_name=external_network_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: _models.ExternalNetwork, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExternalNetwork]: + """Creates ExternalNetwork PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.ExternalNetwork + :keyword content_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 ExternalNetwork. The ExternalNetwork is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExternalNetwork]: + """Creates ExternalNetwork PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 ExternalNetwork. The ExternalNetwork is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExternalNetwork]: + """Creates ExternalNetwork PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Required. + :type body: IO[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 ExternalNetwork. The ExternalNetwork is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: Union[_models.ExternalNetwork, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ExternalNetwork]: + """Creates ExternalNetwork PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Is one of the following types: ExternalNetwork, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.ExternalNetwork or JSON or IO[bytes] + :return: An instance of LROPoller that returns ExternalNetwork. The ExternalNetwork is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExternalNetwork] = 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, + l3_isolation_domain_name=l3_isolation_domain_name, + external_network_name=external_network_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ExternalNetwork, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ExternalNetwork].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ExternalNetwork]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: Union[_models.ExternalNetworkPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_external_networks_update_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + external_network_name=external_network_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: _models.ExternalNetworkPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExternalNetwork]: + """API to update certain properties of the ExternalNetworks resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: ExternalNetwork properties to update. Only annotations are supported. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.ExternalNetworkPatch + :keyword content_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 ExternalNetwork. The ExternalNetwork is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExternalNetwork]: + """API to update certain properties of the ExternalNetworks resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: ExternalNetwork properties to update. Only annotations are supported. Required. + :type body: JSON + :keyword content_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 ExternalNetwork. The ExternalNetwork is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExternalNetwork]: + """API to update certain properties of the ExternalNetworks resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: ExternalNetwork properties to update. Only annotations are supported. Required. + :type body: IO[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 ExternalNetwork. The ExternalNetwork is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: Union[_models.ExternalNetworkPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ExternalNetwork]: + """API to update certain properties of the ExternalNetworks resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: ExternalNetwork properties to update. Only annotations are supported. Is one of + the following types: ExternalNetworkPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.ExternalNetworkPatch or JSON or IO[bytes] + :return: An instance of LROPoller that returns ExternalNetwork. The ExternalNetwork is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExternalNetwork] = 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, + l3_isolation_domain_name=l3_isolation_domain_name, + external_network_name=external_network_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ExternalNetwork, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ExternalNetwork].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ExternalNetwork]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, l3_isolation_domain_name: str, external_network_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_external_networks_delete_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + external_network_name=external_network_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: 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]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, l3_isolation_domain_name: str, external_network_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Implements ExternalNetworks DELETE method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + external_network_name=external_network_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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_l3_isolation_domain( + self, resource_group_name: str, l3_isolation_domain_name: str, **kwargs: Any + ) -> ItemPaged["_models.ExternalNetwork"]: + """Implements External Networks list by resource group GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :return: An iterator like instance of ExternalNetwork + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.ExternalNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ExternalNetwork]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_external_networks_list_by_l3_isolation_domain_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ExternalNetwork], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "external_network_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _update_administrative_state_initial( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_external_networks_update_administrative_state_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + external_network_name=external_network_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Executes update operation to enable or disable administrative State for externalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Executes update operation to enable or disable administrative State for externalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Executes update operation to enable or disable administrative State for externalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Required. + :type body: IO[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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "external_network_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_update_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Executes update operation to enable or disable administrative State for externalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of LROPoller that returns UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateAdministrativeStateResponse] = 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_administrative_state_initial( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + external_network_name=external_network_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.UpdateAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.UpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.UpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "external_network_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _update_static_route_bfd_administrative_state_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_external_networks_update_static_route_bfd_administrative_state_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + external_network_name=external_network_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_static_route_bfd_administrative_state( # pylint: disable=name-too-long + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Update Static Route BFD for external Network. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_static_route_bfd_administrative_state( # pylint: disable=name-too-long + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Update Static Route BFD for external Network. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_static_route_bfd_administrative_state( # pylint: disable=name-too-long + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Update Static Route BFD for external Network. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Required. + :type body: IO[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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "external_network_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_update_static_route_bfd_administrative_state( # pylint: disable=name-too-long + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Update Static Route BFD for external Network. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of LROPoller that returns UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateAdministrativeStateResponse] = 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_static_route_bfd_administrative_state_initial( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + external_network_name=external_network_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.UpdateAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.UpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.UpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "external_network_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _update_bfd_administrative_state_initial( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: Union[_models.ExternalNetworkUpdateBfdAdministrativeStateRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_external_networks_update_bfd_administrative_state_request( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + external_network_name=external_network_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_bfd_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: _models.ExternalNetworkUpdateBfdAdministrativeStateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExternalNetworkUpdateBfdAdministrativeStateResponse]: + """BFD administrative state for either static or bgp for internalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Required. + :type body: + ~azure.mgmt.managednetworkfabric.models.ExternalNetworkUpdateBfdAdministrativeStateRequest + :keyword content_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 + ExternalNetworkUpdateBfdAdministrativeStateResponse. The + ExternalNetworkUpdateBfdAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetworkUpdateBfdAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_bfd_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExternalNetworkUpdateBfdAdministrativeStateResponse]: + """BFD administrative state for either static or bgp for internalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 + ExternalNetworkUpdateBfdAdministrativeStateResponse. The + ExternalNetworkUpdateBfdAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetworkUpdateBfdAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_bfd_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExternalNetworkUpdateBfdAdministrativeStateResponse]: + """BFD administrative state for either static or bgp for internalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Required. + :type body: IO[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 + ExternalNetworkUpdateBfdAdministrativeStateResponse. The + ExternalNetworkUpdateBfdAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetworkUpdateBfdAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "l3_isolation_domain_name", + "external_network_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_update_bfd_administrative_state( + self, + resource_group_name: str, + l3_isolation_domain_name: str, + external_network_name: str, + body: Union[_models.ExternalNetworkUpdateBfdAdministrativeStateRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ExternalNetworkUpdateBfdAdministrativeStateResponse]: + """BFD administrative state for either static or bgp for internalNetwork. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param l3_isolation_domain_name: Name of the L3 Isolation Domain. Required. + :type l3_isolation_domain_name: str + :param external_network_name: Name of the External Network. Required. + :type external_network_name: str + :param body: Request payload. Is one of the following types: + ExternalNetworkUpdateBfdAdministrativeStateRequest, JSON, IO[bytes] Required. + :type body: + ~azure.mgmt.managednetworkfabric.models.ExternalNetworkUpdateBfdAdministrativeStateRequest or + JSON or IO[bytes] + :return: An instance of LROPoller that returns + ExternalNetworkUpdateBfdAdministrativeStateResponse. The + ExternalNetworkUpdateBfdAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ExternalNetworkUpdateBfdAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExternalNetworkUpdateBfdAdministrativeStateResponse] = 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_bfd_administrative_state_initial( + resource_group_name=resource_group_name, + l3_isolation_domain_name=l3_isolation_domain_name, + external_network_name=external_network_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ExternalNetworkUpdateBfdAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ExternalNetworkUpdateBfdAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ExternalNetworkUpdateBfdAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class NeighborGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricClient`'s + :attr:`neighbor_groups` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, neighbor_group_name: str, **kwargs: Any) -> _models.NeighborGroup: + """Gets the Neighbor Group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param neighbor_group_name: Name of the Neighbor Group. Required. + :type neighbor_group_name: str + :return: NeighborGroup. The NeighborGroup is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.NeighborGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NeighborGroup] = kwargs.pop("cls", None) + + _request = build_neighbor_groups_get_request( + resource_group_name=resource_group_name, + neighbor_group_name=neighbor_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NeighborGroup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( + self, + resource_group_name: str, + neighbor_group_name: str, + body: Union[_models.NeighborGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_neighbor_groups_create_request( + resource_group_name=resource_group_name, + neighbor_group_name=neighbor_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + neighbor_group_name: str, + body: _models.NeighborGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NeighborGroup]: + """Implements the Neighbor Group PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param neighbor_group_name: Name of the Neighbor Group. Required. + :type neighbor_group_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NeighborGroup + :keyword content_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 NeighborGroup. The NeighborGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NeighborGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + neighbor_group_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NeighborGroup]: + """Implements the Neighbor Group PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param neighbor_group_name: Name of the Neighbor Group. Required. + :type neighbor_group_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NeighborGroup. The NeighborGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NeighborGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + neighbor_group_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NeighborGroup]: + """Implements the Neighbor Group PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param neighbor_group_name: Name of the Neighbor Group. Required. + :type neighbor_group_name: str + :param body: Request payload. Required. + :type body: IO[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 NeighborGroup. The NeighborGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NeighborGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + neighbor_group_name: str, + body: Union[_models.NeighborGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NeighborGroup]: + """Implements the Neighbor Group PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param neighbor_group_name: Name of the Neighbor Group. Required. + :type neighbor_group_name: str + :param body: Request payload. Is one of the following types: NeighborGroup, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NeighborGroup or JSON or IO[bytes] + :return: An instance of LROPoller that returns NeighborGroup. The NeighborGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NeighborGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NeighborGroup] = 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, + neighbor_group_name=neighbor_group_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NeighborGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NeighborGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NeighborGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + neighbor_group_name: str, + body: Union[_models.NeighborGroupPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_neighbor_groups_update_request( + resource_group_name=resource_group_name, + neighbor_group_name=neighbor_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + neighbor_group_name: str, + body: _models.NeighborGroupPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NeighborGroup]: + """Updates the Neighbor Group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param neighbor_group_name: Name of the Neighbor Group. Required. + :type neighbor_group_name: str + :param body: Neighbor Group properties to update. Only annotations are supported. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NeighborGroupPatch + :keyword content_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 NeighborGroup. The NeighborGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NeighborGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + neighbor_group_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NeighborGroup]: + """Updates the Neighbor Group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param neighbor_group_name: Name of the Neighbor Group. Required. + :type neighbor_group_name: str + :param body: Neighbor Group properties to update. Only annotations are supported. Required. + :type body: JSON + :keyword content_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 NeighborGroup. The NeighborGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NeighborGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + neighbor_group_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NeighborGroup]: + """Updates the Neighbor Group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param neighbor_group_name: Name of the Neighbor Group. Required. + :type neighbor_group_name: str + :param body: Neighbor Group properties to update. Only annotations are supported. Required. + :type body: IO[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 NeighborGroup. The NeighborGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NeighborGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + neighbor_group_name: str, + body: Union[_models.NeighborGroupPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NeighborGroup]: + """Updates the Neighbor Group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param neighbor_group_name: Name of the Neighbor Group. Required. + :type neighbor_group_name: str + :param body: Neighbor Group properties to update. Only annotations are supported. Is one of the + following types: NeighborGroupPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NeighborGroupPatch or JSON or IO[bytes] + :return: An instance of LROPoller that returns NeighborGroup. The NeighborGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NeighborGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NeighborGroup] = 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, + neighbor_group_name=neighbor_group_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NeighborGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NeighborGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NeighborGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, resource_group_name: str, neighbor_group_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_neighbor_groups_delete_request( + resource_group_name=resource_group_name, + neighbor_group_name=neighbor_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: 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]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, neighbor_group_name: str, **kwargs: Any) -> LROPoller[None]: + """Implements Neighbor Group DELETE method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param neighbor_group_name: Name of the Neighbor Group. Required. + :type neighbor_group_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + neighbor_group_name=neighbor_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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) -> ItemPaged["_models.NeighborGroup"]: + """Displays NeighborGroups list by resource group GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of NeighborGroup + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NeighborGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NeighborGroup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_neighbor_groups_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NeighborGroup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> ItemPaged["_models.NeighborGroup"]: + """Displays NeighborGroups list by subscription GET method. + + :return: An iterator like instance of NeighborGroup + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NeighborGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NeighborGroup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_neighbor_groups_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NeighborGroup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "neighbor_group_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def _resync_initial(self, resource_group_name: str, neighbor_group_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_neighbor_groups_resync_request( + resource_group_name=resource_group_name, + neighbor_group_name=neighbor_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "neighbor_group_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def begin_resync( + self, resource_group_name: str, neighbor_group_name: str, **kwargs: Any + ) -> LROPoller[_models.NeighborGroupResyncResponse]: + """Resync the Neighbor Group after a configuration change. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param neighbor_group_name: Name of the Neighbor Group. Required. + :type neighbor_group_name: str + :return: An instance of LROPoller that returns NeighborGroupResyncResponse. The + NeighborGroupResyncResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NeighborGroupResyncResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NeighborGroupResyncResponse] = 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._resync_initial( + resource_group_name=resource_group_name, + neighbor_group_name=neighbor_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NeighborGroupResyncResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NeighborGroupResyncResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NeighborGroupResyncResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class NetworkDeviceSkusOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricClient`'s + :attr:`network_device_skus` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, network_device_sku_name: str, **kwargs: Any) -> _models.NetworkDeviceSku: + """Get a Network Device SKU details. + + :param network_device_sku_name: Name of the Network Device SKU. Required. + :type network_device_sku_name: str + :return: NetworkDeviceSku. The NetworkDeviceSku is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkDeviceSku + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkDeviceSku] = kwargs.pop("cls", None) + + _request = build_network_device_skus_get_request( + network_device_sku_name=network_device_sku_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NetworkDeviceSku, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.NetworkDeviceSku"]: + """List Network Device SKUs for the given subscription. + + :return: An iterator like instance of NetworkDeviceSku + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkDeviceSku] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkDeviceSku]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_device_skus_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkDeviceSku], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class NetworkDevicesOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricClient`'s + :attr:`network_devices` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, network_device_name: str, **kwargs: Any) -> _models.NetworkDevice: + """Gets the Network Device resource details. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :return: NetworkDevice. The NetworkDevice is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkDevice + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkDevice] = kwargs.pop("cls", None) + + _request = build_network_devices_get_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NetworkDevice, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( + self, + resource_group_name: str, + network_device_name: str, + body: Union[_models.NetworkDevice, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_devices_create_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + network_device_name: str, + body: _models.NetworkDevice, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkDevice]: + """Create a Network Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkDevice + :keyword content_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 NetworkDevice. The NetworkDevice is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + network_device_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkDevice]: + """Create a Network Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NetworkDevice. The NetworkDevice is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + network_device_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkDevice]: + """Create a Network Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Required. + :type body: IO[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 NetworkDevice. The NetworkDevice is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + network_device_name: str, + body: Union[_models.NetworkDevice, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkDevice]: + """Create a Network Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Is one of the following types: NetworkDevice, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkDevice or JSON or IO[bytes] + :return: An instance of LROPoller that returns NetworkDevice. The NetworkDevice is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkDevice] = 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_device_name=network_device_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkDevice, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkDevice].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkDevice]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + network_device_name: str, + body: Union[_models.NetworkDevicePatchParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_devices_update_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + network_device_name: str, + body: _models.NetworkDevicePatchParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkDevice]: + """Update certain properties of the Network Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Network Device properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkDevicePatchParameters + :keyword content_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 NetworkDevice. The NetworkDevice is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + network_device_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkDevice]: + """Update certain properties of the Network Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Network Device properties to update. Required. + :type body: JSON + :keyword content_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 NetworkDevice. The NetworkDevice is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + network_device_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkDevice]: + """Update certain properties of the Network Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Network Device properties to update. Required. + :type body: IO[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 NetworkDevice. The NetworkDevice is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + network_device_name: str, + body: Union[_models.NetworkDevicePatchParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkDevice]: + """Update certain properties of the Network Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Network Device properties to update. Is one of the following types: + NetworkDevicePatchParameters, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkDevicePatchParameters or JSON or + IO[bytes] + :return: An instance of LROPoller that returns NetworkDevice. The NetworkDevice is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkDevice] = 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, + network_device_name=network_device_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkDevice, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkDevice].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkDevice]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, resource_group_name: str, network_device_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_devices_delete_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: 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]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, network_device_name: str, **kwargs: Any) -> LROPoller[None]: + """Delete the Network Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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) -> ItemPaged["_models.NetworkDevice"]: + """List all the Network Device resources in a given resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of NetworkDevice + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkDevice]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_devices_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkDevice], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> ItemPaged["_models.NetworkDevice"]: + """List all the Network Device resources in a given subscription. + + :return: An iterator like instance of NetworkDevice + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkDevice]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_devices_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkDevice], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _reboot_initial( + self, + resource_group_name: str, + network_device_name: str, + body: Union[_models.RebootProperties, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_devices_reboot_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_reboot( + self, + resource_group_name: str, + network_device_name: str, + body: _models.RebootProperties, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Reboot the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.RebootProperties + :keyword content_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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_reboot( + self, + resource_group_name: str, + network_device_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Reboot the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_reboot( + self, + resource_group_name: str, + network_device_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Reboot the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Required. + :type body: IO[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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_reboot( + self, + resource_group_name: str, + network_device_name: str, + body: Union[_models.RebootProperties, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Reboot the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Is one of the following types: RebootProperties, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.RebootProperties or JSON or IO[bytes] + :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.OperationStatusResult] = 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._reboot_initial( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.OperationStatusResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.OperationStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.OperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_device_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def _refresh_configuration_initial( + self, resource_group_name: str, network_device_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_devices_refresh_configuration_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_device_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def begin_refresh_configuration( + self, resource_group_name: str, network_device_name: str, **kwargs: Any + ) -> LROPoller[_models.NetworkDeviceRefreshConfigurationResponse]: + """Refreshes the configuration the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :return: An instance of LROPoller that returns NetworkDeviceRefreshConfigurationResponse. The + NetworkDeviceRefreshConfigurationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDeviceRefreshConfigurationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkDeviceRefreshConfigurationResponse] = 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._refresh_configuration_initial( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkDeviceRefreshConfigurationResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkDeviceRefreshConfigurationResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkDeviceRefreshConfigurationResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _update_administrative_state_initial( + self, + resource_group_name: str, + network_device_name: str, + body: Union[_models.UpdateDeviceAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_devices_update_administrative_state_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + network_device_name: str, + body: _models.UpdateDeviceAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkDeviceUpdateAdministrativeStateResponse]: + """Updates the Administrative state of the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateDeviceAdministrativeState + :keyword content_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 NetworkDeviceUpdateAdministrativeStateResponse. + The NetworkDeviceUpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDeviceUpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + network_device_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkDeviceUpdateAdministrativeStateResponse]: + """Updates the Administrative state of the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NetworkDeviceUpdateAdministrativeStateResponse. + The NetworkDeviceUpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDeviceUpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + network_device_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkDeviceUpdateAdministrativeStateResponse]: + """Updates the Administrative state of the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Required. + :type body: IO[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 NetworkDeviceUpdateAdministrativeStateResponse. + The NetworkDeviceUpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDeviceUpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_update_administrative_state( + self, + resource_group_name: str, + network_device_name: str, + body: Union[_models.UpdateDeviceAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkDeviceUpdateAdministrativeStateResponse]: + """Updates the Administrative state of the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Is one of the following types: UpdateDeviceAdministrativeState, + JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateDeviceAdministrativeState or JSON or + IO[bytes] + :return: An instance of LROPoller that returns NetworkDeviceUpdateAdministrativeStateResponse. + The NetworkDeviceUpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDeviceUpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkDeviceUpdateAdministrativeStateResponse] = 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_administrative_state_initial( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkDeviceUpdateAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkDeviceUpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkDeviceUpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _upgrade_initial( + self, + resource_group_name: str, + network_device_name: str, + body: Union[_models.NetworkDeviceUpgradeRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_devices_upgrade_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_upgrade( + self, + resource_group_name: str, + network_device_name: str, + body: _models.NetworkDeviceUpgradeRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkDeviceUpgradeResponse]: + """Upgrades the version of the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkDeviceUpgradeRequest + :keyword content_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 NetworkDeviceUpgradeResponse. The + NetworkDeviceUpgradeResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDeviceUpgradeResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_upgrade( + self, + resource_group_name: str, + network_device_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkDeviceUpgradeResponse]: + """Upgrades the version of the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NetworkDeviceUpgradeResponse. The + NetworkDeviceUpgradeResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDeviceUpgradeResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_upgrade( + self, + resource_group_name: str, + network_device_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkDeviceUpgradeResponse]: + """Upgrades the version of the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Required. + :type body: IO[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 NetworkDeviceUpgradeResponse. The + NetworkDeviceUpgradeResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDeviceUpgradeResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_upgrade( + self, + resource_group_name: str, + network_device_name: str, + body: Union[_models.NetworkDeviceUpgradeRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkDeviceUpgradeResponse]: + """Upgrades the version of the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request payload. Is one of the following types: NetworkDeviceUpgradeRequest, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkDeviceUpgradeRequest or JSON or + IO[bytes] + :return: An instance of LROPoller that returns NetworkDeviceUpgradeResponse. The + NetworkDeviceUpgradeResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDeviceUpgradeResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkDeviceUpgradeResponse] = 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._upgrade_initial( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkDeviceUpgradeResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkDeviceUpgradeResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkDeviceUpgradeResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2024-06-15-preview", + params_added_on={ + "2024-06-15-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2024-06-15-preview", "2025-07-15"], + ) + def _run_ro_command_initial( + self, + resource_group_name: str, + network_device_name: str, + body: Union[_models.DeviceRoCommand, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_devices_run_ro_command_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_run_ro_command( + self, + resource_group_name: str, + network_device_name: str, + body: _models.DeviceRoCommand, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CommonPostActionResponseForDeviceROCommandsOperationStatusResult]: + """Run the RO Command on the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request the command. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.DeviceRoCommand + :keyword content_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 + CommonPostActionResponseForDeviceROCommandsOperationStatusResult. The + CommonPostActionResponseForDeviceROCommandsOperationStatusResult is compatible with + MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceROCommandsOperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_run_ro_command( + self, + resource_group_name: str, + network_device_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CommonPostActionResponseForDeviceROCommandsOperationStatusResult]: + """Run the RO Command on the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request the command. Required. + :type body: JSON + :keyword content_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 + CommonPostActionResponseForDeviceROCommandsOperationStatusResult. The + CommonPostActionResponseForDeviceROCommandsOperationStatusResult is compatible with + MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceROCommandsOperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_run_ro_command( + self, + resource_group_name: str, + network_device_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CommonPostActionResponseForDeviceROCommandsOperationStatusResult]: + """Run the RO Command on the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request the command. Required. + :type body: IO[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 + CommonPostActionResponseForDeviceROCommandsOperationStatusResult. The + CommonPostActionResponseForDeviceROCommandsOperationStatusResult is compatible with + MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceROCommandsOperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2024-06-15-preview", + params_added_on={ + "2024-06-15-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2024-06-15-preview", "2025-07-15"], + ) + def begin_run_ro_command( + self, + resource_group_name: str, + network_device_name: str, + body: Union[_models.DeviceRoCommand, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.CommonPostActionResponseForDeviceROCommandsOperationStatusResult]: + """Run the RO Command on the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request the command. Is one of the following types: DeviceRoCommand, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.DeviceRoCommand or JSON or IO[bytes] + :return: An instance of LROPoller that returns + CommonPostActionResponseForDeviceROCommandsOperationStatusResult. The + CommonPostActionResponseForDeviceROCommandsOperationStatusResult is compatible with + MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceROCommandsOperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CommonPostActionResponseForDeviceROCommandsOperationStatusResult] = 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._run_ro_command_initial( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize( + _models.CommonPostActionResponseForDeviceROCommandsOperationStatusResult, response.json() + ) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[ + _models.CommonPostActionResponseForDeviceROCommandsOperationStatusResult + ].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.CommonPostActionResponseForDeviceROCommandsOperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _run_rw_command_initial( + self, + resource_group_name: str, + network_device_name: str, + body: Union[_models.DeviceRwCommand, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_devices_run_rw_command_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_run_rw_command( + self, + resource_group_name: str, + network_device_name: str, + body: _models.DeviceRwCommand, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkDeviceRunRwCommandResponse]: + """Run the RW Command on the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request the command. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.DeviceRwCommand + :keyword content_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 NetworkDeviceRunRwCommandResponse. The + NetworkDeviceRunRwCommandResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDeviceRunRwCommandResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_run_rw_command( + self, + resource_group_name: str, + network_device_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkDeviceRunRwCommandResponse]: + """Run the RW Command on the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request the command. Required. + :type body: JSON + :keyword content_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 NetworkDeviceRunRwCommandResponse. The + NetworkDeviceRunRwCommandResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDeviceRunRwCommandResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_run_rw_command( + self, + resource_group_name: str, + network_device_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkDeviceRunRwCommandResponse]: + """Run the RW Command on the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request the command. Required. + :type body: IO[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 NetworkDeviceRunRwCommandResponse. The + NetworkDeviceRunRwCommandResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDeviceRunRwCommandResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_run_rw_command( + self, + resource_group_name: str, + network_device_name: str, + body: Union[_models.DeviceRwCommand, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkDeviceRunRwCommandResponse]: + """Run the RW Command on the Network Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param body: Request the command. Is one of the following types: DeviceRwCommand, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.DeviceRwCommand or JSON or IO[bytes] + :return: An instance of LROPoller that returns NetworkDeviceRunRwCommandResponse. The + NetworkDeviceRunRwCommandResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDeviceRunRwCommandResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkDeviceRunRwCommandResponse] = 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._run_rw_command_initial( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkDeviceRunRwCommandResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkDeviceRunRwCommandResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkDeviceRunRwCommandResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_device_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def _resync_passwords_initial( + self, resource_group_name: str, network_device_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_devices_resync_passwords_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_device_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def begin_resync_passwords( + self, resource_group_name: str, network_device_name: str, **kwargs: Any + ) -> LROPoller[_models.NetworkDeviceResyncPasswordsResponse]: + """Resync the latest passwords to the Network Device. + + Updates the Network Device to use the latest passwords. Does not generate new passwords. Allows + network devices missed during a previous password rotation to be brought back into sync. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :return: An instance of LROPoller that returns NetworkDeviceResyncPasswordsResponse. The + NetworkDeviceResyncPasswordsResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkDeviceResyncPasswordsResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkDeviceResyncPasswordsResponse] = 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._resync_passwords_initial( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkDeviceResyncPasswordsResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkDeviceResyncPasswordsResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkDeviceResyncPasswordsResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_device_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def _resync_certificates_initial( + self, resource_group_name: str, network_device_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_devices_resync_certificates_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_device_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def begin_resync_certificates( + self, resource_group_name: str, network_device_name: str, **kwargs: Any + ) -> LROPoller[_models.NetworkFabricResyncCertificatesResponse]: + """Resync the latest certificates to the Network Device. + + Updates the Network Device to use the latest certificates. Does not generate new certificates. + Allows network devices missed during a previous certificate rotation to be brought back into + sync. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :return: An instance of LROPoller that returns NetworkFabricResyncCertificatesResponse. The + NetworkFabricResyncCertificatesResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricResyncCertificatesResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkFabricResyncCertificatesResponse] = 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._resync_certificates_initial( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkFabricResyncCertificatesResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkFabricResyncCertificatesResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkFabricResyncCertificatesResponse]( + 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.managednetworkfabric.ManagedNetworkFabricClient`'s + :attr:`network_interfaces` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, network_device_name: str, network_interface_name: str, **kwargs: Any + ) -> _models.NetworkInterface: + """Get the Network Interface resource details. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param network_interface_name: Name of the Network Interface. Required. + :type network_interface_name: str + :return: NetworkInterface. The NetworkInterface is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkInterface + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkInterface] = kwargs.pop("cls", None) + + _request = build_network_interfaces_get_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NetworkInterface, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( + self, + resource_group_name: str, + network_device_name: str, + network_interface_name: str, + body: Union[_models.NetworkInterface, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_interfaces_create_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + network_device_name: str, + network_interface_name: str, + body: _models.NetworkInterface, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkInterface]: + """Create a Network Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param network_interface_name: Name of the Network Interface. Required. + :type network_interface_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.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 NetworkInterface. The NetworkInterface is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + network_device_name: str, + network_interface_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkInterface]: + """Create a Network Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param network_interface_name: Name of the Network Interface. Required. + :type network_interface_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NetworkInterface. The NetworkInterface is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + network_device_name: str, + network_interface_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkInterface]: + """Create a Network Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param network_interface_name: Name of the Network Interface. Required. + :type network_interface_name: str + :param body: Request payload. Required. + :type body: IO[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 NetworkInterface. The NetworkInterface is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + network_device_name: str, + network_interface_name: str, + body: Union[_models.NetworkInterface, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkInterface]: + """Create a Network Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param network_interface_name: Name of the Network Interface. Required. + :type network_interface_name: str + :param body: Request payload. Is one of the following types: NetworkInterface, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkInterface or JSON or IO[bytes] + :return: An instance of LROPoller that returns NetworkInterface. The NetworkInterface is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + 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_initial( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + network_interface_name=network_interface_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkInterface, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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 + ) + + def _update_initial( + self, + resource_group_name: str, + network_device_name: str, + network_interface_name: str, + body: Union[_models.NetworkInterfacePatch, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_interfaces_update_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + network_device_name: str, + network_interface_name: str, + body: _models.NetworkInterfacePatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkInterface]: + """Update certain properties of the Network Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param network_interface_name: Name of the Network Interface. Required. + :type network_interface_name: str + :param body: NetworkInterface properties to update. Only tags are supported. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkInterfacePatch + :keyword content_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 NetworkInterface. The NetworkInterface is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + network_device_name: str, + network_interface_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkInterface]: + """Update certain properties of the Network Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param network_interface_name: Name of the Network Interface. Required. + :type network_interface_name: str + :param body: NetworkInterface properties to update. Only tags are supported. Required. + :type body: JSON + :keyword content_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 NetworkInterface. The NetworkInterface is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + network_device_name: str, + network_interface_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkInterface]: + """Update certain properties of the Network Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param network_interface_name: Name of the Network Interface. Required. + :type network_interface_name: str + :param body: NetworkInterface properties to update. Only tags are supported. Required. + :type body: IO[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 NetworkInterface. The NetworkInterface is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + network_device_name: str, + network_interface_name: str, + body: Union[_models.NetworkInterfacePatch, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkInterface]: + """Update certain properties of the Network Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param network_interface_name: Name of the Network Interface. Required. + :type network_interface_name: str + :param body: NetworkInterface properties to update. Only tags are supported. Is one of the + following types: NetworkInterfacePatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkInterfacePatch or JSON or IO[bytes] + :return: An instance of LROPoller that returns NetworkInterface. The NetworkInterface is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + 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._update_initial( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + network_interface_name=network_interface_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkInterface, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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 + ) + + def _delete_initial( + self, resource_group_name: str, network_device_name: str, network_interface_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_interfaces_delete_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: 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]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, network_device_name: str, network_interface_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete the Network Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param network_interface_name: Name of the Network Interface. Required. + :type network_interface_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + network_interface_name=network_interface_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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_network_device( + self, resource_group_name: str, network_device_name: str, **kwargs: Any + ) -> ItemPaged["_models.NetworkInterface"]: + """List all the Network Interface resources in a given resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :return: An iterator like instance of NetworkInterface + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkInterface]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_by_network_device_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkInterface], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_device_name", + "network_interface_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _update_administrative_state_initial( + self, + resource_group_name: str, + network_device_name: str, + network_interface_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_interfaces_update_administrative_state_request( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + network_interface_name=network_interface_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + network_device_name: str, + network_interface_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Update the admin state of the Network Interface. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param network_interface_name: Name of the Network Interface. Required. + :type network_interface_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + network_device_name: str, + network_interface_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Update the admin state of the Network Interface. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param network_interface_name: Name of the Network Interface. Required. + :type network_interface_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + network_device_name: str, + network_interface_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Update the admin state of the Network Interface. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param network_interface_name: Name of the Network Interface. Required. + :type network_interface_name: str + :param body: Request payload. Required. + :type body: IO[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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_device_name", + "network_interface_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_update_administrative_state( + self, + resource_group_name: str, + network_device_name: str, + network_interface_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Update the admin state of the Network Interface. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_device_name: Name of the Network Device. Required. + :type network_device_name: str + :param network_interface_name: Name of the Network Interface. Required. + :type network_interface_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of LROPoller that returns UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateAdministrativeStateResponse] = 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_administrative_state_initial( + resource_group_name=resource_group_name, + network_device_name=network_device_name, + network_interface_name=network_interface_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.UpdateAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.UpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.UpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class NetworkFabricControllersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricClient`'s + :attr:`network_fabric_controllers` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, network_fabric_controller_name: str, **kwargs: Any + ) -> _models.NetworkFabricController: + """Shows the provisioning status of Network Fabric Controller. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. + :type network_fabric_controller_name: str + :return: NetworkFabricController. The NetworkFabricController is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkFabricController + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkFabricController] = kwargs.pop("cls", None) + + _request = build_network_fabric_controllers_get_request( + resource_group_name=resource_group_name, + network_fabric_controller_name=network_fabric_controller_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NetworkFabricController, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( + self, + resource_group_name: str, + network_fabric_controller_name: str, + body: Union[_models.NetworkFabricController, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_fabric_controllers_create_request( + resource_group_name=resource_group_name, + network_fabric_controller_name=network_fabric_controller_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + network_fabric_controller_name: str, + body: _models.NetworkFabricController, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkFabricController]: + """Creates a Network Fabric Controller. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. + :type network_fabric_controller_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabricController + :keyword content_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 NetworkFabricController. The + NetworkFabricController is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + network_fabric_controller_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkFabricController]: + """Creates a Network Fabric Controller. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. + :type network_fabric_controller_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NetworkFabricController. The + NetworkFabricController is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + network_fabric_controller_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkFabricController]: + """Creates a Network Fabric Controller. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. + :type network_fabric_controller_name: str + :param body: Request payload. Required. + :type body: IO[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 NetworkFabricController. The + NetworkFabricController is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + network_fabric_controller_name: str, + body: Union[_models.NetworkFabricController, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkFabricController]: + """Creates a Network Fabric Controller. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. + :type network_fabric_controller_name: str + :param body: Request payload. Is one of the following types: NetworkFabricController, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabricController or JSON or + IO[bytes] + :return: An instance of LROPoller that returns NetworkFabricController. The + NetworkFabricController is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkFabricController] = 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_fabric_controller_name=network_fabric_controller_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkFabricController, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkFabricController].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkFabricController]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + network_fabric_controller_name: str, + body: Union[_models.NetworkFabricControllerPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_fabric_controllers_update_request( + resource_group_name=resource_group_name, + network_fabric_controller_name=network_fabric_controller_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + network_fabric_controller_name: str, + body: _models.NetworkFabricControllerPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkFabricController]: + """Updates are currently not supported for the Network Fabric Controller resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. + :type network_fabric_controller_name: str + :param body: Network Fabric Controller properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabricControllerPatch + :keyword content_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 NetworkFabricController. The + NetworkFabricController is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + network_fabric_controller_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkFabricController]: + """Updates are currently not supported for the Network Fabric Controller resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. + :type network_fabric_controller_name: str + :param body: Network Fabric Controller properties to update. Required. + :type body: JSON + :keyword content_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 NetworkFabricController. The + NetworkFabricController is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + network_fabric_controller_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkFabricController]: + """Updates are currently not supported for the Network Fabric Controller resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. + :type network_fabric_controller_name: str + :param body: Network Fabric Controller properties to update. Required. + :type body: IO[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 NetworkFabricController. The + NetworkFabricController is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + network_fabric_controller_name: str, + body: Union[_models.NetworkFabricControllerPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkFabricController]: + """Updates are currently not supported for the Network Fabric Controller resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. + :type network_fabric_controller_name: str + :param body: Network Fabric Controller properties to update. Is one of the following types: + NetworkFabricControllerPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabricControllerPatch or JSON or + IO[bytes] + :return: An instance of LROPoller that returns NetworkFabricController. The + NetworkFabricController is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkFabricController] = 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, + network_fabric_controller_name=network_fabric_controller_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkFabricController, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkFabricController].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkFabricController]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, network_fabric_controller_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_fabric_controllers_delete_request( + resource_group_name=resource_group_name, + network_fabric_controller_name=network_fabric_controller_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: 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]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, network_fabric_controller_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the Network Fabric Controller resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_controller_name: Name of the Network Fabric Controller. Required. + :type network_fabric_controller_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + network_fabric_controller_name=network_fabric_controller_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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 + ) -> ItemPaged["_models.NetworkFabricController"]: + """Lists all the NetworkFabricControllers thats available in the resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of NetworkFabricController + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkFabricController]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_fabric_controllers_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkFabricController], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> ItemPaged["_models.NetworkFabricController"]: + """Lists all the NetworkFabricControllers by subscription. + + :return: An iterator like instance of NetworkFabricController + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkFabricController] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkFabricController]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_fabric_controllers_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkFabricController], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class NetworkFabricSkusOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricClient`'s + :attr:`network_fabric_skus` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, network_fabric_sku_name: str, **kwargs: Any) -> _models.NetworkFabricSku: + """Implements Network Fabric SKU GET method. + + :param network_fabric_sku_name: Name of the Network Fabric SKU. Required. + :type network_fabric_sku_name: str + :return: NetworkFabricSku. The NetworkFabricSku is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkFabricSku + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkFabricSku] = kwargs.pop("cls", None) + + _request = build_network_fabric_skus_get_request( + network_fabric_sku_name=network_fabric_sku_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NetworkFabricSku, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.NetworkFabricSku"]: + """Implements Network Fabric SKUs list by subscription GET method. + + :return: An iterator like instance of NetworkFabricSku + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkFabricSku] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkFabricSku]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_fabric_skus_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkFabricSku], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class NetworkFabricsOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricClient`'s + :attr:`network_fabrics` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, network_fabric_name: str, **kwargs: Any) -> _models.NetworkFabric: + """Get Network Fabric resource details. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :return: NetworkFabric. The NetworkFabric is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkFabric + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkFabric] = kwargs.pop("cls", None) + + _request = build_network_fabrics_get_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NetworkFabric, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.NetworkFabric, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_fabrics_create_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + network_fabric_name: str, + body: _models.NetworkFabric, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkFabric]: + """Create Network Fabric resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabric + :keyword content_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 NetworkFabric. The NetworkFabric is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabric] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + network_fabric_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkFabric]: + """Create Network Fabric resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NetworkFabric. The NetworkFabric is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabric] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + network_fabric_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkFabric]: + """Create Network Fabric resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: IO[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 NetworkFabric. The NetworkFabric is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabric] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.NetworkFabric, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkFabric]: + """Create Network Fabric resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Is one of the following types: NetworkFabric, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabric or JSON or IO[bytes] + :return: An instance of LROPoller that returns NetworkFabric. The NetworkFabric is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabric] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkFabric] = 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_fabric_name=network_fabric_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkFabric, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkFabric].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkFabric]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.NetworkFabricPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_fabrics_update_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + network_fabric_name: str, + body: _models.NetworkFabricPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkFabric]: + """Update certain properties of the Network Fabric resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Network Fabric properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabricPatch + :keyword content_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 NetworkFabric. The NetworkFabric is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabric] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + network_fabric_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkFabric]: + """Update certain properties of the Network Fabric resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Network Fabric properties to update. Required. + :type body: JSON + :keyword content_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 NetworkFabric. The NetworkFabric is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabric] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + network_fabric_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkFabric]: + """Update certain properties of the Network Fabric resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Network Fabric properties to update. Required. + :type body: IO[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 NetworkFabric. The NetworkFabric is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabric] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.NetworkFabricPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkFabric]: + """Update certain properties of the Network Fabric resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Network Fabric properties to update. Is one of the following types: + NetworkFabricPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabricPatch or JSON or IO[bytes] + :return: An instance of LROPoller that returns NetworkFabric. The NetworkFabric is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabric] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkFabric] = 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, + network_fabric_name=network_fabric_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkFabric, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkFabric].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkFabric]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, resource_group_name: str, network_fabric_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_fabrics_delete_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: 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]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, network_fabric_name: str, **kwargs: Any) -> LROPoller[None]: + """Delete Network Fabric resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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) -> ItemPaged["_models.NetworkFabric"]: + """List all the Network Fabric resources in the given resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of NetworkFabric + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkFabric] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkFabric]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_fabrics_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkFabric], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> ItemPaged["_models.NetworkFabric"]: + """List all the Network Fabric resources in the given subscription. + + :return: An iterator like instance of NetworkFabric + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkFabric] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkFabric]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_fabrics_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkFabric], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def _provision_initial(self, resource_group_name: str, network_fabric_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_fabrics_provision_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def begin_provision( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Provisions the underlying resources in the given Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.OperationStatusResult] = 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._provision_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.OperationStatusResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.OperationStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.OperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def _deprovision_initial( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_fabrics_deprovision_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def begin_deprovision( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Deprovisions the underlying resources in the given Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.OperationStatusResult] = 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._deprovision_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.OperationStatusResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.OperationStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.OperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _upgrade_initial( + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.UpgradeNetworkFabricProperties, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_fabrics_upgrade_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_upgrade( + self, + resource_group_name: str, + network_fabric_name: str, + body: _models.UpgradeNetworkFabricProperties, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Upgrades the version of the underlying resources in the given Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Network Fabric properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpgradeNetworkFabricProperties + :keyword content_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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_upgrade( + self, + resource_group_name: str, + network_fabric_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Upgrades the version of the underlying resources in the given Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Network Fabric properties to update. Required. + :type body: JSON + :keyword content_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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_upgrade( + self, + resource_group_name: str, + network_fabric_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Upgrades the version of the underlying resources in the given Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Network Fabric properties to update. Required. + :type body: IO[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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_upgrade( + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.UpgradeNetworkFabricProperties, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Upgrades the version of the underlying resources in the given Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Network Fabric properties to update. Is one of the following types: + UpgradeNetworkFabricProperties, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpgradeNetworkFabricProperties or JSON or + IO[bytes] + :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.OperationStatusResult] = 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._upgrade_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.OperationStatusResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.OperationStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.OperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def _refresh_configuration_initial( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_fabrics_refresh_configuration_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def begin_refresh_configuration( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Refreshes the configuration of the underlying resources in the given Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.OperationStatusResult] = 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._refresh_configuration_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.OperationStatusResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.OperationStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.OperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _update_workload_management_bfd_configuration_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_fabrics_update_workload_management_bfd_configuration_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_workload_management_bfd_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_fabric_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the Workload Management BFD Configuration of the underlying resources in the given + Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_workload_management_bfd_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_fabric_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the Workload Management BFD Configuration of the underlying resources in the given + Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_workload_management_bfd_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_fabric_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the Workload Management BFD Configuration of the underlying resources in the given + Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: IO[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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_update_workload_management_bfd_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the Workload Management BFD Configuration of the underlying resources in the given + Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of LROPoller that returns UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateAdministrativeStateResponse] = 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_workload_management_bfd_configuration_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.UpdateAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.UpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.UpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _update_infra_management_bfd_configuration_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_fabrics_update_infra_management_bfd_configuration_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_infra_management_bfd_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_fabric_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the Infra Management BFD Configuration of the underlying resources in the given Network + Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_infra_management_bfd_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_fabric_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the Infra Management BFD Configuration of the underlying resources in the given Network + Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_infra_management_bfd_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_fabric_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the Infra Management BFD Configuration of the underlying resources in the given Network + Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: IO[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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_update_infra_management_bfd_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the Infra Management BFD Configuration of the underlying resources in the given Network + Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of LROPoller that returns UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateAdministrativeStateResponse] = 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_infra_management_bfd_configuration_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.UpdateAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.UpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.UpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _validate_configuration_initial( + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.ValidateConfigurationProperties, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_fabrics_validate_configuration_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_validate_configuration( + self, + resource_group_name: str, + network_fabric_name: str, + body: _models.ValidateConfigurationProperties, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ValidateConfigurationResponse]: + """Validates the configuration of the underlying resources in the given Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Validate configuration properties. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.ValidateConfigurationProperties + :keyword content_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 ValidateConfigurationResponse. The + ValidateConfigurationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_validate_configuration( + self, + resource_group_name: str, + network_fabric_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ValidateConfigurationResponse]: + """Validates the configuration of the underlying resources in the given Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Validate configuration properties. Required. + :type body: JSON + :keyword content_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 ValidateConfigurationResponse. The + ValidateConfigurationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_validate_configuration( + self, + resource_group_name: str, + network_fabric_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ValidateConfigurationResponse]: + """Validates the configuration of the underlying resources in the given Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Validate configuration properties. Required. + :type body: IO[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 ValidateConfigurationResponse. The + ValidateConfigurationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_validate_configuration( + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.ValidateConfigurationProperties, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ValidateConfigurationResponse]: + """Validates the configuration of the underlying resources in the given Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Validate configuration properties. Is one of the following types: + ValidateConfigurationProperties, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.ValidateConfigurationProperties or JSON or + IO[bytes] + :return: An instance of LROPoller that returns ValidateConfigurationResponse. The + ValidateConfigurationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ValidateConfigurationResponse] = 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._validate_configuration_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ValidateConfigurationResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ValidateConfigurationResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ValidateConfigurationResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def _get_topology_initial( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_fabrics_get_topology_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def begin_get_topology( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> LROPoller[_models.GetTopologyResponse]: + """Gets Topology of the underlying resources in the given Network Fabric instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :return: An instance of LROPoller that returns GetTopologyResponse. The GetTopologyResponse is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.GetTopologyResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.GetTopologyResponse] = 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_topology_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.GetTopologyResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.GetTopologyResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.GetTopologyResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _commit_configuration_initial( + self, + resource_group_name: str, + network_fabric_name: str, + body: Optional[Union[_models.CommitConfigurationRequest, JSON, IO[bytes]]] = None, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" if body else None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_network_fabrics_commit_configuration_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_commit_configuration( + self, + resource_group_name: str, + network_fabric_name: str, + body: Optional[_models.CommitConfigurationRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CommitConfigurationResponse]: + """Atomic update of the given Network Fabric instance. Sync update of NFA resources at Fabric + level. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: The content of the action request. Default value is None. + :type body: ~azure.mgmt.managednetworkfabric.models.CommitConfigurationRequest + :keyword content_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 CommitConfigurationResponse. The + CommitConfigurationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommitConfigurationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_commit_configuration( + self, + resource_group_name: str, + network_fabric_name: str, + body: Optional[JSON] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CommitConfigurationResponse]: + """Atomic update of the given Network Fabric instance. Sync update of NFA resources at Fabric + level. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: The content of the action request. Default value is None. + :type body: JSON + :keyword content_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 CommitConfigurationResponse. The + CommitConfigurationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommitConfigurationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_commit_configuration( + self, + resource_group_name: str, + network_fabric_name: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CommitConfigurationResponse]: + """Atomic update of the given Network Fabric instance. Sync update of NFA resources at Fabric + level. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: The content of the action request. Default value is None. + :type body: IO[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 CommitConfigurationResponse. The + CommitConfigurationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommitConfigurationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_commit_configuration( + self, + resource_group_name: str, + network_fabric_name: str, + body: Optional[Union[_models.CommitConfigurationRequest, JSON, IO[bytes]]] = None, + **kwargs: Any + ) -> LROPoller[_models.CommitConfigurationResponse]: + """Atomic update of the given Network Fabric instance. Sync update of NFA resources at Fabric + level. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: The content of the action request. Is one of the following types: + CommitConfigurationRequest, JSON, IO[bytes] Default value is None. + :type body: ~azure.mgmt.managednetworkfabric.models.CommitConfigurationRequest or JSON or + IO[bytes] + :return: An instance of LROPoller that returns CommitConfigurationResponse. The + CommitConfigurationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommitConfigurationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None + cls: ClsType[_models.CommitConfigurationResponse] = 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._commit_configuration_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.CommitConfigurationResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.CommitConfigurationResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.CommitConfigurationResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _commit_batch_status_initial( + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.CommitBatchStatusRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_fabrics_commit_batch_status_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_commit_batch_status( + self, + resource_group_name: str, + network_fabric_name: str, + body: _models.CommitBatchStatusRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CommitBatchStatusOperationResponse]: + """Post action: Returns a status of commit batch operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.CommitBatchStatusRequest + :keyword content_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 CommitBatchStatusOperationResponse. The + CommitBatchStatusOperationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommitBatchStatusOperationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_commit_batch_status( + self, + resource_group_name: str, + network_fabric_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CommitBatchStatusOperationResponse]: + """Post action: Returns a status of commit batch operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 CommitBatchStatusOperationResponse. The + CommitBatchStatusOperationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommitBatchStatusOperationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_commit_batch_status( + self, + resource_group_name: str, + network_fabric_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CommitBatchStatusOperationResponse]: + """Post action: Returns a status of commit batch operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: IO[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 CommitBatchStatusOperationResponse. The + CommitBatchStatusOperationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommitBatchStatusOperationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_commit_batch_status( + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.CommitBatchStatusRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.CommitBatchStatusOperationResponse]: + """Post action: Returns a status of commit batch operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Is one of the following types: CommitBatchStatusRequest, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.CommitBatchStatusRequest or JSON or + IO[bytes] + :return: An instance of LROPoller that returns CommitBatchStatusOperationResponse. The + CommitBatchStatusOperationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommitBatchStatusOperationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CommitBatchStatusOperationResponse] = 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._commit_batch_status_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.CommitBatchStatusOperationResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.CommitBatchStatusOperationResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.CommitBatchStatusOperationResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _discard_commit_batch_initial( + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.DiscardCommitBatchRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_fabrics_discard_commit_batch_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_discard_commit_batch( + self, + resource_group_name: str, + network_fabric_name: str, + body: _models.DiscardCommitBatchRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DiscardCommitBatchOperationResponse]: + """Post action: Discards a Batch operation in progress. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.DiscardCommitBatchRequest + :keyword content_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 DiscardCommitBatchOperationResponse. The + DiscardCommitBatchOperationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.DiscardCommitBatchOperationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_discard_commit_batch( + self, + resource_group_name: str, + network_fabric_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DiscardCommitBatchOperationResponse]: + """Post action: Discards a Batch operation in progress. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 DiscardCommitBatchOperationResponse. The + DiscardCommitBatchOperationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.DiscardCommitBatchOperationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_discard_commit_batch( + self, + resource_group_name: str, + network_fabric_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DiscardCommitBatchOperationResponse]: + """Post action: Discards a Batch operation in progress. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: IO[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 DiscardCommitBatchOperationResponse. The + DiscardCommitBatchOperationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.DiscardCommitBatchOperationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_discard_commit_batch( + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.DiscardCommitBatchRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.DiscardCommitBatchOperationResponse]: + """Post action: Discards a Batch operation in progress. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Is one of the following types: DiscardCommitBatchRequest, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.DiscardCommitBatchRequest or JSON or + IO[bytes] + :return: An instance of LROPoller that returns DiscardCommitBatchOperationResponse. The + DiscardCommitBatchOperationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.DiscardCommitBatchOperationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DiscardCommitBatchOperationResponse] = 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._discard_commit_batch_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.DiscardCommitBatchOperationResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.DiscardCommitBatchOperationResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.DiscardCommitBatchOperationResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _lock_fabric_initial( + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.NetworkFabricLockRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_fabrics_lock_fabric_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_lock_fabric( + self, + resource_group_name: str, + network_fabric_name: str, + body: _models.NetworkFabricLockRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Post action: Triggers network fabric lock operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabricLockRequest + :keyword content_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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_lock_fabric( + self, + resource_group_name: str, + network_fabric_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Post action: Triggers network fabric lock operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_lock_fabric( + self, + resource_group_name: str, + network_fabric_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Post action: Triggers network fabric lock operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Required. + :type body: IO[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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_lock_fabric( + self, + resource_group_name: str, + network_fabric_name: str, + body: Union[_models.NetworkFabricLockRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Post action: Triggers network fabric lock operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param body: Request payload. Is one of the following types: NetworkFabricLockRequest, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkFabricLockRequest or JSON or + IO[bytes] + :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.OperationStatusResult] = 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._lock_fabric_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.OperationStatusResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.OperationStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.OperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def _view_device_configuration_initial( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_fabrics_view_device_configuration_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def begin_view_device_configuration( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> LROPoller[_models.ViewDeviceConfigurationOperationResponse]: + """Post action: Triggers view of network fabric configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :return: An instance of LROPoller that returns ViewDeviceConfigurationOperationResponse. The + ViewDeviceConfigurationOperationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ViewDeviceConfigurationOperationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ViewDeviceConfigurationOperationResponse] = 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._view_device_configuration_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ViewDeviceConfigurationOperationResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ViewDeviceConfigurationOperationResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ViewDeviceConfigurationOperationResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def _arm_configuration_diff_initial( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_fabrics_arm_configuration_diff_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def begin_arm_configuration_diff( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> LROPoller[_models.ArmConfigurationDiffOperationResponse]: + """Post action: Triggers diff of NetworkFabric ARM Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :return: An instance of LROPoller that returns ArmConfigurationDiffOperationResponse. The + ArmConfigurationDiffOperationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ArmConfigurationDiffOperationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ArmConfigurationDiffOperationResponse] = 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._arm_configuration_diff_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ArmConfigurationDiffOperationResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ArmConfigurationDiffOperationResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ArmConfigurationDiffOperationResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def _rotate_passwords_initial( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_fabrics_rotate_passwords_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def begin_rotate_passwords( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> LROPoller[_models.NetworkFabricRotatePasswordsResponse]: + """Rotate all passwords on the Terminal Server and Network Devices. + + Creates new passwords, then updates the Terminal Server and Network Devices to use the new + passwords. + + Note that disabled devices cannot be updated and must be resynchronized with the new passwords + once they are enabled. + + Fails if any of the devices could not be updated with the new password. + Failed devices should be resynchronized with the new passwords once possible. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :return: An instance of LROPoller that returns NetworkFabricRotatePasswordsResponse. The + NetworkFabricRotatePasswordsResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricRotatePasswordsResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkFabricRotatePasswordsResponse] = 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._rotate_passwords_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkFabricRotatePasswordsResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkFabricRotatePasswordsResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkFabricRotatePasswordsResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def _resync_passwords_initial( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_fabrics_resync_passwords_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def begin_resync_passwords( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> LROPoller[_models.NetworkFabricResyncPasswordsResponse]: + """Resync the latest passwords to the Terminal Server and Network Devices. + + Updates the Terminal Server and all Network Devices to use the latest passwords. Does not + generate new passwords. + + Allows devices to be brought back in sync after a partially successful password rotation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :return: An instance of LROPoller that returns NetworkFabricResyncPasswordsResponse. The + NetworkFabricResyncPasswordsResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricResyncPasswordsResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkFabricResyncPasswordsResponse] = 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._resync_passwords_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkFabricResyncPasswordsResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkFabricResyncPasswordsResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkFabricResyncPasswordsResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def _rotate_certificates_initial( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_fabrics_rotate_certificates_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def begin_rotate_certificates( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> LROPoller[_models.NetworkFabricRotateCertificatesResponse]: + """Rotate all certificates on Network Devices. + + Creates new certificates, then updates the Network Devices to use the new certificates. Note + that disabled devices cannot be updated and must be resynchronized with the new certificates + once they are enabled. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :return: An instance of LROPoller that returns NetworkFabricRotateCertificatesResponse. The + NetworkFabricRotateCertificatesResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricRotateCertificatesResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkFabricRotateCertificatesResponse] = 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._rotate_certificates_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkFabricRotateCertificatesResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkFabricRotateCertificatesResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkFabricRotateCertificatesResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def _resync_certificates_initial( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_fabrics_resync_certificates_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_fabric_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def begin_resync_certificates( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> LROPoller[_models.NetworkFabricResyncCertificatesResponse]: + """Re-sync all certificates on Network Devices. + + Updates all Network Devices to use the latest certificates. Does not generate new certificates. + Allows network devices missed during a previous certificate rotation to be brought back into + sync. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :return: An instance of LROPoller that returns NetworkFabricResyncCertificatesResponse. The + NetworkFabricResyncCertificatesResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkFabricResyncCertificatesResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkFabricResyncCertificatesResponse] = 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._resync_certificates_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkFabricResyncCertificatesResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkFabricResyncCertificatesResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkFabricResyncCertificatesResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class NetworkToNetworkInterconnectsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricClient`'s + :attr:`network_to_network_interconnects` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + **kwargs: Any + ) -> _models.NetworkToNetworkInterconnect: + """Implements NetworkToNetworkInterconnects GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :return: NetworkToNetworkInterconnect. The NetworkToNetworkInterconnect is compatible with + MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkToNetworkInterconnect] = kwargs.pop("cls", None) + + _request = build_network_to_network_interconnects_get_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + network_to_network_interconnect_name=network_to_network_interconnect_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NetworkToNetworkInterconnect, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: Union[_models.NetworkToNetworkInterconnect, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_to_network_interconnects_create_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + network_to_network_interconnect_name=network_to_network_interconnect_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: _models.NetworkToNetworkInterconnect, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkToNetworkInterconnect]: + """Configuration used to setup CE-PE connectivity PUT Method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect + :keyword content_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 NetworkToNetworkInterconnect. The + NetworkToNetworkInterconnect is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkToNetworkInterconnect]: + """Configuration used to setup CE-PE connectivity PUT Method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NetworkToNetworkInterconnect. The + NetworkToNetworkInterconnect is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkToNetworkInterconnect]: + """Configuration used to setup CE-PE connectivity PUT Method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Required. + :type body: IO[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 NetworkToNetworkInterconnect. The + NetworkToNetworkInterconnect is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: Union[_models.NetworkToNetworkInterconnect, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkToNetworkInterconnect]: + """Configuration used to setup CE-PE connectivity PUT Method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Is one of the following types: NetworkToNetworkInterconnect, + JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect or JSON or + IO[bytes] + :return: An instance of LROPoller that returns NetworkToNetworkInterconnect. The + NetworkToNetworkInterconnect is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkToNetworkInterconnect] = 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_fabric_name=network_fabric_name, + network_to_network_interconnect_name=network_to_network_interconnect_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkToNetworkInterconnect, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkToNetworkInterconnect].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkToNetworkInterconnect]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: Union[_models.NetworkToNetworkInterconnectPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_to_network_interconnects_update_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + network_to_network_interconnect_name=network_to_network_interconnect_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: _models.NetworkToNetworkInterconnectPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkToNetworkInterconnect]: + """Update certain properties of the Network To NetworkInterconnects resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Network to Network Interconnect properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnectPatch + :keyword content_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 NetworkToNetworkInterconnect. The + NetworkToNetworkInterconnect is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkToNetworkInterconnect]: + """Update certain properties of the Network To NetworkInterconnects resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Network to Network Interconnect properties to update. Required. + :type body: JSON + :keyword content_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 NetworkToNetworkInterconnect. The + NetworkToNetworkInterconnect is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkToNetworkInterconnect]: + """Update certain properties of the Network To NetworkInterconnects resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Network to Network Interconnect properties to update. Required. + :type body: IO[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 NetworkToNetworkInterconnect. The + NetworkToNetworkInterconnect is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: Union[_models.NetworkToNetworkInterconnectPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkToNetworkInterconnect]: + """Update certain properties of the Network To NetworkInterconnects resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Network to Network Interconnect properties to update. Is one of the following + types: NetworkToNetworkInterconnectPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnectPatch or JSON + or IO[bytes] + :return: An instance of LROPoller that returns NetworkToNetworkInterconnect. The + NetworkToNetworkInterconnect is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkToNetworkInterconnect] = 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, + network_fabric_name=network_fabric_name, + network_to_network_interconnect_name=network_to_network_interconnect_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkToNetworkInterconnect, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkToNetworkInterconnect].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkToNetworkInterconnect]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_to_network_interconnects_delete_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + network_to_network_interconnect_name=network_to_network_interconnect_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: 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]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Implements NetworkToNetworkInterconnects DELETE method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + network_to_network_interconnect_name=network_to_network_interconnect_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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_network_fabric( + self, resource_group_name: str, network_fabric_name: str, **kwargs: Any + ) -> ItemPaged["_models.NetworkToNetworkInterconnect"]: + """Implements Network To Network Interconnects list by Network Fabric GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :return: An iterator like instance of NetworkToNetworkInterconnect + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkToNetworkInterconnect] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkToNetworkInterconnect]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_to_network_interconnects_list_by_network_fabric_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkToNetworkInterconnect], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "network_to_network_interconnect_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _update_npb_static_route_bfd_administrative_state_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_to_network_interconnects_update_npb_static_route_bfd_administrative_state_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + network_to_network_interconnect_name=network_to_network_interconnect_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_npb_static_route_bfd_administrative_state( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the NPB Static Route BFD Administrative State. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_npb_static_route_bfd_administrative_state( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the NPB Static Route BFD Administrative State. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_npb_static_route_bfd_administrative_state( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the NPB Static Route BFD Administrative State. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Required. + :type body: IO[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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "network_to_network_interconnect_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_update_npb_static_route_bfd_administrative_state( # pylint: disable=name-too-long + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the NPB Static Route BFD Administrative State. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of LROPoller that returns UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateAdministrativeStateResponse] = 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_npb_static_route_bfd_administrative_state_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + network_to_network_interconnect_name=network_to_network_interconnect_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.UpdateAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.UpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.UpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "network_to_network_interconnect_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _update_administrative_state_initial( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_to_network_interconnects_update_administrative_state_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + network_to_network_interconnect_name=network_to_network_interconnect_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the Admin State. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the Admin State. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the Admin State. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Required. + :type body: IO[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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "network_to_network_interconnect_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_update_administrative_state( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Updates the Admin State. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of LROPoller that returns UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateAdministrativeStateResponse] = 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_administrative_state_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + network_to_network_interconnect_name=network_to_network_interconnect_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.UpdateAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.UpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.UpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "network_to_network_interconnect_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _update_bfd_administrative_state_initial( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: Union[_models.NniUpdateBfdAdministrativeStateRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_to_network_interconnects_update_bfd_administrative_state_request( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + network_to_network_interconnect_name=network_to_network_interconnect_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_bfd_administrative_state( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: _models.NniUpdateBfdAdministrativeStateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NniUpdateBfdAdministrativeStateResponse]: + """Updates the Admin State. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NniUpdateBfdAdministrativeStateRequest + :keyword content_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 NniUpdateBfdAdministrativeStateResponse. The + NniUpdateBfdAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NniUpdateBfdAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_bfd_administrative_state( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NniUpdateBfdAdministrativeStateResponse]: + """Updates the Admin State. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NniUpdateBfdAdministrativeStateResponse. The + NniUpdateBfdAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NniUpdateBfdAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_bfd_administrative_state( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NniUpdateBfdAdministrativeStateResponse]: + """Updates the Admin State. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Required. + :type body: IO[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 NniUpdateBfdAdministrativeStateResponse. The + NniUpdateBfdAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NniUpdateBfdAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_fabric_name", + "network_to_network_interconnect_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_update_bfd_administrative_state( + self, + resource_group_name: str, + network_fabric_name: str, + network_to_network_interconnect_name: str, + body: Union[_models.NniUpdateBfdAdministrativeStateRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NniUpdateBfdAdministrativeStateResponse]: + """Updates the Admin State. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_fabric_name: Name of the Network Fabric. Required. + :type network_fabric_name: str + :param network_to_network_interconnect_name: Name of the Network to Network Interconnect. + Required. + :type network_to_network_interconnect_name: str + :param body: Request payload. Is one of the following types: + NniUpdateBfdAdministrativeStateRequest, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NniUpdateBfdAdministrativeStateRequest or + JSON or IO[bytes] + :return: An instance of LROPoller that returns NniUpdateBfdAdministrativeStateResponse. The + NniUpdateBfdAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NniUpdateBfdAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NniUpdateBfdAdministrativeStateResponse] = 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_bfd_administrative_state_initial( + resource_group_name=resource_group_name, + network_fabric_name=network_fabric_name, + network_to_network_interconnect_name=network_to_network_interconnect_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NniUpdateBfdAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NniUpdateBfdAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NniUpdateBfdAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class NetworkPacketBrokersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricClient`'s + :attr:`network_packet_brokers` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, network_packet_broker_name: str, **kwargs: Any + ) -> _models.NetworkPacketBroker: + """Retrieves details of this Network Packet Broker. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_packet_broker_name: Name of the Network Packet Broker. Required. + :type network_packet_broker_name: str + :return: NetworkPacketBroker. The NetworkPacketBroker is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkPacketBroker] = kwargs.pop("cls", None) + + _request = build_network_packet_brokers_get_request( + resource_group_name=resource_group_name, + network_packet_broker_name=network_packet_broker_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NetworkPacketBroker, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( + self, + resource_group_name: str, + network_packet_broker_name: str, + body: Union[_models.NetworkPacketBroker, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_packet_brokers_create_request( + resource_group_name=resource_group_name, + network_packet_broker_name=network_packet_broker_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + network_packet_broker_name: str, + body: _models.NetworkPacketBroker, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkPacketBroker]: + """Creates a Network Packet Broker. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_packet_broker_name: Name of the Network Packet Broker. Required. + :type network_packet_broker_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker + :keyword content_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 NetworkPacketBroker. The NetworkPacketBroker is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + network_packet_broker_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkPacketBroker]: + """Creates a Network Packet Broker. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_packet_broker_name: Name of the Network Packet Broker. Required. + :type network_packet_broker_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NetworkPacketBroker. The NetworkPacketBroker is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + network_packet_broker_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkPacketBroker]: + """Creates a Network Packet Broker. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_packet_broker_name: Name of the Network Packet Broker. Required. + :type network_packet_broker_name: str + :param body: Request payload. Required. + :type body: IO[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 NetworkPacketBroker. The NetworkPacketBroker is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + network_packet_broker_name: str, + body: Union[_models.NetworkPacketBroker, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkPacketBroker]: + """Creates a Network Packet Broker. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_packet_broker_name: Name of the Network Packet Broker. Required. + :type network_packet_broker_name: str + :param body: Request payload. Is one of the following types: NetworkPacketBroker, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker or JSON or IO[bytes] + :return: An instance of LROPoller that returns NetworkPacketBroker. The NetworkPacketBroker is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkPacketBroker] = 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_packet_broker_name=network_packet_broker_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkPacketBroker, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkPacketBroker].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkPacketBroker]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + network_packet_broker_name: str, + body: Union[_models.NetworkPacketBrokerPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_packet_brokers_update_request( + resource_group_name=resource_group_name, + network_packet_broker_name=network_packet_broker_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + network_packet_broker_name: str, + body: _models.NetworkPacketBrokerPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkPacketBroker]: + """API to update certain properties of the Network Packet Broker resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_packet_broker_name: Name of the Network Packet Broker. Required. + :type network_packet_broker_name: str + :param body: Network Packet Broker properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkPacketBrokerPatch + :keyword content_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 NetworkPacketBroker. The NetworkPacketBroker is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + network_packet_broker_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkPacketBroker]: + """API to update certain properties of the Network Packet Broker resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_packet_broker_name: Name of the Network Packet Broker. Required. + :type network_packet_broker_name: str + :param body: Network Packet Broker properties to update. Required. + :type body: JSON + :keyword content_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 NetworkPacketBroker. The NetworkPacketBroker is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + network_packet_broker_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkPacketBroker]: + """API to update certain properties of the Network Packet Broker resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_packet_broker_name: Name of the Network Packet Broker. Required. + :type network_packet_broker_name: str + :param body: Network Packet Broker properties to update. Required. + :type body: IO[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 NetworkPacketBroker. The NetworkPacketBroker is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + network_packet_broker_name: str, + body: Union[_models.NetworkPacketBrokerPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkPacketBroker]: + """API to update certain properties of the Network Packet Broker resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_packet_broker_name: Name of the Network Packet Broker. Required. + :type network_packet_broker_name: str + :param body: Network Packet Broker properties to update. Is one of the following types: + NetworkPacketBrokerPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkPacketBrokerPatch or JSON or + IO[bytes] + :return: An instance of LROPoller that returns NetworkPacketBroker. The NetworkPacketBroker is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkPacketBroker] = 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, + network_packet_broker_name=network_packet_broker_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkPacketBroker, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkPacketBroker].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkPacketBroker]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, network_packet_broker_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_packet_brokers_delete_request( + resource_group_name=resource_group_name, + network_packet_broker_name=network_packet_broker_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: 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]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, network_packet_broker_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes Network Packet Broker. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_packet_broker_name: Name of the Network Packet Broker. Required. + :type network_packet_broker_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + network_packet_broker_name=network_packet_broker_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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 + ) -> ItemPaged["_models.NetworkPacketBroker"]: + """Displays NetworkPacketBrokers list by resource group GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of NetworkPacketBroker + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkPacketBroker]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_packet_brokers_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkPacketBroker], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> ItemPaged["_models.NetworkPacketBroker"]: + """Displays Network Packet Brokers list by subscription GET method. + + :return: An iterator like instance of NetworkPacketBroker + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkPacketBroker] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkPacketBroker]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_packet_brokers_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkPacketBroker], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class NetworkRacksOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricClient`'s + :attr:`network_racks` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, network_rack_name: str, **kwargs: Any) -> _models.NetworkRack: + """Get Network Rack resource details. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_rack_name: Name of the Network Rack. Required. + :type network_rack_name: str + :return: NetworkRack. The NetworkRack is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkRack + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkRack] = kwargs.pop("cls", None) + + _request = build_network_racks_get_request( + resource_group_name=resource_group_name, + network_rack_name=network_rack_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NetworkRack, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( + self, + resource_group_name: str, + network_rack_name: str, + body: Union[_models.NetworkRack, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_racks_create_request( + resource_group_name=resource_group_name, + network_rack_name=network_rack_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + network_rack_name: str, + body: _models.NetworkRack, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkRack]: + """Create Network Rack resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_rack_name: Name of the Network Rack. Required. + :type network_rack_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkRack + :keyword content_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 NetworkRack. The NetworkRack is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkRack] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + network_rack_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkRack]: + """Create Network Rack resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_rack_name: Name of the Network Rack. Required. + :type network_rack_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NetworkRack. The NetworkRack is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkRack] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + network_rack_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkRack]: + """Create Network Rack resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_rack_name: Name of the Network Rack. Required. + :type network_rack_name: str + :param body: Request payload. Required. + :type body: IO[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 NetworkRack. The NetworkRack is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkRack] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + network_rack_name: str, + body: Union[_models.NetworkRack, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkRack]: + """Create Network Rack resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_rack_name: Name of the Network Rack. Required. + :type network_rack_name: str + :param body: Request payload. Is one of the following types: NetworkRack, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkRack or JSON or IO[bytes] + :return: An instance of LROPoller that returns NetworkRack. The NetworkRack is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkRack] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkRack] = 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_rack_name=network_rack_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkRack, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkRack].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkRack]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + network_rack_name: str, + body: Union[_models.NetworkRackPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_racks_update_request( + resource_group_name=resource_group_name, + network_rack_name=network_rack_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + network_rack_name: str, + body: _models.NetworkRackPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkRack]: + """Update certain properties of the Network Rack resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_rack_name: Name of the Network Rack. Required. + :type network_rack_name: str + :param body: Network Rack properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkRackPatch + :keyword content_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 NetworkRack. The NetworkRack is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkRack] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + network_rack_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkRack]: + """Update certain properties of the Network Rack resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_rack_name: Name of the Network Rack. Required. + :type network_rack_name: str + :param body: Network Rack properties to update. Required. + :type body: JSON + :keyword content_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 NetworkRack. The NetworkRack is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkRack] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + network_rack_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkRack]: + """Update certain properties of the Network Rack resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_rack_name: Name of the Network Rack. Required. + :type network_rack_name: str + :param body: Network Rack properties to update. Required. + :type body: IO[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 NetworkRack. The NetworkRack is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkRack] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + network_rack_name: str, + body: Union[_models.NetworkRackPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkRack]: + """Update certain properties of the Network Rack resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_rack_name: Name of the Network Rack. Required. + :type network_rack_name: str + :param body: Network Rack properties to update. Is one of the following types: + NetworkRackPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkRackPatch or JSON or IO[bytes] + :return: An instance of LROPoller that returns NetworkRack. The NetworkRack is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkRack] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkRack] = 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, + network_rack_name=network_rack_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkRack, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkRack].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkRack]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, resource_group_name: str, network_rack_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_racks_delete_request( + resource_group_name=resource_group_name, + network_rack_name=network_rack_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: 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]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, network_rack_name: str, **kwargs: Any) -> LROPoller[None]: + """Delete Network Rack resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_rack_name: Name of the Network Rack. Required. + :type network_rack_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + network_rack_name=network_rack_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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) -> ItemPaged["_models.NetworkRack"]: + """List all Network Rack resources in the given resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of NetworkRack + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkRack] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkRack]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_racks_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkRack], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> ItemPaged["_models.NetworkRack"]: + """List all Network Rack resources in the given subscription. + + :return: An iterator like instance of NetworkRack + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkRack] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkRack]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_racks_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkRack], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class NetworkTapRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricClient`'s + :attr:`network_tap_rules` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, network_tap_rule_name: str, **kwargs: Any) -> _models.NetworkTapRule: + """Get Network Tap Rule resource details. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :return: NetworkTapRule. The NetworkTapRule is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkTapRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkTapRule] = kwargs.pop("cls", None) + + _request = build_network_tap_rules_get_request( + resource_group_name=resource_group_name, + network_tap_rule_name=network_tap_rule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NetworkTapRule, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( + self, + resource_group_name: str, + network_tap_rule_name: str, + body: Union[_models.NetworkTapRule, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_tap_rules_create_request( + resource_group_name=resource_group_name, + network_tap_rule_name=network_tap_rule_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + network_tap_rule_name: str, + body: _models.NetworkTapRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkTapRule]: + """Create Network Tap Rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTapRule + :keyword content_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 NetworkTapRule. The NetworkTapRule is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + network_tap_rule_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkTapRule]: + """Create Network Tap Rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NetworkTapRule. The NetworkTapRule is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + network_tap_rule_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkTapRule]: + """Create Network Tap Rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :param body: Request payload. Required. + :type body: IO[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 NetworkTapRule. The NetworkTapRule is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + network_tap_rule_name: str, + body: Union[_models.NetworkTapRule, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkTapRule]: + """Create Network Tap Rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :param body: Request payload. Is one of the following types: NetworkTapRule, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTapRule or JSON or IO[bytes] + :return: An instance of LROPoller that returns NetworkTapRule. The NetworkTapRule is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkTapRule] = 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_tap_rule_name=network_tap_rule_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkTapRule, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkTapRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkTapRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + network_tap_rule_name: str, + body: Union[_models.NetworkTapRulePatch, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_tap_rules_update_request( + resource_group_name=resource_group_name, + network_tap_rule_name=network_tap_rule_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + network_tap_rule_name: str, + body: _models.NetworkTapRulePatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkTapRule]: + """Update certain properties of the Network Tap Rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :param body: Network Tap Rule properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTapRulePatch + :keyword content_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 NetworkTapRule. The NetworkTapRule is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + network_tap_rule_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkTapRule]: + """Update certain properties of the Network Tap Rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :param body: Network Tap Rule properties to update. Required. + :type body: JSON + :keyword content_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 NetworkTapRule. The NetworkTapRule is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + network_tap_rule_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkTapRule]: + """Update certain properties of the Network Tap Rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :param body: Network Tap Rule properties to update. Required. + :type body: IO[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 NetworkTapRule. The NetworkTapRule is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + network_tap_rule_name: str, + body: Union[_models.NetworkTapRulePatch, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkTapRule]: + """Update certain properties of the Network Tap Rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :param body: Network Tap Rule properties to update. Is one of the following types: + NetworkTapRulePatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTapRulePatch or JSON or IO[bytes] + :return: An instance of LROPoller that returns NetworkTapRule. The NetworkTapRule is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkTapRule] = 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, + network_tap_rule_name=network_tap_rule_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkTapRule, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkTapRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkTapRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, resource_group_name: str, network_tap_rule_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_tap_rules_delete_request( + resource_group_name=resource_group_name, + network_tap_rule_name=network_tap_rule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: 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]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, network_tap_rule_name: str, **kwargs: Any) -> LROPoller[None]: + """Delete Network Tap Rule resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + network_tap_rule_name=network_tap_rule_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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) -> ItemPaged["_models.NetworkTapRule"]: + """List all the Network Tap Rule resources in the given resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of NetworkTapRule + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkTapRule]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_tap_rules_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkTapRule], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> ItemPaged["_models.NetworkTapRule"]: + """List all the Network Tap Rule resources in the given subscription. + + :return: An iterator like instance of NetworkTapRule + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkTapRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkTapRule]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_tap_rules_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkTapRule], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _update_administrative_state_initial( + self, + resource_group_name: str, + network_tap_rule_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_tap_rules_update_administrative_state_request( + resource_group_name=resource_group_name, + network_tap_rule_name=network_tap_rule_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + network_tap_rule_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 CommonPostActionResponseForStateUpdate. The + CommonPostActionResponseForStateUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + network_tap_rule_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 CommonPostActionResponseForStateUpdate. The + CommonPostActionResponseForStateUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + network_tap_rule_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :param body: Request payload. Required. + :type body: IO[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 CommonPostActionResponseForStateUpdate. The + CommonPostActionResponseForStateUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_administrative_state( + self, + resource_group_name: str, + network_tap_rule_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of LROPoller that returns CommonPostActionResponseForStateUpdate. The + CommonPostActionResponseForStateUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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_administrative_state_initial( + resource_group_name=resource_group_name, + network_tap_rule_name=network_tap_rule_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.CommonPostActionResponseForStateUpdate, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.CommonPostActionResponseForStateUpdate].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.CommonPostActionResponseForStateUpdate]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_tap_rule_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def _resync_initial(self, resource_group_name: str, network_tap_rule_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_tap_rules_resync_request( + resource_group_name=resource_group_name, + network_tap_rule_name=network_tap_rule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_tap_rule_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def begin_resync( + self, resource_group_name: str, network_tap_rule_name: str, **kwargs: Any + ) -> LROPoller[_models.NetworkTapRuleResyncResponse]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :return: An instance of LROPoller that returns NetworkTapRuleResyncResponse. The + NetworkTapRuleResyncResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapRuleResyncResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkTapRuleResyncResponse] = 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._resync_initial( + resource_group_name=resource_group_name, + network_tap_rule_name=network_tap_rule_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkTapRuleResyncResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkTapRuleResyncResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkTapRuleResyncResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _validate_configuration_initial( + self, resource_group_name: str, network_tap_rule_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_tap_rules_validate_configuration_request( + resource_group_name=resource_group_name, + network_tap_rule_name=network_tap_rule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_validate_configuration( + self, resource_group_name: str, network_tap_rule_name: str, **kwargs: Any + ) -> LROPoller[_models.ValidateConfigurationResponse]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_rule_name: Name of the Network Tap Rule. Required. + :type network_tap_rule_name: str + :return: An instance of LROPoller that returns ValidateConfigurationResponse. The + ValidateConfigurationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ValidateConfigurationResponse] = 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._validate_configuration_initial( + resource_group_name=resource_group_name, + network_tap_rule_name=network_tap_rule_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ValidateConfigurationResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ValidateConfigurationResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ValidateConfigurationResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class NetworkTapsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricClient`'s + :attr:`network_taps` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, network_tap_name: str, **kwargs: Any) -> _models.NetworkTap: + """Retrieves details of this Network Tap. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_name: Name of the Network Tap. Required. + :type network_tap_name: str + :return: NetworkTap. The NetworkTap is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkTap + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkTap] = kwargs.pop("cls", None) + + _request = build_network_taps_get_request( + resource_group_name=resource_group_name, + network_tap_name=network_tap_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NetworkTap, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( + self, + resource_group_name: str, + network_tap_name: str, + body: Union[_models.NetworkTap, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_taps_create_request( + resource_group_name=resource_group_name, + network_tap_name=network_tap_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + network_tap_name: str, + body: _models.NetworkTap, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkTap]: + """Creates a Network Tap. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_name: Name of the Network Tap. Required. + :type network_tap_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTap + :keyword content_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 NetworkTap. The NetworkTap is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + network_tap_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkTap]: + """Creates a Network Tap. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_name: Name of the Network Tap. Required. + :type network_tap_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NetworkTap. The NetworkTap is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + network_tap_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkTap]: + """Creates a Network Tap. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_name: Name of the Network Tap. Required. + :type network_tap_name: str + :param body: Request payload. Required. + :type body: IO[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 NetworkTap. The NetworkTap is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + network_tap_name: str, + body: Union[_models.NetworkTap, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkTap]: + """Creates a Network Tap. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_name: Name of the Network Tap. Required. + :type network_tap_name: str + :param body: Request payload. Is one of the following types: NetworkTap, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTap or JSON or IO[bytes] + :return: An instance of LROPoller that returns NetworkTap. The NetworkTap is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkTap] = 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_tap_name=network_tap_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkTap, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkTap].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkTap]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + network_tap_name: str, + body: Union[_models.NetworkTapPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_taps_update_request( + resource_group_name=resource_group_name, + network_tap_name=network_tap_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + network_tap_name: str, + body: _models.NetworkTapPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkTap]: + """API to update certain properties of the Network Tap resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_name: Name of the Network Tap. Required. + :type network_tap_name: str + :param body: Network Tap properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTapPatch + :keyword content_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 NetworkTap. The NetworkTap is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + network_tap_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkTap]: + """API to update certain properties of the Network Tap resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_name: Name of the Network Tap. Required. + :type network_tap_name: str + :param body: Network Tap properties to update. Required. + :type body: JSON + :keyword content_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 NetworkTap. The NetworkTap is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + network_tap_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkTap]: + """API to update certain properties of the Network Tap resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_name: Name of the Network Tap. Required. + :type network_tap_name: str + :param body: Network Tap properties to update. Required. + :type body: IO[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 NetworkTap. The NetworkTap is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + network_tap_name: str, + body: Union[_models.NetworkTapPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkTap]: + """API to update certain properties of the Network Tap resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_name: Name of the Network Tap. Required. + :type network_tap_name: str + :param body: Network Tap properties to update. Is one of the following types: NetworkTapPatch, + JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkTapPatch or JSON or IO[bytes] + :return: An instance of LROPoller that returns NetworkTap. The NetworkTap is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkTap] = 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, + network_tap_name=network_tap_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkTap, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkTap].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkTap]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, resource_group_name: str, network_tap_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_taps_delete_request( + resource_group_name=resource_group_name, + network_tap_name=network_tap_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: 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]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, network_tap_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes Network Tap. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_name: Name of the Network Tap. Required. + :type network_tap_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + network_tap_name=network_tap_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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) -> ItemPaged["_models.NetworkTap"]: + """Displays Network Taps list by resource group GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of NetworkTap + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkTap]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_taps_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkTap], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> ItemPaged["_models.NetworkTap"]: + """Displays Network Taps list by subscription GET method. + + :return: An iterator like instance of NetworkTap + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkTap] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkTap]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_taps_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkTap], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_tap_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _update_administrative_state_initial( + self, + resource_group_name: str, + network_tap_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_taps_update_administrative_state_request( + resource_group_name=resource_group_name, + network_tap_name=network_tap_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + network_tap_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_name: Name of the Network Tap. Required. + :type network_tap_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + network_tap_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_name: Name of the Network Tap. Required. + :type network_tap_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + network_tap_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_name: Name of the Network Tap. Required. + :type network_tap_name: str + :param body: Request payload. Required. + :type body: IO[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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_tap_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_update_administrative_state( + self, + resource_group_name: str, + network_tap_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_name: Name of the Network Tap. Required. + :type network_tap_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of LROPoller that returns UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateAdministrativeStateResponse] = 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_administrative_state_initial( + resource_group_name=resource_group_name, + network_tap_name=network_tap_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.UpdateAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.UpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.UpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_tap_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def _resync_initial(self, resource_group_name: str, network_tap_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_taps_resync_request( + resource_group_name=resource_group_name, + network_tap_name=network_tap_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_tap_name", "accept"] + }, + api_versions_list=["2025-07-15"], + ) + def begin_resync( + self, resource_group_name: str, network_tap_name: str, **kwargs: Any + ) -> LROPoller[_models.NetworkTapResyncResponse]: + """Implements the operation to the underlying resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_tap_name: Name of the Network Tap. Required. + :type network_tap_name: str + :return: An instance of LROPoller that returns NetworkTapResyncResponse. The + NetworkTapResyncResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkTapResyncResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkTapResyncResponse] = 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._resync_initial( + resource_group_name=resource_group_name, + network_tap_name=network_tap_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkTapResyncResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkTapResyncResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkTapResyncResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class RoutePoliciesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricClient`'s + :attr:`route_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, route_policy_name: str, **kwargs: Any) -> _models.RoutePolicy: + """Implements Route Policy GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :return: RoutePolicy. The RoutePolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.RoutePolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.RoutePolicy] = kwargs.pop("cls", None) + + _request = build_route_policies_get_request( + resource_group_name=resource_group_name, + route_policy_name=route_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RoutePolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( + self, + resource_group_name: str, + route_policy_name: str, + body: Union[_models.RoutePolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_route_policies_create_request( + resource_group_name=resource_group_name, + route_policy_name=route_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + route_policy_name: str, + body: _models.RoutePolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RoutePolicy]: + """Implements Route Policy PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.RoutePolicy + :keyword content_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 RoutePolicy. The RoutePolicy is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.RoutePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + route_policy_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RoutePolicy]: + """Implements Route Policy PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 RoutePolicy. The RoutePolicy is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.RoutePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + route_policy_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RoutePolicy]: + """Implements Route Policy PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :param body: Request payload. Required. + :type body: IO[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 RoutePolicy. The RoutePolicy is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.RoutePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + route_policy_name: str, + body: Union[_models.RoutePolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.RoutePolicy]: + """Implements Route Policy PUT method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :param body: Request payload. Is one of the following types: RoutePolicy, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.RoutePolicy or JSON or IO[bytes] + :return: An instance of LROPoller that returns RoutePolicy. The RoutePolicy is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.RoutePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RoutePolicy] = 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, + route_policy_name=route_policy_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.RoutePolicy, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.RoutePolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.RoutePolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + route_policy_name: str, + body: Union[_models.RoutePolicyPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_route_policies_update_request( + resource_group_name=resource_group_name, + route_policy_name=route_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + route_policy_name: str, + body: _models.RoutePolicyPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RoutePolicy]: + """API to update certain properties of the Route Policy resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :param body: Route Policy properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.RoutePolicyPatch + :keyword content_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 RoutePolicy. The RoutePolicy is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.RoutePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + route_policy_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RoutePolicy]: + """API to update certain properties of the Route Policy resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :param body: Route Policy properties to update. Required. + :type body: JSON + :keyword content_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 RoutePolicy. The RoutePolicy is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.RoutePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + route_policy_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RoutePolicy]: + """API to update certain properties of the Route Policy resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :param body: Route Policy properties to update. Required. + :type body: IO[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 RoutePolicy. The RoutePolicy is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.RoutePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + route_policy_name: str, + body: Union[_models.RoutePolicyPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.RoutePolicy]: + """API to update certain properties of the Route Policy resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :param body: Route Policy properties to update. Is one of the following types: + RoutePolicyPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.RoutePolicyPatch or JSON or IO[bytes] + :return: An instance of LROPoller that returns RoutePolicy. The RoutePolicy is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.RoutePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RoutePolicy] = 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, + route_policy_name=route_policy_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.RoutePolicy, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.RoutePolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.RoutePolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, resource_group_name: str, route_policy_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_route_policies_delete_request( + resource_group_name=resource_group_name, + route_policy_name=route_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: 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]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, route_policy_name: str, **kwargs: Any) -> LROPoller[None]: + """Implements Route Policy DELETE method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + route_policy_name=route_policy_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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) -> ItemPaged["_models.RoutePolicy"]: + """Implements RoutePolicies list by resource group GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of RoutePolicy + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.RoutePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.RoutePolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_policies_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RoutePolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + 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) -> ItemPaged["_models.RoutePolicy"]: + """Implements RoutePolicies list by subscription GET method. + + :return: An iterator like instance of RoutePolicy + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.RoutePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.RoutePolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_policies_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RoutePolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "route_policy_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _update_administrative_state_initial( + self, + resource_group_name: str, + route_policy_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_route_policies_update_administrative_state_request( + resource_group_name=resource_group_name, + route_policy_name=route_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + route_policy_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Updated the admin state for this Route Policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + route_policy_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Updated the admin state for this Route Policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + route_policy_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Updated the admin state for this Route Policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :param body: Request payload. Required. + :type body: IO[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 UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "route_policy_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_update_administrative_state( + self, + resource_group_name: str, + route_policy_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.UpdateAdministrativeStateResponse]: + """Updated the admin state for this Route Policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of LROPoller that returns UpdateAdministrativeStateResponse. The + UpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateAdministrativeStateResponse] = 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_administrative_state_initial( + resource_group_name=resource_group_name, + route_policy_name=route_policy_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.UpdateAdministrativeStateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.UpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.UpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _validate_configuration_initial( + self, resource_group_name: str, route_policy_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_route_policies_validate_configuration_request( + resource_group_name=resource_group_name, + route_policy_name=route_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_validate_configuration( + self, resource_group_name: str, route_policy_name: str, **kwargs: Any + ) -> LROPoller[_models.ValidateConfigurationResponse]: + """Validates the configuration of the resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :return: An instance of LROPoller that returns ValidateConfigurationResponse. The + ValidateConfigurationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ValidateConfigurationResponse] = 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._validate_configuration_initial( + resource_group_name=resource_group_name, + route_policy_name=route_policy_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ValidateConfigurationResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ValidateConfigurationResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ValidateConfigurationResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _commit_configuration_initial( + self, resource_group_name: str, route_policy_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_route_policies_commit_configuration_request( + resource_group_name=resource_group_name, + route_policy_name=route_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_commit_configuration( + self, resource_group_name: str, route_policy_name: str, **kwargs: Any + ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: + """Commits the configuration of the given resources. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param route_policy_name: Name of the Route Policy. Required. + :type route_policy_name: str + :return: An instance of LROPoller that returns CommonPostActionResponseForStateUpdate. The + CommonPostActionResponseForStateUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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._commit_configuration_initial( + resource_group_name=resource_group_name, + route_policy_name=route_policy_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.CommonPostActionResponseForStateUpdate, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.CommonPostActionResponseForStateUpdate].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.CommonPostActionResponseForStateUpdate]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class NetworkMonitorsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricClient`'s + :attr:`network_monitors` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2024-06-15-preview", + params_added_on={ + "2024-06-15-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_monitor_name", + "accept", + ] + }, + api_versions_list=["2024-06-15-preview", "2025-07-15"], + ) + def get(self, resource_group_name: str, network_monitor_name: str, **kwargs: Any) -> _models.NetworkMonitor: + """Implements NetworkMonitor GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_monitor_name: Name of the Network Monitor. Required. + :type network_monitor_name: str + :return: NetworkMonitor. The NetworkMonitor is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkMonitor + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkMonitor] = kwargs.pop("cls", None) + + _request = build_network_monitors_get_request( + resource_group_name=resource_group_name, + network_monitor_name=network_monitor_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NetworkMonitor, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2024-06-15-preview", + params_added_on={ + "2024-06-15-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_monitor_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2024-06-15-preview", "2025-07-15"], + ) + def _create_initial( + self, + resource_group_name: str, + network_monitor_name: str, + body: Union[_models.NetworkMonitor, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_monitors_create_request( + resource_group_name=resource_group_name, + network_monitor_name=network_monitor_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + network_monitor_name: str, + body: _models.NetworkMonitor, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkMonitor]: + """Creates NetworkMonitor resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_monitor_name: Name of the Network Monitor. Required. + :type network_monitor_name: str + :param body: Resource create parameters. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkMonitor + :keyword content_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 NetworkMonitor. The NetworkMonitor is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkMonitor] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + network_monitor_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkMonitor]: + """Creates NetworkMonitor resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_monitor_name: Name of the Network Monitor. Required. + :type network_monitor_name: str + :param body: Resource create parameters. Required. + :type body: JSON + :keyword content_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 NetworkMonitor. The NetworkMonitor is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkMonitor] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + network_monitor_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkMonitor]: + """Creates NetworkMonitor resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_monitor_name: Name of the Network Monitor. Required. + :type network_monitor_name: str + :param body: Resource create parameters. Required. + :type body: IO[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 NetworkMonitor. The NetworkMonitor is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkMonitor] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2024-06-15-preview", + params_added_on={ + "2024-06-15-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_monitor_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2024-06-15-preview", "2025-07-15"], + ) + def begin_create( + self, + resource_group_name: str, + network_monitor_name: str, + body: Union[_models.NetworkMonitor, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkMonitor]: + """Creates NetworkMonitor resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_monitor_name: Name of the Network Monitor. Required. + :type network_monitor_name: str + :param body: Resource create parameters. Is one of the following types: NetworkMonitor, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkMonitor or JSON or IO[bytes] + :return: An instance of LROPoller that returns NetworkMonitor. The NetworkMonitor is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkMonitor] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkMonitor] = 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_monitor_name=network_monitor_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkMonitor, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkMonitor].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkMonitor]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2024-06-15-preview", + params_added_on={ + "2024-06-15-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_monitor_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2024-06-15-preview", "2025-07-15"], + ) + def _update_initial( + self, + resource_group_name: str, + network_monitor_name: str, + body: Union[_models.NetworkMonitorPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_monitors_update_request( + resource_group_name=resource_group_name, + network_monitor_name=network_monitor_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + network_monitor_name: str, + body: _models.NetworkMonitorPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkMonitor]: + """API to update certain properties of the NetworkMonitor resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_monitor_name: Name of the Network Monitor. Required. + :type network_monitor_name: str + :param body: The resource properties to be updated. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkMonitorPatch + :keyword content_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 NetworkMonitor. The NetworkMonitor is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkMonitor] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + network_monitor_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkMonitor]: + """API to update certain properties of the NetworkMonitor resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_monitor_name: Name of the Network Monitor. Required. + :type network_monitor_name: str + :param body: The resource properties to be updated. Required. + :type body: JSON + :keyword content_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 NetworkMonitor. The NetworkMonitor is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkMonitor] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + network_monitor_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkMonitor]: + """API to update certain properties of the NetworkMonitor resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_monitor_name: Name of the Network Monitor. Required. + :type network_monitor_name: str + :param body: The resource properties to be updated. Required. + :type body: IO[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 NetworkMonitor. The NetworkMonitor is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkMonitor] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2024-06-15-preview", + params_added_on={ + "2024-06-15-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_monitor_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2024-06-15-preview", "2025-07-15"], + ) + def begin_update( + self, + resource_group_name: str, + network_monitor_name: str, + body: Union[_models.NetworkMonitorPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkMonitor]: + """API to update certain properties of the NetworkMonitor resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_monitor_name: Name of the Network Monitor. Required. + :type network_monitor_name: str + :param body: The resource properties to be updated. Is one of the following types: + NetworkMonitorPatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkMonitorPatch or JSON or IO[bytes] + :return: An instance of LROPoller that returns NetworkMonitor. The NetworkMonitor is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkMonitor] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkMonitor] = 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, + network_monitor_name=network_monitor_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkMonitor, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkMonitor].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkMonitor]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2024-06-15-preview", + params_added_on={ + "2024-06-15-preview": ["api_version", "subscription_id", "resource_group_name", "network_monitor_name"] + }, + api_versions_list=["2024-06-15-preview", "2025-07-15"], + ) + def _delete_initial(self, resource_group_name: str, network_monitor_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_monitors_delete_request( + resource_group_name=resource_group_name, + network_monitor_name=network_monitor_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: 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]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2024-06-15-preview", + params_added_on={ + "2024-06-15-preview": ["api_version", "subscription_id", "resource_group_name", "network_monitor_name"] + }, + api_versions_list=["2024-06-15-preview", "2025-07-15"], + ) + def begin_delete(self, resource_group_name: str, network_monitor_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes layer 2 connectivity between compute nodes by managed by named NetworkMonitor name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_monitor_name: Name of the Network Monitor. Required. + :type network_monitor_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + network_monitor_name=network_monitor_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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 + @api_version_validation( + method_added_on="2024-06-15-preview", + params_added_on={"2024-06-15-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, + api_versions_list=["2024-06-15-preview", "2025-07-15"], + ) + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.NetworkMonitor"]: + """Displays NetworkMonitors list by resource group GET method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of NetworkMonitor + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkMonitor] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkMonitor]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_monitors_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkMonitor], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + @api_version_validation( + method_added_on="2024-06-15-preview", + params_added_on={"2024-06-15-preview": ["api_version", "subscription_id", "accept"]}, + api_versions_list=["2024-06-15-preview", "2025-07-15"], + ) + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.NetworkMonitor"]: + """Displays NetworkMonitors list by subscription GET method. + + :return: An iterator like instance of NetworkMonitor + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkMonitor] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkMonitor]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_monitors_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkMonitor], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2024-06-15-preview", + params_added_on={ + "2024-06-15-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_monitor_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2024-06-15-preview", "2025-07-15"], + ) + def _update_administrative_state_initial( + self, + resource_group_name: str, + network_monitor_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_monitors_update_administrative_state_request( + resource_group_name=resource_group_name, + network_monitor_name=network_monitor_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + network_monitor_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CommonPostActionResponseForDeviceUpdate]: + """Enables isolation domain across the fabric or on specified racks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_monitor_name: Name of the Network Monitor. Required. + :type network_monitor_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 CommonPostActionResponseForDeviceUpdate. The + CommonPostActionResponseForDeviceUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + network_monitor_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CommonPostActionResponseForDeviceUpdate]: + """Enables isolation domain across the fabric or on specified racks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_monitor_name: Name of the Network Monitor. Required. + :type network_monitor_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 CommonPostActionResponseForDeviceUpdate. The + CommonPostActionResponseForDeviceUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + network_monitor_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CommonPostActionResponseForDeviceUpdate]: + """Enables isolation domain across the fabric or on specified racks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_monitor_name: Name of the Network Monitor. Required. + :type network_monitor_name: str + :param body: Request payload. Required. + :type body: IO[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 CommonPostActionResponseForDeviceUpdate. The + CommonPostActionResponseForDeviceUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2024-06-15-preview", + params_added_on={ + "2024-06-15-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_monitor_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2024-06-15-preview", "2025-07-15"], + ) + def begin_update_administrative_state( + self, + resource_group_name: str, + network_monitor_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.CommonPostActionResponseForDeviceUpdate]: + """Enables isolation domain across the fabric or on specified racks. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_monitor_name: Name of the Network Monitor. Required. + :type network_monitor_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of LROPoller that returns CommonPostActionResponseForDeviceUpdate. The + CommonPostActionResponseForDeviceUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CommonPostActionResponseForDeviceUpdate] = 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_administrative_state_initial( + resource_group_name=resource_group_name, + network_monitor_name=network_monitor_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.CommonPostActionResponseForDeviceUpdate, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.CommonPostActionResponseForDeviceUpdate].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.CommonPostActionResponseForDeviceUpdate]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class NetworkBootstrapDevicesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricClient`'s + :attr:`network_bootstrap_devices` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def get( + self, resource_group_name: str, network_bootstrap_device_name: str, **kwargs: Any + ) -> _models.NetworkBootstrapDevice: + """Gets a Network Bootstrap Device resource details. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :return: NetworkBootstrapDevice. The NetworkBootstrapDevice is compatible with MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevice + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkBootstrapDevice] = kwargs.pop("cls", None) + + _request = build_network_bootstrap_devices_get_request( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NetworkBootstrapDevice, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _create_initial( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: Union[_models.NetworkBootstrapDevice, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_bootstrap_devices_create_request( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: _models.NetworkBootstrapDevice, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkBootstrapDevice]: + """Creates a Network Bootstrap Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevice + :keyword content_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 NetworkBootstrapDevice. The + NetworkBootstrapDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkBootstrapDevice]: + """Creates a Network Bootstrap Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NetworkBootstrapDevice. The + NetworkBootstrapDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkBootstrapDevice]: + """Creates a Network Bootstrap Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Request payload. Required. + :type body: IO[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 NetworkBootstrapDevice. The + NetworkBootstrapDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_create( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: Union[_models.NetworkBootstrapDevice, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkBootstrapDevice]: + """Creates a Network Bootstrap Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Request payload. Is one of the following types: NetworkBootstrapDevice, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevice or JSON or IO[bytes] + :return: An instance of LROPoller that returns NetworkBootstrapDevice. The + NetworkBootstrapDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkBootstrapDevice] = 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_bootstrap_device_name=network_bootstrap_device_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkBootstrapDevice, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkBootstrapDevice].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkBootstrapDevice]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _update_initial( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: Union[_models.NetworkBootstrapDevicePatch, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_bootstrap_devices_update_request( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: _models.NetworkBootstrapDevicePatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkBootstrapDevice]: + """Update certain properties of the Network Bootstrap Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Network Bootstrap Device properties to update. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevicePatch + :keyword content_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 NetworkBootstrapDevice. The + NetworkBootstrapDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkBootstrapDevice]: + """Update certain properties of the Network Bootstrap Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Network Bootstrap Device properties to update. Required. + :type body: JSON + :keyword content_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 NetworkBootstrapDevice. The + NetworkBootstrapDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkBootstrapDevice]: + """Update certain properties of the Network Bootstrap Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Network Bootstrap Device properties to update. Required. + :type body: IO[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 NetworkBootstrapDevice. The + NetworkBootstrapDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_update( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: Union[_models.NetworkBootstrapDevicePatch, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkBootstrapDevice]: + """Update certain properties of the Network Bootstrap Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Network Bootstrap Device properties to update. Is one of the following types: + NetworkBootstrapDevicePatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevicePatch or JSON or + IO[bytes] + :return: An instance of LROPoller that returns NetworkBootstrapDevice. The + NetworkBootstrapDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkBootstrapDevice] = 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, + network_bootstrap_device_name=network_bootstrap_device_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkBootstrapDevice, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkBootstrapDevice].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkBootstrapDevice]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_bootstrap_device_name"] + }, + api_versions_list=["2025-07-15"], + ) + def _delete_initial( + self, resource_group_name: str, network_bootstrap_device_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_bootstrap_devices_delete_request( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: 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]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": ["api_version", "subscription_id", "resource_group_name", "network_bootstrap_device_name"] + }, + api_versions_list=["2025-07-15"], + ) + def begin_delete( + self, resource_group_name: str, network_bootstrap_device_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a Network Bootstrap Device resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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 + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={"2025-07-15": ["api_version", "subscription_id", "resource_group_name", "accept"]}, + api_versions_list=["2025-07-15"], + ) + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> ItemPaged["_models.NetworkBootstrapDevice"]: + """Lists all the Network Bootstrap Device resources in a given resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of NetworkBootstrapDevice + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkBootstrapDevice]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_bootstrap_devices_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkBootstrapDevice], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={"2025-07-15": ["api_version", "subscription_id", "accept"]}, + api_versions_list=["2025-07-15"], + ) + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.NetworkBootstrapDevice"]: + """List all the Network Bootstrap Device resources in a given subscription. + + :return: An iterator like instance of NetworkBootstrapDevice + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkBootstrapDevice]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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_bootstrap_devices_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkBootstrapDevice], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _reboot_initial( + self, resource_group_name: str, network_bootstrap_device_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_bootstrap_devices_reboot_request( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_reboot( + self, resource_group_name: str, network_bootstrap_device_name: str, **kwargs: Any + ) -> LROPoller[_models.NetworkBootstrapDeviceRebootResponse]: + """Reboot the Network Bootstrap Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :return: An instance of LROPoller that returns NetworkBootstrapDeviceRebootResponse. The + NetworkBootstrapDeviceRebootResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDeviceRebootResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkBootstrapDeviceRebootResponse] = 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._reboot_initial( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkBootstrapDeviceRebootResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkBootstrapDeviceRebootResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkBootstrapDeviceRebootResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _refresh_configuration_initial( + self, resource_group_name: str, network_bootstrap_device_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_bootstrap_devices_refresh_configuration_request( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_refresh_configuration( + self, resource_group_name: str, network_bootstrap_device_name: str, **kwargs: Any + ) -> LROPoller[_models.NetworkBootstrapDeviceRefreshConfigurationResponse]: + """Refreshes the configuration of Network Bootstrap Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :return: An instance of LROPoller that returns + NetworkBootstrapDeviceRefreshConfigurationResponse. The + NetworkBootstrapDeviceRefreshConfigurationResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDeviceRefreshConfigurationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkBootstrapDeviceRefreshConfigurationResponse] = 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._refresh_configuration_initial( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkBootstrapDeviceRefreshConfigurationResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkBootstrapDeviceRefreshConfigurationResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkBootstrapDeviceRefreshConfigurationResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _upgrade_initial( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: Union[_models.UpdateVersion, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_bootstrap_devices_upgrade_request( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_upgrade( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: _models.UpdateVersion, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkBootstrapDeviceUpgradeResponse]: + """Upgrades the version of the Network Bootstrap Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateVersion + :keyword content_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 NetworkBootstrapDeviceUpgradeResponse. The + NetworkBootstrapDeviceUpgradeResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDeviceUpgradeResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_upgrade( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkBootstrapDeviceUpgradeResponse]: + """Upgrades the version of the Network Bootstrap Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NetworkBootstrapDeviceUpgradeResponse. The + NetworkBootstrapDeviceUpgradeResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDeviceUpgradeResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_upgrade( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkBootstrapDeviceUpgradeResponse]: + """Upgrades the version of the Network Bootstrap Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Request payload. Required. + :type body: IO[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 NetworkBootstrapDeviceUpgradeResponse. The + NetworkBootstrapDeviceUpgradeResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDeviceUpgradeResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_upgrade( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: Union[_models.UpdateVersion, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkBootstrapDeviceUpgradeResponse]: + """Upgrades the version of the Network Bootstrap Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Request payload. Is one of the following types: UpdateVersion, JSON, IO[bytes] + Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateVersion or JSON or IO[bytes] + :return: An instance of LROPoller that returns NetworkBootstrapDeviceUpgradeResponse. The + NetworkBootstrapDeviceUpgradeResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDeviceUpgradeResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkBootstrapDeviceUpgradeResponse] = 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._upgrade_initial( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkBootstrapDeviceUpgradeResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkBootstrapDeviceUpgradeResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkBootstrapDeviceUpgradeResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _update_administrative_state_initial( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: Union[_models.UpdateDeviceAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_bootstrap_devices_update_administrative_state_request( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: _models.UpdateDeviceAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkBootstrapDeviceUpdateAdministrativeStateResponse]: + """Updates the Administrative state of the Network Bootstrap Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateDeviceAdministrativeState + :keyword content_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 + NetworkBootstrapDeviceUpdateAdministrativeStateResponse. The + NetworkBootstrapDeviceUpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDeviceUpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkBootstrapDeviceUpdateAdministrativeStateResponse]: + """Updates the Administrative state of the Network Bootstrap Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 + NetworkBootstrapDeviceUpdateAdministrativeStateResponse. The + NetworkBootstrapDeviceUpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDeviceUpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkBootstrapDeviceUpdateAdministrativeStateResponse]: + """Updates the Administrative state of the Network Bootstrap Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Request payload. Required. + :type body: IO[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 + NetworkBootstrapDeviceUpdateAdministrativeStateResponse. The + NetworkBootstrapDeviceUpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDeviceUpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_update_administrative_state( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + body: Union[_models.UpdateDeviceAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkBootstrapDeviceUpdateAdministrativeStateResponse]: + """Updates the Administrative state of the Network Bootstrap Device. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param body: Request payload. Is one of the following types: UpdateDeviceAdministrativeState, + JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateDeviceAdministrativeState or JSON or + IO[bytes] + :return: An instance of LROPoller that returns + NetworkBootstrapDeviceUpdateAdministrativeStateResponse. The + NetworkBootstrapDeviceUpdateAdministrativeStateResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDeviceUpdateAdministrativeStateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkBootstrapDeviceUpdateAdministrativeStateResponse] = 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_administrative_state_initial( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize( + _models.NetworkBootstrapDeviceUpdateAdministrativeStateResponse, response.json() + ) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkBootstrapDeviceUpdateAdministrativeStateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkBootstrapDeviceUpdateAdministrativeStateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _resync_passwords_initial( + self, resource_group_name: str, network_bootstrap_device_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_bootstrap_devices_resync_passwords_request( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_resync_passwords( + self, resource_group_name: str, network_bootstrap_device_name: str, **kwargs: Any + ) -> LROPoller[_models.NetworkBootstrapDeviceResyncPasswordsResponse]: + """Resync the latest passwords to the Network Bootstrap Device. + + Updates the Network Bootstrap Device to use the latest passwords. Does not generate new + passwords. Allows network bootstrap devices missed during a previous password rotation to be + brought back into sync. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :return: An instance of LROPoller that returns NetworkBootstrapDeviceResyncPasswordsResponse. + The NetworkBootstrapDeviceResyncPasswordsResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapDeviceResyncPasswordsResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkBootstrapDeviceResyncPasswordsResponse] = 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._resync_passwords_initial( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkBootstrapDeviceResyncPasswordsResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkBootstrapDeviceResyncPasswordsResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkBootstrapDeviceResyncPasswordsResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class NetworkBootstrapInterfacesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricClient`'s + :attr:`network_bootstrap_interfaces` attribute. """ - models = _models - - def __init__(self, *args, **kwargs): + 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._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ManagedNetworkFabricClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: - """Returns list of all operations. + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "network_bootstrap_interface_name", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def get( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + **kwargs: Any + ) -> _models.NetworkBootstrapInterface: + """Get the Network Bootstrap Interface resource details. - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.Operation] + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param network_bootstrap_interface_name: Name of the Network Bootstrap Interface. Required. + :type network_bootstrap_interface_name: str + :return: NetworkBootstrapInterface. The NetworkBootstrapInterface is compatible with + MutableMapping + :rtype: ~azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterface + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkBootstrapInterface] = kwargs.pop("cls", None) + + _request = build_network_bootstrap_interfaces_get_request( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + network_bootstrap_interface_name=network_bootstrap_interface_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NetworkBootstrapInterface, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "network_bootstrap_interface_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _create_initial( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + body: Union[_models.NetworkBootstrapInterface, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_bootstrap_interfaces_create_request( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + network_bootstrap_interface_name=network_bootstrap_interface_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + body: _models.NetworkBootstrapInterface, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkBootstrapInterface]: + """Create a Network Bootstrap Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param network_bootstrap_interface_name: Name of the Network Bootstrap Interface. Required. + :type network_bootstrap_interface_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterface + :keyword content_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 NetworkBootstrapInterface. The + NetworkBootstrapInterface is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkBootstrapInterface]: + """Create a Network Bootstrap Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param network_bootstrap_interface_name: Name of the Network Bootstrap Interface. Required. + :type network_bootstrap_interface_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 NetworkBootstrapInterface. The + NetworkBootstrapInterface is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkBootstrapInterface]: + """Create a Network Bootstrap Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param network_bootstrap_interface_name: Name of the Network Bootstrap Interface. Required. + :type network_bootstrap_interface_name: str + :param body: Request payload. Required. + :type body: IO[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 NetworkBootstrapInterface. The + NetworkBootstrapInterface is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "network_bootstrap_interface_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_create( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + body: Union[_models.NetworkBootstrapInterface, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkBootstrapInterface]: + """Create a Network Bootstrap Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param network_bootstrap_interface_name: Name of the Network Bootstrap Interface. Required. + :type network_bootstrap_interface_name: str + :param body: Request payload. Is one of the following types: NetworkBootstrapInterface, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterface or JSON or + IO[bytes] + :return: An instance of LROPoller that returns NetworkBootstrapInterface. The + NetworkBootstrapInterface is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkBootstrapInterface] = 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_bootstrap_device_name=network_bootstrap_device_name, + network_bootstrap_interface_name=network_bootstrap_interface_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkBootstrapInterface, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkBootstrapInterface].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkBootstrapInterface]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "network_bootstrap_interface_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _update_initial( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + body: Union[_models.NetworkBootstrapInterfacePatch, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_bootstrap_interfaces_update_request( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + network_bootstrap_interface_name=network_bootstrap_interface_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + body: _models.NetworkBootstrapInterfacePatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkBootstrapInterface]: + """Update certain properties of the Network Bootstrap Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param network_bootstrap_interface_name: Name of the Network Bootstrap Interface. Required. + :type network_bootstrap_interface_name: str + :param body: NetworkBootstrapInterface properties to update. Only tags are supported. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterfacePatch + :keyword content_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 NetworkBootstrapInterface. The + NetworkBootstrapInterface is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkBootstrapInterface]: + """Update certain properties of the Network Bootstrap Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param network_bootstrap_interface_name: Name of the Network Bootstrap Interface. Required. + :type network_bootstrap_interface_name: str + :param body: NetworkBootstrapInterface properties to update. Only tags are supported. Required. + :type body: JSON + :keyword content_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 NetworkBootstrapInterface. The + NetworkBootstrapInterface is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkBootstrapInterface]: + """Update certain properties of the Network Bootstrap Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param network_bootstrap_interface_name: Name of the Network Bootstrap Interface. Required. + :type network_bootstrap_interface_name: str + :param body: NetworkBootstrapInterface properties to update. Only tags are supported. Required. + :type body: IO[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 NetworkBootstrapInterface. The + NetworkBootstrapInterface is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "network_bootstrap_interface_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_update( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + body: Union[_models.NetworkBootstrapInterfacePatch, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkBootstrapInterface]: + """Update certain properties of the Network Bootstrap Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param network_bootstrap_interface_name: Name of the Network Bootstrap Interface. Required. + :type network_bootstrap_interface_name: str + :param body: NetworkBootstrapInterface properties to update. Only tags are supported. Is one of + the following types: NetworkBootstrapInterfacePatch, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterfacePatch or JSON or + IO[bytes] + :return: An instance of LROPoller that returns NetworkBootstrapInterface. The + NetworkBootstrapInterface is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterface] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkBootstrapInterface] = 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, + network_bootstrap_device_name=network_bootstrap_device_name, + network_bootstrap_interface_name=network_bootstrap_interface_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkBootstrapInterface, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkBootstrapInterface].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkBootstrapInterface]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "network_bootstrap_interface_name", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _delete_initial( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_bootstrap_interfaces_delete_request( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + network_bootstrap_interface_name=network_bootstrap_interface_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: 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]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "network_bootstrap_interface_name", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_delete( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Delete the Network Bootstrap Interface resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param network_bootstrap_interface_name: Name of the Network Bootstrap Interface. Required. + :type network_bootstrap_interface_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + network_bootstrap_interface_name=network_bootstrap_interface_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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 + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def list_by_network_bootstrap_device( + self, resource_group_name: str, network_bootstrap_device_name: str, **kwargs: Any + ) -> ItemPaged["_models.NetworkBootstrapInterface"]: + """List all the Network Bootstrap Interface resources in a given resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :return: An iterator like instance of NetworkBootstrapInterface + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.NetworkBootstrapInterface] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + cls: ClsType[List[_models.NetworkBootstrapInterface]] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -100,14 +40490,20 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: def prepare_request(next_link=None): if not next_link: - request = build_list_request( - api_version=api_version, - template_url=self.list.metadata["url"], + _request = build_network_bootstrap_interfaces_list_by_network_bootstrap_device_request( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -119,37 +40515,333 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _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 + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkBootstrapInterface], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) + return deserialized.get("nextLink") or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs + _request, stream=_stream, **kwargs ) response = 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.ManagedNetworkFabric/operations"} + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "network_bootstrap_interface_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def _update_administrative_state_initial( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_network_bootstrap_interfaces_update_administrative_state_request( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + network_bootstrap_interface_name=network_bootstrap_interface_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + body: _models.UpdateAdministrativeState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: + """Update the admin state of the Network Interface. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param network_bootstrap_interface_name: Name of the Network Bootstrap Interface. Required. + :type network_bootstrap_interface_name: str + :param body: Request payload. Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState + :keyword content_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 CommonPostActionResponseForStateUpdate. The + CommonPostActionResponseForStateUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: + """Update the admin state of the Network Interface. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param network_bootstrap_interface_name: Name of the Network Bootstrap Interface. Required. + :type network_bootstrap_interface_name: str + :param body: Request payload. Required. + :type body: JSON + :keyword content_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 CommonPostActionResponseForStateUpdate. The + CommonPostActionResponseForStateUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_administrative_state( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: + """Update the admin state of the Network Interface. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param network_bootstrap_interface_name: Name of the Network Bootstrap Interface. Required. + :type network_bootstrap_interface_name: str + :param body: Request payload. Required. + :type body: IO[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 CommonPostActionResponseForStateUpdate. The + CommonPostActionResponseForStateUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-15", + params_added_on={ + "2025-07-15": [ + "api_version", + "subscription_id", + "resource_group_name", + "network_bootstrap_device_name", + "network_bootstrap_interface_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-07-15"], + ) + def begin_update_administrative_state( + self, + resource_group_name: str, + network_bootstrap_device_name: str, + network_bootstrap_interface_name: str, + body: Union[_models.UpdateAdministrativeState, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: + """Update the admin state of the Network Interface. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_bootstrap_device_name: Name of the Network Bootstrap Device. Required. + :type network_bootstrap_device_name: str + :param network_bootstrap_interface_name: Name of the Network Bootstrap Interface. Required. + :type network_bootstrap_interface_name: str + :param body: Request payload. Is one of the following types: UpdateAdministrativeState, JSON, + IO[bytes] Required. + :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or JSON or + IO[bytes] + :return: An instance of LROPoller that returns CommonPostActionResponseForStateUpdate. The + CommonPostActionResponseForStateUpdate is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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_administrative_state_initial( + resource_group_name=resource_group_name, + network_bootstrap_device_name=network_bootstrap_device_name, + network_bootstrap_interface_name=network_bootstrap_interface_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.CommonPostActionResponseForStateUpdate, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.CommonPostActionResponseForStateUpdate].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.CommonPostActionResponseForStateUpdate]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_patch.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_patch.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """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 + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_route_policies_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_route_policies_operations.py deleted file mode 100644 index 458941162970..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/azure/mgmt/managednetworkfabric/operations/_route_policies_operations.py +++ /dev/null @@ -1,1667 +0,0 @@ -# pylint: disable=too-many-lines -# 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 -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -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 _convert_request, _format_url_section - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_request( - resource_group_name: str, route_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-06-15")) - 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.ManagedNetworkFabric/routePolicies/{routePolicyName}", - ) # 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", max_length=90, min_length=1 - ), - "routePolicyName": _SERIALIZER.url("route_policy_name", route_policy_name, "str"), - } - - _url: str = _format_url_section(_url, **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_get_request( - resource_group_name: str, route_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}", - ) # 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", max_length=90, min_length=1 - ), - "routePolicyName": _SERIALIZER.url("route_policy_name", route_policy_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, route_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-06-15")) - 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.ManagedNetworkFabric/routePolicies/{routePolicyName}", - ) # 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", max_length=90, min_length=1 - ), - "routePolicyName": _SERIALIZER.url("route_policy_name", route_policy_name, "str"), - } - - _url: str = _format_url_section(_url, **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_delete_request( - resource_group_name: str, route_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}", - ) # 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", max_length=90, min_length=1 - ), - "routePolicyName": _SERIALIZER.url("route_policy_name", route_policy_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_list_by_resource_group_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies", - ) # 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", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_subscription_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/routePolicies" - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_administrative_state_request( - resource_group_name: str, route_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-06-15")) - 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.ManagedNetworkFabric/routePolicies/{routePolicyName}/updateAdministrativeState", - ) # 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", max_length=90, min_length=1 - ), - "routePolicyName": _SERIALIZER.url("route_policy_name", route_policy_name, "str"), - } - - _url: str = _format_url_section(_url, **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_validate_configuration_request( - resource_group_name: str, route_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/validateConfiguration", - ) # 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", max_length=90, min_length=1 - ), - "routePolicyName": _SERIALIZER.url("route_policy_name", route_policy_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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_commit_configuration_request( - resource_group_name: str, route_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-06-15")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/commitConfiguration", - ) # 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", max_length=90, min_length=1 - ), - "routePolicyName": _SERIALIZER.url("route_policy_name", route_policy_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # 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) - - -class RoutePoliciesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.managednetworkfabric.ManagedNetworkFabricMgmtClient`'s - :attr:`route_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") - - def _create_initial( - self, resource_group_name: str, route_policy_name: str, body: Union[_models.RoutePolicy, IO], **kwargs: Any - ) -> _models.RoutePolicy: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RoutePolicy] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "RoutePolicy") - - request = build_create_request( - resource_group_name=resource_group_name, - route_policy_name=route_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = pipeline_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("RoutePolicy", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("RoutePolicy", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}" - } - - @overload - def begin_create( - self, - resource_group_name: str, - route_policy_name: str, - body: _models.RoutePolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.RoutePolicy]: - """Create Route Policy. - - Implements Route Policy PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param route_policy_name: Name of the Route Policy. Required. - :type route_policy_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.RoutePolicy - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either RoutePolicy or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.RoutePolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - route_policy_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.RoutePolicy]: - """Create Route Policy. - - Implements Route Policy PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param route_policy_name: Name of the Route Policy. Required. - :type route_policy_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either RoutePolicy or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.RoutePolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, resource_group_name: str, route_policy_name: str, body: Union[_models.RoutePolicy, IO], **kwargs: Any - ) -> LROPoller[_models.RoutePolicy]: - """Create Route Policy. - - Implements Route Policy PUT method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param route_policy_name: Name of the Route Policy. Required. - :type route_policy_name: str - :param body: Request payload. Is either a RoutePolicy type or a IO type. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.RoutePolicy or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either RoutePolicy or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.RoutePolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RoutePolicy] = 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, - route_policy_name=route_policy_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("RoutePolicy", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}" - } - - @distributed_trace - def get(self, resource_group_name: str, route_policy_name: str, **kwargs: Any) -> _models.RoutePolicy: - """Gets a Route Policy. - - Implements Route Policy GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param route_policy_name: Name of the Route Policy. Required. - :type route_policy_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RoutePolicy or the result of cls(response) - :rtype: ~azure.mgmt.managednetworkfabric.models.RoutePolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.RoutePolicy] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - route_policy_name=route_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - - response = 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("RoutePolicy", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}" - } - - def _update_initial( - self, resource_group_name: str, route_policy_name: str, body: Union[_models.RoutePolicyPatch, IO], **kwargs: Any - ) -> Optional[_models.RoutePolicy]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.RoutePolicy]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "RoutePolicyPatch") - - request = build_update_request( - resource_group_name=resource_group_name, - route_policy_name=route_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("RoutePolicy", 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) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}" - } - - @overload - def begin_update( - self, - resource_group_name: str, - route_policy_name: str, - body: _models.RoutePolicyPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.RoutePolicy]: - """Updates a Route Policy. - - API to update certain properties of the Route Policy resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param route_policy_name: Name of the Route Policy. Required. - :type route_policy_name: str - :param body: Route Policy properties to update. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.RoutePolicyPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either RoutePolicy or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.RoutePolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - route_policy_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.RoutePolicy]: - """Updates a Route Policy. - - API to update certain properties of the Route Policy resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param route_policy_name: Name of the Route Policy. Required. - :type route_policy_name: str - :param body: Route Policy properties to update. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either RoutePolicy or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.RoutePolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, resource_group_name: str, route_policy_name: str, body: Union[_models.RoutePolicyPatch, IO], **kwargs: Any - ) -> LROPoller[_models.RoutePolicy]: - """Updates a Route Policy. - - API to update certain properties of the Route Policy resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param route_policy_name: Name of the Route Policy. Required. - :type route_policy_name: str - :param body: Route Policy properties to update. Is either a RoutePolicyPatch type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.RoutePolicyPatch or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either RoutePolicy or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.RoutePolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RoutePolicy] = 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, - route_policy_name=route_policy_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("RoutePolicy", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, route_policy_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - route_policy_name=route_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: 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, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}" - } - - @distributed_trace - def begin_delete(self, resource_group_name: str, route_policy_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a Route Policy. - - Implements Route Policy DELETE method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param route_policy_name: Name of the Route Policy. Required. - :type route_policy_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :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._config.api_version)) - 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_policy_name=route_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, {}) - - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}" - } - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.RoutePolicy"]: - """List RoutePolicies by resource group. - - Implements RoutePolicies list by resource group GET method. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RoutePolicy or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.RoutePolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.RoutePoliciesListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("RoutePoliciesListResult", 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) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies" - } - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.RoutePolicy"]: - """List RoutePolicies by subscription. - - Implements RoutePolicies list by subscription GET method. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RoutePolicy or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.managednetworkfabric.models.RoutePolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.RoutePoliciesListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - 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._config.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 - - def extract_data(pipeline_response): - deserialized = self._deserialize("RoutePoliciesListResult", 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) - - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/routePolicies" - } - - def _update_administrative_state_initial( - self, - resource_group_name: str, - route_policy_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> _models.CommonPostActionResponseForDeviceUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForDeviceUpdate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "UpdateAdministrativeState") - - request = build_update_administrative_state_request( - resource_group_name=resource_group_name, - route_policy_name=route_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_administrative_state_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _update_administrative_state_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/updateAdministrativeState" - } - - @overload - def begin_update_administrative_state( - self, - resource_group_name: str, - route_policy_name: str, - body: _models.UpdateAdministrativeState, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForDeviceUpdate]: - """Executes enable operation to the underlying resources. - - Updated the admin state for this Route Policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param route_policy_name: Name of the Route Policy. Required. - :type route_policy_name: str - :param body: Request payload. Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForDeviceUpdate - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_administrative_state( - self, - resource_group_name: str, - route_policy_name: str, - body: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForDeviceUpdate]: - """Executes enable operation to the underlying resources. - - Updated the admin state for this Route Policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param route_policy_name: Name of the Route Policy. Required. - :type route_policy_name: str - :param body: Request payload. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForDeviceUpdate - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update_administrative_state( - self, - resource_group_name: str, - route_policy_name: str, - body: Union[_models.UpdateAdministrativeState, IO], - **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForDeviceUpdate]: - """Executes enable operation to the underlying resources. - - Updated the admin state for this Route Policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param route_policy_name: Name of the Route Policy. Required. - :type route_policy_name: str - :param body: Request payload. Is either a UpdateAdministrativeState type or a IO type. - Required. - :type body: ~azure.mgmt.managednetworkfabric.models.UpdateAdministrativeState or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForDeviceUpdate - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForDeviceUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommonPostActionResponseForDeviceUpdate] = 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_administrative_state_initial( - resource_group_name=resource_group_name, - route_policy_name=route_policy_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommonPostActionResponseForDeviceUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_administrative_state.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/updateAdministrativeState" - } - - def _validate_configuration_initial( - self, resource_group_name: str, route_policy_name: str, **kwargs: Any - ) -> _models.ValidateConfigurationResponse: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ValidateConfigurationResponse] = kwargs.pop("cls", None) - - request = build_validate_configuration_request( - resource_group_name=resource_group_name, - route_policy_name=route_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._validate_configuration_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _validate_configuration_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/validateConfiguration" - } - - @distributed_trace - def begin_validate_configuration( - self, resource_group_name: str, route_policy_name: str, **kwargs: Any - ) -> LROPoller[_models.ValidateConfigurationResponse]: - """Validates the configuration of the resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param route_policy_name: Name of the Route Policy. Required. - :type route_policy_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ValidateConfigurationResponse or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.ValidateConfigurationResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ValidateConfigurationResponse] = 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._validate_configuration_initial( - resource_group_name=resource_group_name, - route_policy_name=route_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): - deserialized = self._deserialize("ValidateConfigurationResponse", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_validate_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/validateConfiguration" - } - - def _commit_configuration_initial( - self, resource_group_name: str, route_policy_name: str, **kwargs: Any - ) -> _models.CommonPostActionResponseForStateUpdate: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = kwargs.pop("cls", None) - - request = build_commit_configuration_request( - resource_group_name=resource_group_name, - route_policy_name=route_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._commit_configuration_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - _stream = False - pipeline_response: PipelineResponse = self._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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - _commit_configuration_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/commitConfiguration" - } - - @distributed_trace - def begin_commit_configuration( - self, resource_group_name: str, route_policy_name: str, **kwargs: Any - ) -> LROPoller[_models.CommonPostActionResponseForStateUpdate]: - """Execute the commit on the resources. - - Commits the configuration of the given resources. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param route_policy_name: Name of the Route Policy. Required. - :type route_policy_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either CommonPostActionResponseForStateUpdate or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.managednetworkfabric.models.CommonPostActionResponseForStateUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommonPostActionResponseForStateUpdate] = 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._commit_configuration_initial( - resource_group_name=resource_group_name, - route_policy_name=route_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): - deserialized = self._deserialize("CommonPostActionResponseForStateUpdate", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - 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.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_commit_configuration.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}/commitConfiguration" - } diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_create_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_create.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_create_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_create.py index 832e9d60d304..a9e7e30f1d01 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_create_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_create.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python access_control_lists_create_maximum_set_gen.py + python access_control_lists_create.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.access_control_lists.begin_create( @@ -35,9 +36,12 @@ def main(): body={ "location": "eastUs", "properties": { + "aclType": "ControlPlaneTrafficPolicy", "aclsUrl": "https://ACL-Storage-URL", "annotation": "annotation", "configurationType": "File", + "defaultAction": "Permit", + "deviceRole": "CE", "dynamicMatchConfigurations": [ { "ipGroups": [ @@ -47,15 +51,27 @@ def main(): "vlanGroups": [{"name": "example-vlanGroup", "vlans": ["20-30"]}], } ], + "globalAccessControlListActions": {"enableCount": "True"}, "matchConfigurations": [ { - "actions": [{"counterName": "example-counter", "type": "Count"}], + "actions": [ + { + "counterName": "example-counter", + "policeRateConfiguration": { + "bitRate": {"rate": 15, "unit": "bps"}, + "burstSize": {"size": 2, "unit": "Bytes"}, + }, + "remarkComment": "example-remark", + "type": "Count", + } + ], "ipAddressType": "IPv4", "matchConditions": [ { "dscpMarkings": ["32"], "etherTypes": ["0x1"], "fragments": ["0xff00-0xffff"], + "icmpConfiguration": {"icmpTypes": ["echo"]}, "ipCondition": { "ipGroupNames": ["example-ipGroup"], "ipPrefixValues": ["10.20.20.20/12"], @@ -70,6 +86,7 @@ def main(): "portType": "SourcePort", "ports": ["1-20"], }, + "protocolNeighbors": ["example-neighbor"], "protocolTypes": ["TCP"], "ttlValues": ["23"], "vlanMatchCondition": { @@ -84,12 +101,12 @@ def main(): } ], }, - "tags": {"keyID": "KeyValue"}, + "tags": {"keyID": "keyValue"}, }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_Create_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/AccessControlLists_Create.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_create_control_plane_acl.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_create_control_plane_acl.py new file mode 100644 index 000000000000..eb5ea9bbb7f3 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_create_control_plane_acl.py @@ -0,0 +1,81 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python access_control_lists_create_control_plane_acl.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.access_control_lists.begin_create( + resource_group_name="example-resource-group", + access_control_list_name="example-acl", + body={ + "location": "eastus", + "properties": { + "aclType": "ControlPlaneTrafficPolicy", + "aclsUrl": "https://microsoft.com/a", + "administrativeState": "Enabled", + "annotation": "annotation", + "configurationType": "Inline", + "controlPlaneAclConfiguration": [ + { + "ipAddressType": "IPv4", + "matchConfigurations": [ + { + "action": {"remarkComment": "remark", "type": "Drop"}, + "matchCondition": { + "flags": ["established"], + "icmpConfiguration": {"icmpTypes": ["icmp"]}, + "ipCondition": { + "destinationIpPrefix": "10.0.0.0/24", + "sourceIpPrefix": "10.0.0.0/24", + }, + "portCondition": { + "destinationPorts": {"portMatchType": "eq", "ports": ["200"]}, + "sourcePorts": {"portMatchType": "eq", "ports": ["100"]}, + }, + "protocolTypes": "tcp", + "ttlMatchCondition": {"ttlMatchType": "eq", "ttlValue": "1"}, + }, + "matchConfigurationName": "example-match-config", + "sequenceNumber": 3779271459, + } + ], + } + ], + "defaultAction": "Permit", + "deviceRole": "CE", + }, + "tags": {"key5032": "example-tag-value"}, + }, + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/AccessControlLists_Create_ControlPlaneAcl.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_delete_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_delete.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_delete_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_delete.py index cf5a165b4d47..0339f1c29f1e 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_delete_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_delete.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python access_control_lists_delete_maximum_set_gen.py + python access_control_lists_delete.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) client.access_control_lists.begin_delete( @@ -35,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/AccessControlLists_Delete.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_get_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_get.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_get_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_get.py index 74f1d3279f60..39c5128f3b2f 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_get_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_get.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python access_control_lists_get_maximum_set_gen.py + python access_control_lists_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.access_control_lists.get( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_Get_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/AccessControlLists_Get.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_list_by_resource_group_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_list_by_resource_group.py similarity index 74% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_list_by_resource_group_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_list_by_resource_group.py index 0b065655621a..87cf1c5f6ec6 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_list_by_resource_group_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_list_by_resource_group.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python access_control_lists_list_by_resource_group_maximum_set_gen.py + python access_control_lists_list_by_resource_group.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.access_control_lists.list_by_resource_group( @@ -36,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_ListByResourceGroup_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/AccessControlLists_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_list_by_subscription_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_list_by_subscription.py similarity index 73% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_list_by_subscription_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_list_by_subscription.py index 384472ba48f0..3dc4ff67b426 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_list_by_subscription_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_list_by_subscription.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python access_control_lists_list_by_subscription_maximum_set_gen.py + python access_control_lists_list_by_subscription.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.access_control_lists.list_by_subscription() @@ -34,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_ListBySubscription_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/AccessControlLists_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_resync_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_resync.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_resync_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_resync.py index 5ed5a59e1e16..cf15e30e6e95 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_resync_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_resync.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python access_control_lists_resync_maximum_set_gen.py + python access_control_lists_resync.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.access_control_lists.begin_resync( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_Resync_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/AccessControlLists_Resync.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_update_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_update.py similarity index 77% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_update_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_update.py index 2cf5918920a3..e50d89c0b42b 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_update_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_update.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python access_control_lists_update_maximum_set_gen.py + python access_control_lists_update.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.access_control_lists.begin_update( @@ -34,9 +35,12 @@ def main(): access_control_list_name="example-acl", body={ "properties": { + "aclType": "ControlPlaneTrafficPolicy", "aclsUrl": "https://microsoft.com/a", "annotation": "annotation", "configurationType": "File", + "defaultAction": "Permit", + "deviceRole": "CE", "dynamicMatchConfigurations": [ { "ipGroups": [ @@ -46,15 +50,25 @@ def main(): "vlanGroups": [{"name": "example-vlanGroup", "vlans": ["20-30"]}], } ], + "globalAccessControlListActions": {"enableCount": "True"}, "matchConfigurations": [ { - "actions": [{"counterName": "example-counter", "type": "Count"}], + "actions": [ + { + "policeRateConfiguration": { + "bitRate": {"rate": 15, "unit": "bps"}, + "burstSize": {"size": 2, "unit": "Bytes"}, + }, + "type": "PoliceRate", + } + ], "ipAddressType": "IPv4", "matchConditions": [ { "dscpMarkings": ["32"], "etherTypes": ["0x1"], "fragments": ["0xff00-0xffff"], + "icmpConfiguration": {"icmpTypes": ["echo"]}, "ipCondition": { "ipGroupNames": ["example-ipGroup"], "ipPrefixValues": ["10.20.20.20/12"], @@ -69,6 +83,7 @@ def main(): "portType": "SourcePort", "ports": ["1-20"], }, + "protocolNeighbors": ["example-neighbor"], "protocolTypes": ["TCP"], "ttlValues": ["23"], "vlanMatchCondition": { @@ -83,12 +98,12 @@ def main(): } ], }, - "tags": {"keyID": "KeyValue"}, + "tags": {"KeyId": "KeyValue"}, }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_Update_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/AccessControlLists_Update.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_update_administrative_state_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_update_administrative_state.py similarity index 74% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_update_administrative_state_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_update_administrative_state.py index 5893604225fa..fe12a93383e8 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_update_administrative_state_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_update_administrative_state.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python access_control_lists_update_administrative_state_maximum_set_gen.py + python access_control_lists_update_administrative_state.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.access_control_lists.begin_update_administrative_state( @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_UpdateAdministrativeState_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/AccessControlLists_UpdateAdministrativeState.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_validate_configuration_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_validate_configuration.py similarity index 74% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_validate_configuration_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_validate_configuration.py index 493744e96903..06d82e8f8480 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_validate_configuration_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/access_control_lists_validate_configuration.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python access_control_lists_validate_configuration_maximum_set_gen.py + python access_control_lists_validate_configuration.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.access_control_lists.begin_validate_configuration( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_ValidateConfiguration_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/AccessControlLists_ValidateConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_create_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_create.py similarity index 65% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_create_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_create.py index 8dff2daf941d..b75acdb09d83 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_create_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_create.py @@ -1,20 +1,22 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python external_networks_create_maximum_set_gen.py + python external_networks_create.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,15 +26,15 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.external_networks.begin_create( resource_group_name="example-rg", - l3_isolation_domain_name="example-l3domain", - external_network_name="example-externalnetwork", + l3_isolation_domain_name="example-externalnetwork", + external_network_name="example-ext", body={ "properties": { "annotation": "annotation", @@ -40,41 +42,54 @@ def main(): "exportIpv4RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName", "exportIpv6RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName", }, - "exportRoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName", "importRoutePolicy": { "importIpv4RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName", "importIpv6RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName", }, - "importRoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName", + "networkToNetworkInterconnectId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni", "optionAProperties": { - "bfdConfiguration": {"intervalInMilliSeconds": 300, "multiplier": 15}, + "bfdConfiguration": {"intervalInMilliSeconds": 300, "multiplier": 10}, + "bmpConfiguration": {"configurationState": "Enabled"}, "egressAclId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl", "ingressAclId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl", "mtu": 1500, + "nativeIpv4PrefixLimit": { + "prefixLimits": [{"idleTimeExpiry": 7, "maximumRoutes": 14, "threshold": 17}] + }, + "nativeIpv6PrefixLimit": { + "prefixLimits": [{"idleTimeExpiry": 7, "maximumRoutes": 14, "threshold": 17}] + }, "peerASN": 65047, "primaryIpv4Prefix": "10.1.1.0/30", "primaryIpv6Prefix": "3FFE:FFFF:0:CD30::a0/126", "secondaryIpv4Prefix": "10.1.1.4/30", "secondaryIpv6Prefix": "3FFE:FFFF:0:CD30::a4/126", + "v4OverV6BgpSession": "Enabled", + "v6OverV4BgpSession": "Enabled", "vlanId": 1001, }, "optionBProperties": { "exportRouteTargets": ["65046:10039"], "importRouteTargets": ["65046:10039"], "routeTargets": { - "exportIpv4RouteTargets": ["65046:10039"], - "exportIpv6RouteTargets": ["65046:10039"], - "importIpv4RouteTargets": ["65046:10039"], - "importIpv6RouteTargets": ["65046:10039"], + "exportIpv4RouteTargets": ["65046:10050"], + "exportIpv6RouteTargets": ["65046:10050"], + "importIpv4RouteTargets": ["65046:10050"], + "importIpv6RouteTargets": ["65046:10050"], }, }, "peeringOption": "OptionA", + "staticRouteConfiguration": { + "bfdConfiguration": {"intervalInMilliSeconds": 300, "multiplier": 10}, + "ipv4Routes": [{"nextHop": ["10.0.0.1"], "prefix": "10.0.0.1/24"}], + "ipv6Routes": [{"nextHop": ["3ffe::1"], "prefix": "2fff::/64"}], + }, } }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_Create_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/ExternalNetworks_Create.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_delete.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_delete.py new file mode 100644 index 000000000000..6f9c8b4d18cb --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_delete.py @@ -0,0 +1,42 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python external_networks_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.external_networks.begin_delete( + resource_group_name="example-rg", + l3_isolation_domain_name="example-externalnetwork", + external_network_name="example-ext", + ).result() + + +# x-ms-original-file: 2025-07-15/ExternalNetworks_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_delete_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_delete_maximum_set_gen.py deleted file mode 100644 index 1b7714b6a40c..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_delete_maximum_set_gen.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-managednetworkfabric -# USAGE - python external_networks_delete_maximum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ManagedNetworkFabricMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", - ) - - client.external_networks.begin_delete( - resource_group_name="example-rg", - l3_isolation_domain_name="example-l3domain", - external_network_name="example-externalnetwork", - ).result() - - -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_Delete_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_get.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_get.py new file mode 100644 index 000000000000..1c3afd6109bf --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_get.py @@ -0,0 +1,43 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python external_networks_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.external_networks.get( + resource_group_name="example-rg", + l3_isolation_domain_name="example-externalnetwork", + external_network_name="example-ext", + ) + print(response) + + +# x-ms-original-file: 2025-07-15/ExternalNetworks_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_get_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_get_maximum_set_gen.py deleted file mode 100644 index fe72b2502f4a..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_get_maximum_set_gen.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-managednetworkfabric -# USAGE - python external_networks_get_maximum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ManagedNetworkFabricMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="42EEDB3B-8E17-46E3-B0B4-B1CD9842D90D", - ) - - response = client.external_networks.get( - resource_group_name="rgL3IsolationDomains", - l3_isolation_domain_name="yhtr", - external_network_name="fltpszzikbalrzaqq", - ) - print(response) - - -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_Get_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_list_by_l3_isolation_domain_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_list_by_l3_isolation_domain.py similarity index 71% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_list_by_l3_isolation_domain_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_list_by_l3_isolation_domain.py index 946d9a2a7af8..5d949a7e4516 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_list_by_l3_isolation_domain_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_list_by_l3_isolation_domain.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python external_networks_list_by_l3_isolation_domain_maximum_set_gen.py + python external_networks_list_by_l3_isolation_domain.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,19 +25,19 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.external_networks.list_by_l3_isolation_domain( resource_group_name="example-rg", - l3_isolation_domain_name="example-l3domain", + l3_isolation_domain_name="example-externalnetwork", ) for item in response: print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_ListByL3IsolationDomain_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/ExternalNetworks_ListByL3IsolationDomain.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_update_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_update.py similarity index 65% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_update_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_update.py index 323a0ed8ef09..19566f2668ae 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_update_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_update.py @@ -1,20 +1,22 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python external_networks_update_maximum_set_gen.py + python external_networks_update.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,15 +26,15 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.external_networks.begin_update( resource_group_name="example-rg", - l3_isolation_domain_name="example-l3domain", - external_network_name="example-externalnetwork", + l3_isolation_domain_name="example-externalnetwork", + external_network_name="example-ext", body={ "properties": { "annotation": "annotation1", @@ -40,41 +42,54 @@ def main(): "exportIpv4RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName", "exportIpv6RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName", }, - "exportRoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName", "importRoutePolicy": { "importIpv4RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName", "importIpv6RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName", }, - "importRoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName", + "networkToNetworkInterconnectId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni", "optionAProperties": { - "bfdConfiguration": {"intervalInMilliSeconds": 300, "multiplier": 15}, + "bfdConfiguration": {"intervalInMilliSeconds": 300, "multiplier": 10}, + "bmpConfiguration": {"configurationState": "Enabled"}, "egressAclId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl", "ingressAclId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl", "mtu": 1500, + "nativeIpv4PrefixLimit": { + "prefixLimits": [{"idleTimeExpiry": 8, "maximumRoutes": 13, "threshold": 24}] + }, + "nativeIpv6PrefixLimit": { + "prefixLimits": [{"idleTimeExpiry": 8, "maximumRoutes": 13, "threshold": 24}] + }, "peerASN": 65047, "primaryIpv4Prefix": "10.1.1.0/30", "primaryIpv6Prefix": "3FFE:FFFF:0:CD30::a0/126", "secondaryIpv4Prefix": "10.1.1.4/30", "secondaryIpv6Prefix": "3FFE:FFFF:0:CD30::a4/126", + "v4OverV6BgpSession": "Enabled", + "v6OverV4BgpSession": "Enabled", "vlanId": 1001, }, "optionBProperties": { "exportRouteTargets": ["65046:10039"], "importRouteTargets": ["65046:10039"], "routeTargets": { - "exportIpv4RouteTargets": ["65046:10039"], - "exportIpv6RouteTargets": ["65046:10039"], - "importIpv4RouteTargets": ["65046:10039"], - "importIpv6RouteTargets": ["65046:10039"], + "exportIpv4RouteTargets": ["65046:10050"], + "exportIpv6RouteTargets": ["65046:10050"], + "importIpv4RouteTargets": ["65046:10050"], + "importIpv6RouteTargets": ["65046:10050"], }, }, "peeringOption": "OptionA", + "staticRouteConfiguration": { + "bfdConfiguration": {"intervalInMilliSeconds": 300, "multiplier": 10}, + "ipv4Routes": [{"nextHop": ["10.0.0.1"], "prefix": "10.0.0.1/14"}], + "ipv6Routes": [{"nextHop": ["3ffe::1"], "prefix": "2fff::/64"}], + }, } }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_Update_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/ExternalNetworks_Update.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_update_administrative_state_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_update_administrative_state.py similarity index 70% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_update_administrative_state_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_update_administrative_state.py index a530102d1e81..f899045c7cdc 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_update_administrative_state_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_update_administrative_state.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python external_networks_update_administrative_state_maximum_set_gen.py + python external_networks_update_administrative_state.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,20 +25,20 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.external_networks.begin_update_administrative_state( resource_group_name="example-rg", - l3_isolation_domain_name="example-l3domain", - external_network_name="example-externalnetwork", + l3_isolation_domain_name="example-externalnetwork", + external_network_name="example-ext", body={"resourceIds": [""], "state": "Enable"}, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_UpdateAdministrativeState_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/ExternalNetworks_UpdateAdministrativeState.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_update_bfd_administrative_state.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_update_bfd_administrative_state.py new file mode 100644 index 000000000000..34b940ebee52 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_update_bfd_administrative_state.py @@ -0,0 +1,44 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python external_networks_update_bfd_administrative_state.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.external_networks.begin_update_bfd_administrative_state( + resource_group_name="example-rg", + l3_isolation_domain_name="example-externalnetwork", + external_network_name="example-ext", + body={"administrativeState": "Enable", "routeType": "Static"}, + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/ExternalNetworks_UpdateBfdAdministrativeState.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_update_static_route_bfd_administrative_state_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_update_static_route_bfd_administrative_state.py similarity index 78% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_update_static_route_bfd_administrative_state_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_update_static_route_bfd_administrative_state.py index 3c5d7c2401e7..416648f7854d 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_update_static_route_bfd_administrative_state_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/external_networks_update_static_route_bfd_administrative_state.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python external_networks_update_static_route_bfd_administrative_state_maximum_set_gen.py + python external_networks_update_static_route_bfd_administrative_state.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.external_networks.begin_update_static_route_bfd_administrative_state( @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_UpdateStaticRouteBfdAdministrativeState_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/ExternalNetworks_UpdateStaticRouteBfdAdministrativeState.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_create_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_create.py similarity index 71% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_create_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_create.py index 68857714cd4d..3fa07a724c05 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_create_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_create.py @@ -1,20 +1,22 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python internal_networks_create_maximum_set_gen.py + python internal_networks_create.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,14 +26,14 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.internal_networks.begin_create( resource_group_name="example-rg", - l3_isolation_domain_name="example-l3domain", + l3_isolation_domain_name="example-l3isd", internal_network_name="example-internalnetwork", body={ "properties": { @@ -40,13 +42,24 @@ def main(): "allowAS": 10, "allowASOverride": "Enable", "annotation": "annotation", - "bfdConfiguration": {"intervalInMilliSeconds": 300, "multiplier": 5}, + "bfdConfiguration": {"intervalInMilliSeconds": 300, "multiplier": 10}, + "bmpConfiguration": { + "bmpConfigurationState": "Enabled", + "exportPolicyConfiguration": {"exportPolicies": ["Pre-Policy"]}, + "neighborIpExclusions": ["10.0.0.1"], + }, "defaultRouteOriginate": "True", "ipv4ListenRangePrefixes": ["10.1.0.0/25"], - "ipv4NeighborAddress": [{"address": "10.1.0.0"}], + "ipv4NeighborAddress": [ + {"address": "10.1.0.0", "bfdAdministrativeState": "Enable", "bgpAdministrativeState": "Enable"} + ], "ipv6ListenRangePrefixes": ["2fff::/66"], - "ipv6NeighborAddress": [{"address": "2fff::"}], + "ipv6NeighborAddress": [ + {"address": "2fff::", "bfdAdministrativeState": "Enable", "bgpAdministrativeState": "Enable"} + ], "peerASN": 61234, + "v4OverV6BgpSession": "Enabled", + "v6OverV4BgpSession": "Enabled", }, "connectedIPv4Subnets": [{"annotation": "annotation", "prefix": "10.0.0.0/24"}], "connectedIPv6Subnets": [{"annotation": "annotation", "prefix": "3FFE:FFFF:0:CD30::a0/29"}], @@ -55,20 +68,24 @@ def main(): "exportIpv4RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName", "exportIpv6RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName", }, - "exportRoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName", "extension": "NoExtension", "importRoutePolicy": { "importIpv4RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName", "importIpv6RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName", }, - "importRoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName", "ingressAclId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl", "isMonitoringEnabled": "True", "mtu": 1500, + "nativeIpv4PrefixLimit": { + "prefixLimits": [{"idleTimeExpiry": 28, "maximumRoutes": 23, "threshold": 7}] + }, + "nativeIpv6PrefixLimit": { + "prefixLimits": [{"idleTimeExpiry": 28, "maximumRoutes": 23, "threshold": 7}] + }, "staticRouteConfiguration": { - "bfdConfiguration": {"intervalInMilliSeconds": 300, "multiplier": 15}, + "bfdConfiguration": {"intervalInMilliSeconds": 300, "multiplier": 10}, "extension": "NoExtension", - "ipv4Routes": [{"nextHop": ["10.0.0.1"], "prefix": "jffgck"}], + "ipv4Routes": [{"nextHop": ["10.0.0.1"], "prefix": "10.0.0.1/24"}], "ipv6Routes": [{"nextHop": ["3ffe::1"], "prefix": "2fff::/64"}], }, "vlanId": 755, @@ -78,6 +95,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_Create_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/InternalNetworks_Create.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_delete_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_delete.py similarity index 73% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_delete_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_delete.py index 22f3b68e8722..f0cb44c4de03 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_delete_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_delete.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python internal_networks_delete_maximum_set_gen.py + python internal_networks_delete.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,18 +25,18 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) client.internal_networks.begin_delete( resource_group_name="example-rg", - l3_isolation_domain_name="example-l3domain", + l3_isolation_domain_name="example-l3isd", internal_network_name="example-internalnetwork", ).result() -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/InternalNetworks_Delete.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_get_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_get.py similarity index 73% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_get_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_get.py index 931ba536dcdd..299b2b099309 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_get_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_get.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python internal_networks_get_maximum_set_gen.py + python internal_networks_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,19 +25,19 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.internal_networks.get( resource_group_name="example-rg", - l3_isolation_domain_name="example-l3domain", + l3_isolation_domain_name="example-l3isd", internal_network_name="example-internalnetwork", ) print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_Get_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/InternalNetworks_Get.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_list_by_l3_isolation_domain_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_list_by_l3_isolation_domain.py similarity index 71% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_list_by_l3_isolation_domain_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_list_by_l3_isolation_domain.py index 31766e889933..3933165b4e56 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_list_by_l3_isolation_domain_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_list_by_l3_isolation_domain.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python internal_networks_list_by_l3_isolation_domain_maximum_set_gen.py + python internal_networks_list_by_l3_isolation_domain.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,19 +25,19 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.internal_networks.list_by_l3_isolation_domain( resource_group_name="example-rg", - l3_isolation_domain_name="example-l3domain", + l3_isolation_domain_name="example-l3isd", ) for item in response: print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_ListByL3IsolationDomain_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/InternalNetworks_ListByL3IsolationDomain.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_update_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_update.py similarity index 71% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_update_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_update.py index 93acdddd72ba..0bca2d24259e 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_update_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_update.py @@ -1,20 +1,22 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python internal_networks_update_maximum_set_gen.py + python internal_networks_update.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,14 +26,14 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.internal_networks.begin_update( resource_group_name="example-rg", - l3_isolation_domain_name="example-l3domain", + l3_isolation_domain_name="example-l3isd", internal_network_name="example-internalnetwork", body={ "properties": { @@ -40,34 +42,45 @@ def main(): "allowAS": 10, "allowASOverride": "Enable", "annotation": "annotation", - "bfdConfiguration": {"intervalInMilliSeconds": 300, "multiplier": 5}, + "bfdConfiguration": {"intervalInMilliSeconds": 300, "multiplier": 10}, + "bmpConfiguration": {"bmpConfigurationState": "Enabled", "neighborIpExclusions": ["10.0.0.10"]}, "defaultRouteOriginate": "True", "ipv4ListenRangePrefixes": ["10.1.0.0/25"], - "ipv4NeighborAddress": [{"address": "10.1.0.0"}], + "ipv4NeighborAddress": [ + {"address": "10.1.0.0", "bfdAdministrativeState": "Enable", "bgpAdministrativeState": "Enable"} + ], "ipv6ListenRangePrefixes": ["2fff::/66"], - "ipv6NeighborAddress": [{"address": "2fff::"}], + "ipv6NeighborAddress": [ + {"address": "10.1.0.0", "bfdAdministrativeState": "Enable", "bgpAdministrativeState": "Enable"} + ], "peerASN": 61234, + "v4OverV6BgpSession": "Enabled", + "v6OverV4BgpSession": "Enabled", }, "connectedIPv4Subnets": [{"annotation": "annotation", "prefix": "10.0.0.0/24"}], - "connectedIPv6Subnets": [{"annotation": "annotation", "prefix": "3FFE:FFFF:0:CD30::a0/29"}], + "connectedIPv6Subnets": [{"annotation": "annotation", "prefix": "10.0.0.0/24"}], "egressAclId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl", "exportRoutePolicy": { "exportIpv4RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName", "exportIpv6RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName", }, - "exportRoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName", "importRoutePolicy": { "importIpv4RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName", "importIpv6RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName", }, - "importRoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName", "ingressAclId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl", "isMonitoringEnabled": "True", "mtu": 1500, + "nativeIpv4PrefixLimit": { + "prefixLimits": [{"idleTimeExpiry": 20, "maximumRoutes": 24, "threshold": 6}] + }, + "nativeIpv6PrefixLimit": { + "prefixLimits": [{"idleTimeExpiry": 20, "maximumRoutes": 24, "threshold": 6}] + }, "staticRouteConfiguration": { - "bfdConfiguration": {"intervalInMilliSeconds": 300, "multiplier": 15}, - "ipv4Routes": [{"nextHop": ["10.0.0.1"], "prefix": "20.20.20.20/25"}], - "ipv6Routes": [{"nextHop": ["3ffe::1"], "prefix": "2fff::/64"}], + "bfdConfiguration": {"intervalInMilliSeconds": 300, "multiplier": 10}, + "ipv4Routes": [{"nextHop": ["10.0.0.1"], "prefix": "jffgck"}], + "ipv6Routes": [{"nextHop": ["10.0.0.1"], "prefix": "jffgck"}], }, } }, @@ -75,6 +88,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_Update_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/InternalNetworks_Update.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_update_administrative_state_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_update_administrative_state.py similarity index 73% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_update_administrative_state_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_update_administrative_state.py index eeb64ea18e79..3af478f869f9 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_update_administrative_state_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_update_administrative_state.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python internal_networks_update_administrative_state_maximum_set_gen.py + python internal_networks_update_administrative_state.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,20 +25,20 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.internal_networks.begin_update_administrative_state( resource_group_name="example-rg", - l3_isolation_domain_name="example-l3domain", + l3_isolation_domain_name="example-l3isd", internal_network_name="example-internalnetwork", body={"resourceIds": [""], "state": "Enable"}, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_UpdateAdministrativeState_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/InternalNetworks_UpdateAdministrativeState.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_update_bfd_administrative_state.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_update_bfd_administrative_state.py new file mode 100644 index 000000000000..63c8f5fd097b --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_update_bfd_administrative_state.py @@ -0,0 +1,44 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python internal_networks_update_bfd_administrative_state.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.internal_networks.begin_update_bfd_administrative_state( + resource_group_name="example-rg", + l3_isolation_domain_name="example-l3isd", + internal_network_name="example-internalnetwork", + body={"administrativeState": "Enable", "neighborAddress": "10.10.1.10", "routeType": "Static"}, + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/InternalNetworks_UpdateBfdAdministrativeState.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_update_bgp_administrative_state.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_update_bgp_administrative_state.py new file mode 100644 index 000000000000..511abde0e09c --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_update_bgp_administrative_state.py @@ -0,0 +1,44 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python internal_networks_update_bgp_administrative_state.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.internal_networks.begin_update_bgp_administrative_state( + resource_group_name="example-rg", + l3_isolation_domain_name="example-l3isd", + internal_network_name="example-internalnetwork", + body={"administrativeState": "Enable", "neighborAddress": "10.10.10.10"}, + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/InternalNetworks_UpdateBgpAdministrativeState.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_update_bgp_administrative_state_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_update_bgp_administrative_state_maximum_set_gen.py deleted file mode 100644 index f7be99c35d7f..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_update_bgp_administrative_state_maximum_set_gen.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-managednetworkfabric -# USAGE - python internal_networks_update_bgp_administrative_state_maximum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ManagedNetworkFabricMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", - ) - - response = client.internal_networks.begin_update_bgp_administrative_state( - resource_group_name="example-rg", - l3_isolation_domain_name="example-l3domain", - internal_network_name="example-internalNetwork", - body={"resourceIds": [""], "state": "Enable"}, - ).result() - print(response) - - -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_UpdateBgpAdministrativeState_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_update_static_route_bfd_administrative_state_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_update_static_route_bfd_administrative_state.py similarity index 78% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_update_static_route_bfd_administrative_state_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_update_static_route_bfd_administrative_state.py index beeb4beaa38e..b303112dd606 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_update_static_route_bfd_administrative_state_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internal_networks_update_static_route_bfd_administrative_state.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python internal_networks_update_static_route_bfd_administrative_state_maximum_set_gen.py + python internal_networks_update_static_route_bfd_administrative_state.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.internal_networks.begin_update_static_route_bfd_administrative_state( @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_UpdateStaticRouteBfdAdministrativeState_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/InternalNetworks_UpdateStaticRouteBfdAdministrativeState.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_create_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_create.py similarity index 67% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_create_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_create.py index c26a25ebfbff..4e216113afc6 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_create_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_create.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python internet_gateway_rules_create_maximum_set_gen.py + python internet_gateway_rules_create.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.internet_gateway_rules.begin_create( @@ -36,14 +37,21 @@ def main(): "location": "eastus", "properties": { "annotation": "annotationValue", - "ruleProperties": {"action": "Allow", "addressList": ["10.10.10.10"]}, + "ruleProperties": { + "action": "Allow", + "addressList": ["10.10.10.10"], + "condition": "Or", + "destinationAddressList": ["11.11.10.11"], + "headerAddressList": [{"addressList": ["10.10.10.10"], "headerName": "abcHeader"}], + "sourceAddressList": ["10.10.10.10"], + }, }, - "tags": {"keyID": "keyValue"}, + "tags": {"KeyID": "KeyValue"}, }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGatewayRules_Create_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/InternetGatewayRules_Create.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_delete_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_delete.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_delete_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_delete.py index 610b4184988d..f6b35849fe20 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_delete_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_delete.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python internet_gateway_rules_delete_maximum_set_gen.py + python internet_gateway_rules_delete.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) client.internet_gateway_rules.begin_delete( @@ -35,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGatewayRules_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/InternetGatewayRules_Delete.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_get_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_get.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_get_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_get.py index 53b8625a7420..0536e9860333 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_get_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_get.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python internet_gateway_rules_get_maximum_set_gen.py + python internet_gateway_rules_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.internet_gateway_rules.get( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGatewayRules_Get_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/InternetGatewayRules_Get.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_list_by_resource_group_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_list_by_resource_group.py similarity index 74% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_list_by_resource_group_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_list_by_resource_group.py index e4e3eb8650c4..14ddd1c61bbd 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_list_by_resource_group_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_list_by_resource_group.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python internet_gateway_rules_list_by_resource_group_maximum_set_gen.py + python internet_gateway_rules_list_by_resource_group.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.internet_gateway_rules.list_by_resource_group( @@ -36,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGatewayRules_ListByResourceGroup_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/InternetGatewayRules_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_list_by_subscription_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_list_by_subscription.py similarity index 73% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_list_by_subscription_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_list_by_subscription.py index 799140dadb97..8a047028505e 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_list_by_subscription_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_list_by_subscription.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python internet_gateway_rules_list_by_subscription_maximum_set_gen.py + python internet_gateway_rules_list_by_subscription.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.internet_gateway_rules.list_by_subscription() @@ -34,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGatewayRules_ListBySubscription_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/InternetGatewayRules_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_update_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_update.py similarity index 73% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_update_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_update.py index 6ea5250d8893..ccab141e3674 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_update_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateway_rules_update.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python internet_gateway_rules_update_maximum_set_gen.py + python internet_gateway_rules_update.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,19 +25,19 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.internet_gateway_rules.begin_update( resource_group_name="example-rg", internet_gateway_rule_name="example-internetGatewayRule", - body={"tags": {"key3311": "1234"}}, + body={"tags": {"KeyID": "KeyValue1"}}, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGatewayRules_Update_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/InternetGatewayRules_Update.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_create_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_create.py similarity index 80% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_create_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_create.py index 38e970cfe396..b9474477ae57 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_create_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_create.py @@ -1,20 +1,22 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python internet_gateways_create_maximum_set_gen.py + python internet_gateways_create.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +26,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.internet_gateways.begin_create( @@ -37,15 +39,16 @@ def main(): "properties": { "annotation": "annotation", "internetGatewayRuleId": "/subscriptions/xxxx-xxxx-xxxx-xxxx/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/example-internetGatewayRule", + "internetGatewayType": "Infrastructure", "networkFabricControllerId": "/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-networkFabricController", "type": "Infrastructure", }, - "tags": {"key3540": "1234"}, + "tags": {"keyId": "KeyValue"}, }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGateways_Create_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/InternetGateways_Create.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_delete_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_delete.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_delete_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_delete.py index ccc3048fd240..3a3e6c37f906 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_delete_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_delete.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python internet_gateways_delete_maximum_set_gen.py + python internet_gateways_delete.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) client.internet_gateways.begin_delete( @@ -35,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGateways_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/InternetGateways_Delete.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_get_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_get.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_get_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_get.py index e9c3f35ffc84..91f314cbd198 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_get_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_get.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python internet_gateways_get_maximum_set_gen.py + python internet_gateways_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.internet_gateways.get( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGateways_Get_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/InternetGateways_Get.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_list_by_resource_group_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_list_by_resource_group.py similarity index 74% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_list_by_resource_group_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_list_by_resource_group.py index 3a15a611d808..c59c98b84bb9 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_list_by_resource_group_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_list_by_resource_group.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python internet_gateways_list_by_resource_group_maximum_set_gen.py + python internet_gateways_list_by_resource_group.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.internet_gateways.list_by_resource_group( @@ -36,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGateways_ListByResourceGroup_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/InternetGateways_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_list_by_subscription_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_list_by_subscription.py similarity index 73% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_list_by_subscription_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_list_by_subscription.py index 17d2cd72ae95..7f5e602a8e4c 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_list_by_subscription_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_list_by_subscription.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python internet_gateways_list_by_subscription_maximum_set_gen.py + python internet_gateways_list_by_subscription.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.internet_gateways.list_by_subscription() @@ -34,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGateways_ListBySubscription_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/InternetGateways_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_update_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_update.py similarity index 77% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_update_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_update.py index 4151a2aedc27..2731978a0e6c 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_update_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/internet_gateways_update.py @@ -1,20 +1,22 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python internet_gateways_update_maximum_set_gen.py + python internet_gateways_update.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +26,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.internet_gateways.begin_update( @@ -36,12 +38,12 @@ def main(): "properties": { "internetGatewayRuleId": "/subscriptions/xxxx-xxxx-xxxx-xxxx/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/example-internetGatewayRule" }, - "tags": {"key81": "2345"}, + "tags": {"keyId": "KeyValue"}, }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGateways_Update_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/InternetGateways_Update.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_create_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_create.py similarity index 79% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_create_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_create.py index 28e52eaebd3d..95d3b4d8e2e5 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_create_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_create.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python ip_communities_create_maximum_set_gen.py + python ip_communities_create.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.ip_communities.begin_create( @@ -35,6 +36,7 @@ def main(): body={ "location": "eastus", "properties": { + "administrativeState": "Enabled", "annotation": "annotation", "ipCommunityRules": [ { @@ -45,12 +47,12 @@ def main(): } ], }, - "tags": {"keyId": "KeyValue"}, + "tags": {"KeyId": "KeyValue"}, }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpCommunities_Create_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/IpCommunities_Create.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_delete_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_delete.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_delete_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_delete.py index ec57e254809b..b28a86fb62d9 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_delete_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_delete.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python ip_communities_delete_maximum_set_gen.py + python ip_communities_delete.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) client.ip_communities.begin_delete( @@ -35,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpCommunities_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/IpCommunities_Delete.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_get_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_get.py similarity index 76% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_get_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_get.py index 7d700e18bd7a..5ef64b52f5c2 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_get_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_get.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python ip_communities_get_maximum_set_gen.py + python ip_communities_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.ip_communities.get( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpCommunities_Get_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/IpCommunities_Get.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_list_by_resource_group_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_list_by_resource_group.py similarity index 74% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_list_by_resource_group_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_list_by_resource_group.py index 2988a4a4d54a..b4ecf06fe052 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_list_by_resource_group_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_list_by_resource_group.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python ip_communities_list_by_resource_group_maximum_set_gen.py + python ip_communities_list_by_resource_group.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.ip_communities.list_by_resource_group( @@ -36,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpCommunities_ListByResourceGroup_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/IpCommunities_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_list_by_subscription_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_list_by_subscription.py similarity index 73% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_list_by_subscription_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_list_by_subscription.py index dbcbd1149e47..2b0e41ecd4ee 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_list_by_subscription_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_list_by_subscription.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python ip_communities_list_by_subscription_maximum_set_gen.py + python ip_communities_list_by_subscription.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.ip_communities.list_by_subscription() @@ -34,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpCommunities_ListBySubscription_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/IpCommunities_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_update_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_update.py similarity index 79% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_update_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_update.py index 42fe84dd9f8e..ce0f9bb75b4c 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_update_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_communities_update.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python ip_communities_update_maximum_set_gen.py + python ip_communities_update.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.ip_communities.begin_update( @@ -42,12 +43,13 @@ def main(): "wellKnownCommunities": ["Internet"], } ] - } + }, + "tags": {"keyID": "KeyValue"}, }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpCommunities_Update_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/IpCommunities_Update.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_create_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_create.py similarity index 77% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_create_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_create.py index 92ec9068fa5f..85796f7beb51 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_create_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_create.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python ip_extended_communities_create_maximum_set_gen.py + python ip_extended_communities_create.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.ip_extended_communities.begin_create( @@ -35,17 +36,18 @@ def main(): body={ "location": "eastus", "properties": { + "administrativeState": "Enabled", "annotation": "annotation", "ipExtendedCommunityRules": [ {"action": "Permit", "routeTargets": ["1234:2345"], "sequenceNumber": 4155123341} ], }, - "tags": {"keyID": "KeyValue"}, + "tags": {"KeyId": "KeyValue"}, }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpExtendedCommunities_Create_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/IpExtendedCommunities_Create.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_delete_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_delete.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_delete_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_delete.py index 685b77d6e880..0f2a8daf7de7 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_delete_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_delete.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python ip_extended_communities_delete_maximum_set_gen.py + python ip_extended_communities_delete.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) client.ip_extended_communities.begin_delete( @@ -35,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpExtendedCommunities_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/IpExtendedCommunities_Delete.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_get_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_get.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_get_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_get.py index d046f9ea3b98..1b99c5fa8b48 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_get_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_get.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python ip_extended_communities_get_maximum_set_gen.py + python ip_extended_communities_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.ip_extended_communities.get( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpExtendedCommunities_Get_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/IpExtendedCommunities_Get.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_list_by_resource_group_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_list_by_resource_group.py similarity index 73% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_list_by_resource_group_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_list_by_resource_group.py index 96276c75a0fc..a43353360105 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_list_by_resource_group_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_list_by_resource_group.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python ip_extended_communities_list_by_resource_group_maximum_set_gen.py + python ip_extended_communities_list_by_resource_group.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.ip_extended_communities.list_by_resource_group( @@ -36,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpExtendedCommunities_ListByResourceGroup_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/IpExtendedCommunities_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_list_by_subscription_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_list_by_subscription.py similarity index 73% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_list_by_subscription_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_list_by_subscription.py index aae28a26673e..b6f43769b50d 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_list_by_subscription_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_list_by_subscription.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python ip_extended_communities_list_by_subscription_maximum_set_gen.py + python ip_extended_communities_list_by_subscription.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.ip_extended_communities.list_by_subscription() @@ -34,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpExtendedCommunities_ListBySubscription_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/IpExtendedCommunities_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_update_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_update.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_update_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_update.py index 89d9b468563b..2d6a3d009492 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_update_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_extended_communities_update.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python ip_extended_communities_update_maximum_set_gen.py + python ip_extended_communities_update.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.ip_extended_communities.begin_update( @@ -34,16 +35,17 @@ def main(): ip_extended_community_name="example-ipExtendedCommunity", body={ "properties": { + "annotation": "annotation", "ipExtendedCommunityRules": [ {"action": "Permit", "routeTargets": ["1234:2345"], "sequenceNumber": 4155123341} - ] + ], }, - "tags": {"keyID": "KeyValue"}, + "tags": {"KeyId": "KeyValue"}, }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpExtendedCommunities_Update_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/IpExtendedCommunities_Update.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_create_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_create.py similarity index 80% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_create_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_create.py index 68ab865ab174..60d89dffcc55 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_create_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_create.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python ip_prefixes_create_maximum_set_gen.py + python ip_prefixes_create.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.ip_prefixes.begin_create( @@ -35,6 +36,7 @@ def main(): body={ "location": "eastus", "properties": { + "administrativeState": "Enabled", "annotation": "annotation", "ipPrefixRules": [ { @@ -46,12 +48,12 @@ def main(): } ], }, - "tags": {"keyID": "KeyValue"}, + "tags": {"KeyId": "KeyValue"}, }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpPrefixes_Create_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/IpPrefixes_Create.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_delete_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_delete.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_delete_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_delete.py index 62a26fe050eb..58cfe4676817 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_delete_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_delete.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python ip_prefixes_delete_maximum_set_gen.py + python ip_prefixes_delete.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) client.ip_prefixes.begin_delete( @@ -35,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpPrefixes_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/IpPrefixes_Delete.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_get_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_get.py similarity index 76% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_get_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_get.py index c202ba4e87f2..b1c1ac9bf26e 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_get_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_get.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python ip_prefixes_get_maximum_set_gen.py + python ip_prefixes_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.ip_prefixes.get( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpPrefixes_Get_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/IpPrefixes_Get.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_list_by_resource_group_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_list_by_resource_group.py similarity index 74% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_list_by_resource_group_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_list_by_resource_group.py index 0cbc44821875..04e340943342 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_list_by_resource_group_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_list_by_resource_group.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python ip_prefixes_list_by_resource_group_maximum_set_gen.py + python ip_prefixes_list_by_resource_group.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.ip_prefixes.list_by_resource_group( @@ -36,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpPrefixes_ListByResourceGroup_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/IpPrefixes_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_list_by_subscription_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_list_by_subscription.py similarity index 73% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_list_by_subscription_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_list_by_subscription.py index 1db2ae442cad..ee7ef36de017 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_list_by_subscription_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_list_by_subscription.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python ip_prefixes_list_by_subscription_maximum_set_gen.py + python ip_prefixes_list_by_subscription.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.ip_prefixes.list_by_subscription() @@ -34,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpPrefixes_ListBySubscription_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/IpPrefixes_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_update_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_update.py similarity index 79% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_update_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_update.py index 67cc1e5bf704..79b93e95b9c4 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_update_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/ip_prefixes_update.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python ip_prefixes_update_maximum_set_gen.py + python ip_prefixes_update.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.ip_prefixes.begin_update( @@ -45,12 +46,12 @@ def main(): } ], }, - "tags": {"keyID": "KeyValue"}, + "tags": {"KeyId": "KeyValue"}, }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpPrefixes_Update_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/IpPrefixes_Update.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_commit_configuration_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_commit_configuration.py similarity index 74% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_commit_configuration_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_commit_configuration.py index f07d11656e42..e87cfdb0773d 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_commit_configuration_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_commit_configuration.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python l2_isolation_domains_commit_configuration_maximum_set_gen.py + python l2_isolation_domains_commit_configuration.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.l2_isolation_domains.begin_commit_configuration( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_CommitConfiguration_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/L2IsolationDomains_CommitConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_create_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_create.py similarity index 68% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_create_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_create.py index c84e607a840a..d3ee862fad7e 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_create_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_create.py @@ -1,20 +1,22 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python l2_isolation_domains_create_maximum_set_gen.py + python l2_isolation_domains_create.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,28 +26,32 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.l2_isolation_domains.begin_create( resource_group_name="example-rg", l2_isolation_domain_name="example-l2domain", body={ + "identity": {"type": "None", "userAssignedIdentities": {"key3673": {}}}, "location": "eastus", "properties": { + "administrativeState": "Enabled", "annotation": "annotation", + "extendedVlan": "Enabled", "mtu": 1500, "networkFabricId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric", + "networkToNetworkInterconnectId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni", "vlanId": 501, }, - "tags": {"keyID": "keyValue"}, + "tags": {"KeyId": "KeyValue"}, }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_Create_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/L2IsolationDomains_Create.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_delete_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_delete.py similarity index 72% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_delete_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_delete.py index 04fab827be0e..f1046e431394 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_delete_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_delete.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python l2_isolation_domains_delete_maximum_set_gen.py + python l2_isolation_domains_delete.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,17 +25,17 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) client.l2_isolation_domains.begin_delete( resource_group_name="example-rg", - l2_isolation_domain_name="example-l2Domain", + l2_isolation_domain_name="example-l2domain", ).result() -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/L2IsolationDomains_Delete.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_get_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_get.py similarity index 72% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_get_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_get.py index 08b0fc0e589b..a189f6add6b1 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_get_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_get.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python l2_isolation_domains_get_maximum_set_gen.py + python l2_isolation_domains_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,18 +25,18 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.l2_isolation_domains.get( resource_group_name="example-rg", - l2_isolation_domain_name="example-l2Domain", + l2_isolation_domain_name="example-l2domain", ) print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_Get_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/L2IsolationDomains_Get.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_list_by_resource_group_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_list_by_resource_group.py similarity index 74% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_list_by_resource_group_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_list_by_resource_group.py index 9cbc36c23250..019dd713a026 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_list_by_resource_group_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_list_by_resource_group.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python l2_isolation_domains_list_by_resource_group_maximum_set_gen.py + python l2_isolation_domains_list_by_resource_group.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.l2_isolation_domains.list_by_resource_group( @@ -36,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_ListByResourceGroup_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/L2IsolationDomains_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_list_by_subscription_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_list_by_subscription.py similarity index 73% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_list_by_subscription_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_list_by_subscription.py index 1bb046dff0e8..3b1889c0e0f8 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_list_by_subscription_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_list_by_subscription.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python l2_isolation_domains_list_by_subscription_maximum_set_gen.py + python l2_isolation_domains_list_by_subscription.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.l2_isolation_domains.list_by_subscription() @@ -34,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_ListBySubscription_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/L2IsolationDomains_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_update.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_update.py new file mode 100644 index 000000000000..5f4827ffcdd2 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_update.py @@ -0,0 +1,52 @@ +# pylint: disable=line-too-long,useless-suppression +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python l2_isolation_domains_update.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.l2_isolation_domains.begin_update( + resource_group_name="example-rg", + l2_isolation_domain_name="example-l2domain", + body={ + "identity": {"type": "None", "userAssignedIdentities": {"key8793": {}}}, + "properties": { + "annotation": "annotation1", + "mtu": 6000, + "networkToNetworkInterconnectId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni", + }, + "tags": {"KeyId": "KeyValue"}, + }, + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/L2IsolationDomains_Update.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_update_administrative_state_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_update_administrative_state.py similarity index 72% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_update_administrative_state_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_update_administrative_state.py index 3a7600465d48..9d7b4496b5fe 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_update_administrative_state_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_update_administrative_state.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python l2_isolation_domains_update_administrative_state_maximum_set_gen.py + python l2_isolation_domains_update_administrative_state.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,19 +25,19 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.l2_isolation_domains.begin_update_administrative_state( resource_group_name="example-rg", - l2_isolation_domain_name="example-l2Domain", + l2_isolation_domain_name="example-l2domain", body={"resourceIds": [""], "state": "Enable"}, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_updateAdministrativeState_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/L2IsolationDomains_UpdateAdministrativeState.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_update_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_update_maximum_set_gen.py deleted file mode 100644 index 8557dfb2215b..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_update_maximum_set_gen.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-managednetworkfabric -# USAGE - python l2_isolation_domains_update_maximum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ManagedNetworkFabricMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", - ) - - response = client.l2_isolation_domains.begin_update( - resource_group_name="example-rg", - l2_isolation_domain_name="example-l2Domain", - body={"properties": {"annotation": "annotation1", "mtu": 6000}, "tags": {"keyID": "keyValue"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_Update_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_validate_configuration_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_validate_configuration.py similarity index 74% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_validate_configuration_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_validate_configuration.py index c37e4caa4e46..83d351f567e3 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_validate_configuration_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l2_isolation_domains_validate_configuration.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python l2_isolation_domains_validate_configuration_maximum_set_gen.py + python l2_isolation_domains_validate_configuration.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.l2_isolation_domains.begin_validate_configuration( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_ValidateConfiguration_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/L2IsolationDomains_ValidateConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_commit_configuration_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_commit_configuration.py similarity index 74% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_commit_configuration_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_commit_configuration.py index 5f3729f4221d..904328e33173 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_commit_configuration_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_commit_configuration.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python l3_isolation_domains_commit_configuration_maximum_set_gen.py + python l3_isolation_domains_commit_configuration.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.l3_isolation_domains.begin_commit_configuration( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_CommitConfiguration_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/L3IsolationDomains_CommitConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_create_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_create.py similarity index 64% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_create_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_create.py index dff6a50b669c..732e438e573e 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_create_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_create.py @@ -1,20 +1,22 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python l3_isolation_domains_create_maximum_set_gen.py + python l3_isolation_domains_create.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,17 +26,19 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.l3_isolation_domains.begin_create( resource_group_name="example-rg", l3_isolation_domain_name="example-l3domain", body={ + "identity": {"type": "None", "userAssignedIdentities": {"key3673": {}}}, "location": "eastus", "properties": { + "administrativeState": "Enabled", "aggregateRouteConfiguration": { "ipv4Routes": [{"prefix": "10.0.0.0/24"}], "ipv6Routes": [{"prefix": "3FFE:FFFF:0:CD30::a0/29"}], @@ -44,19 +48,27 @@ def main(): "exportRoutePolicy": { "exportIpv4RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy", "exportIpv6RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy", - }, - "exportRoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName", + } }, "networkFabricId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric", "redistributeConnectedSubnets": "True", - "redistributeStaticRoutes": "False", + "redistributeStaticRoutes": "True", + "staticRouteRoutePolicy": { + "exportRoutePolicy": { + "exportIpv4RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy", + "exportIpv6RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy", + } + }, + "uniqueRdConfiguration": {}, + "v4routePrefixLimit": {"hardLimit": 1000, "threshold": 90}, + "v6routePrefixLimit": {"hardLimit": 1000, "threshold": 90}, }, - "tags": {"keyID": "KeyValue"}, + "tags": {"KeyId": "KeyValue"}, }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_Create_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/L3IsolationDomains_Create.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_delete_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_delete.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_delete_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_delete.py index e649b4843bac..cdaf6e311c17 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_delete_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_delete.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python l3_isolation_domains_delete_maximum_set_gen.py + python l3_isolation_domains_delete.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) client.l3_isolation_domains.begin_delete( @@ -35,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/L3IsolationDomains_Delete.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_get_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_get.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_get_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_get.py index db1bc6a794c6..f80da45e57ff 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_get_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_get.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python l3_isolation_domains_get_maximum_set_gen.py + python l3_isolation_domains_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.l3_isolation_domains.get( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_Get_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/L3IsolationDomains_Get.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_list_by_resource_group_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_list_by_resource_group.py similarity index 74% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_list_by_resource_group_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_list_by_resource_group.py index 25b60cb48395..6ffa92708b0e 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_list_by_resource_group_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_list_by_resource_group.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python l3_isolation_domains_list_by_resource_group_maximum_set_gen.py + python l3_isolation_domains_list_by_resource_group.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.l3_isolation_domains.list_by_resource_group( @@ -36,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_ListByResourceGroup_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/L3IsolationDomains_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_list_by_subscription_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_list_by_subscription.py similarity index 73% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_list_by_subscription_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_list_by_subscription.py index 4639b4799f23..674e44c16728 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_list_by_subscription_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_list_by_subscription.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python l3_isolation_domains_list_by_subscription_maximum_set_gen.py + python l3_isolation_domains_list_by_subscription.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.l3_isolation_domains.list_by_subscription() @@ -34,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_ListBySubscription_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/L3IsolationDomains_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_update_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_update.py similarity index 62% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_update_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_update.py index a7b4c7c33431..fe80a8ab0caf 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_update_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_update.py @@ -1,20 +1,22 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python l3_isolation_domains_update_maximum_set_gen.py + python l3_isolation_domains_update.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,15 +26,16 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.l3_isolation_domains.begin_update( resource_group_name="example-rg", l3_isolation_domain_name="example-l3domain", body={ + "identity": {"type": "None", "userAssignedIdentities": {"key8793": {}}}, "properties": { "aggregateRouteConfiguration": { "ipv4Routes": [{"prefix": "10.0.0.0/24"}], @@ -41,20 +44,28 @@ def main(): "annotation": "annotation1", "connectedSubnetRoutePolicy": { "exportRoutePolicy": { - "exportIpv4RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy1", - "exportIpv6RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy1", - }, - "exportRoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName", + "exportIpv4RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy", + "exportIpv6RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy", + } }, + "exportPolicyConfiguration": {"exportPolicies": ["Pre-Policy"]}, "redistributeConnectedSubnets": "True", - "redistributeStaticRoutes": "False", + "redistributeStaticRoutes": "True", + "staticRouteRoutePolicy": { + "exportRoutePolicy": { + "exportIpv4RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy", + "exportIpv6RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy", + } + }, + "v4routePrefixLimit": {"hardLimit": 1000, "threshold": 50}, + "v6routePrefixLimit": {"hardLimit": 1000, "threshold": 50}, }, - "tags": {"key4953": "1234"}, + "tags": {"KeyId": "KeyValue"}, }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_Update_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/L3IsolationDomains_Update.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_update_administrative_state_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_update_administrative_state.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_update_administrative_state_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_update_administrative_state.py index e4d4b354c857..2eb71e839d59 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_update_administrative_state_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_update_administrative_state.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python l3_isolation_domains_update_administrative_state_maximum_set_gen.py + python l3_isolation_domains_update_administrative_state.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.l3_isolation_domains.begin_update_administrative_state( @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_updateAdministrativeState_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/L3IsolationDomains_UpdateAdministrativeState.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_validate_configuration_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_validate_configuration.py similarity index 74% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_validate_configuration_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_validate_configuration.py index 4fe939c34628..0db5429c2f0f 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_validate_configuration_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/l3_isolation_domains_validate_configuration.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python l3_isolation_domains_validate_configuration_maximum_set_gen.py + python l3_isolation_domains_validate_configuration.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.l3_isolation_domains.begin_validate_configuration( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_ValidateConfiguration_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/L3IsolationDomains_ValidateConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_create_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_create.py similarity index 81% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_create_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_create.py index d843f250d42a..f3c48a89731f 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_create_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_create.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python neighbor_groups_create_maximum_set_gen.py + python neighbor_groups_create.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,15 +25,16 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.neighbor_groups.begin_create( resource_group_name="example-rg", neighbor_group_name="example-neighborGroup", body={ + "identity": {"type": "None", "userAssignedIdentities": {"key3673": {}}}, "location": "eastus", "properties": { "annotation": "annotation", @@ -51,12 +53,12 @@ def main(): "ipv6Addresses": ["2F::/100"], }, }, - "tags": {"key8107": "1234"}, + "tags": {"KeyId": "KeyValue"}, }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NeighborGroups_Create_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NeighborGroups_Create.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_delete_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_delete.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_delete_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_delete.py index 6745b44a7e0a..91ca49dcc03a 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_delete_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_delete.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python neighbor_groups_delete_maximum_set_gen.py + python neighbor_groups_delete.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) client.neighbor_groups.begin_delete( @@ -35,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NeighborGroups_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NeighborGroups_Delete.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_get_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_get.py similarity index 76% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_get_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_get.py index 5dcda092d40c..e11beeeaa092 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_get_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_get.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python neighbor_groups_get_maximum_set_gen.py + python neighbor_groups_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.neighbor_groups.get( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NeighborGroups_Get_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NeighborGroups_Get.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_list_by_resource_group_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_list_by_resource_group.py similarity index 74% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_list_by_resource_group_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_list_by_resource_group.py index 729789a1c1e8..c467fc71e46c 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_list_by_resource_group_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_list_by_resource_group.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python neighbor_groups_list_by_resource_group_maximum_set_gen.py + python neighbor_groups_list_by_resource_group.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.neighbor_groups.list_by_resource_group( @@ -36,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NeighborGroups_ListByResourceGroup_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NeighborGroups_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_list_by_subscription_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_list_by_subscription.py similarity index 73% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_list_by_subscription_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_list_by_subscription.py index 912b92ed7e6f..c82827016a64 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_list_by_subscription_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_list_by_subscription.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python neighbor_groups_list_by_subscription_maximum_set_gen.py + python neighbor_groups_list_by_subscription.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.neighbor_groups.list_by_subscription() @@ -34,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NeighborGroups_ListBySubscription_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NeighborGroups_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_resync.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_resync.py new file mode 100644 index 000000000000..4e84157b5479 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_resync.py @@ -0,0 +1,42 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python neighbor_groups_resync.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.neighbor_groups.begin_resync( + resource_group_name="example-rg", + neighbor_group_name="example-neighborgroup", + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NeighborGroups_Resync.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_update_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_update.py similarity index 81% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_update_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_update.py index 545f33d91d6c..fc8f7dea803f 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_update_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/neighbor_groups_update.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python neighbor_groups_update_maximum_set_gen.py + python neighbor_groups_update.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,15 +25,16 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.neighbor_groups.begin_update( resource_group_name="example-rg", neighbor_group_name="example-neighborGroup", body={ + "identity": {"type": "None", "userAssignedIdentities": {"key8793": {}}}, "properties": { "annotation": "Updating", "destination": { @@ -50,12 +52,12 @@ def main(): "ipv6Addresses": ["2F::/100"], }, }, - "tags": {"key8107": "2345"}, + "tags": {"KeyId": "KeyValue"}, }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NeighborGroups_Update_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NeighborGroups_Update.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_create_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_create.py similarity index 73% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_create_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_create.py index 5eb0f30d4302..92282f7eb9aa 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_create_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_create.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_devices_create_maximum_set_gen.py + python network_bootstrap_devices_create.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,28 +25,30 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) - response = client.network_devices.begin_create( + response = client.network_bootstrap_devices.begin_create( resource_group_name="example-rg", - network_device_name="example-device", + network_bootstrap_device_name="example-device", body={ + "identity": {"type": "None", "userAssignedIdentities": {"key3673": {}}}, "location": "eastuseuap", "properties": { + "administrativeState": "Enabled", "annotation": "annotation", "hostName": "NFA-Device", "networkDeviceSku": "DeviceSku", "serialNumber": "Vendor;DCS-7280XXX-24;12.05;JPE2111XXXX", }, - "tags": {"keyID": "KeyValue"}, + "tags": {}, }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_Create_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkBootstrapDevices_Create.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_delete.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_delete.py new file mode 100644 index 000000000000..7a3e450090d0 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_delete.py @@ -0,0 +1,41 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_bootstrap_devices_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.network_bootstrap_devices.begin_delete( + resource_group_name="example-rg", + network_bootstrap_device_name="example-device", + ).result() + + +# x-ms-original-file: 2025-07-15/NetworkBootstrapDevices_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_get.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_get.py new file mode 100644 index 000000000000..9d9483fd8401 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_get.py @@ -0,0 +1,42 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_bootstrap_devices_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_bootstrap_devices.get( + resource_group_name="example-rg", + network_bootstrap_device_name="example-device", + ) + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkBootstrapDevices_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_list_by_resource_group.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_list_by_resource_group.py new file mode 100644 index 000000000000..e20c1e9e9f85 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_list_by_resource_group.py @@ -0,0 +1,42 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_bootstrap_devices_list_by_resource_group.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_bootstrap_devices.list_by_resource_group( + resource_group_name="example-rg", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2025-07-15/NetworkBootstrapDevices_ListByResourceGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_list_by_subscription.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_list_by_subscription.py new file mode 100644 index 000000000000..5c3d33fa8c4f --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_list_by_subscription.py @@ -0,0 +1,40 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_bootstrap_devices_list_by_subscription.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_bootstrap_devices.list_by_subscription() + for item in response: + print(item) + + +# x-ms-original-file: 2025-07-15/NetworkBootstrapDevices_ListBySubscription.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_reboot.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_reboot.py new file mode 100644 index 000000000000..e97ba677a238 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_reboot.py @@ -0,0 +1,42 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_bootstrap_devices_reboot.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_bootstrap_devices.begin_reboot( + resource_group_name="example-rg", + network_bootstrap_device_name="example-device", + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkBootstrapDevices_Reboot.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_refresh_configuration.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_refresh_configuration.py new file mode 100644 index 000000000000..7ab0f0d97928 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_refresh_configuration.py @@ -0,0 +1,42 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_bootstrap_devices_refresh_configuration.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_bootstrap_devices.begin_refresh_configuration( + resource_group_name="example-rg", + network_bootstrap_device_name="example-device", + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkBootstrapDevices_RefreshConfiguration.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_resync_passwords.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_resync_passwords.py new file mode 100644 index 000000000000..fe438ac1ae41 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_resync_passwords.py @@ -0,0 +1,42 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_bootstrap_devices_resync_passwords.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_bootstrap_devices.begin_resync_passwords( + resource_group_name="example-rg", + network_bootstrap_device_name="example-device", + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkBootstrapDevices_ResyncPasswords.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_update_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_update.py similarity index 72% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_update_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_update.py index bb3c986196d4..43e63f2ac26c 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_update_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_update.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_devices_update_maximum_set_gen.py + python network_bootstrap_devices_update.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,26 +25,27 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) - response = client.network_devices.begin_update( + response = client.network_bootstrap_devices.begin_update( resource_group_name="example-rg", - network_device_name="example-device", + network_bootstrap_device_name="example-device", body={ + "identity": {"type": "None", "userAssignedIdentities": {"key8793": {}}}, "properties": { "annotation": "annotation", "hostName": "NFA-Device", "serialNumber": "Vendor;DCS-7280XXX-24;12.05;JPE2111XXXX", }, - "tags": {"keyID": "KeyValue"}, + "tags": {}, }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_Update_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkBootstrapDevices_Update.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_update_administrative_state.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_update_administrative_state.py new file mode 100644 index 000000000000..d0714fcb9b31 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_update_administrative_state.py @@ -0,0 +1,49 @@ +# pylint: disable=line-too-long,useless-suppression +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_bootstrap_devices_update_administrative_state.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_bootstrap_devices.begin_update_administrative_state( + resource_group_name="example-rg", + network_bootstrap_device_name="example-device", + body={ + "resourceIds": [ + "/Subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkBootstrapDevices/example-device-1" + ], + "state": "RMA", + }, + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkBootstrapDevices_UpdateAdministrativeState.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_upgrade.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_upgrade.py new file mode 100644 index 000000000000..2284cfac0f59 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_devices_upgrade.py @@ -0,0 +1,43 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_bootstrap_devices_upgrade.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_bootstrap_devices.begin_upgrade( + resource_group_name="example-rg", + network_bootstrap_device_name="example-device", + body={"version": "1.0"}, + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkBootstrapDevices_Upgrade.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_interfaces_create.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_interfaces_create.py new file mode 100644 index 000000000000..4d4f704350df --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_interfaces_create.py @@ -0,0 +1,52 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_bootstrap_interfaces_create.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_bootstrap_interfaces.begin_create( + resource_group_name="example-rg", + network_bootstrap_device_name="example-device", + network_bootstrap_interface_name="example-interface", + body={ + "properties": { + "additionalDescription": "additionalDescription", + "administrativeState": "Enabled", + "annotation": "annotation", + "interfaceType": "Management", + "serialNumber": "Vendor;DCS-7280XXX-24;12.05;JPE2111XXXX", + } + }, + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkBootstrapInterfaces_Create.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_interfaces_delete.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_interfaces_delete.py new file mode 100644 index 000000000000..236dedc64ddc --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_interfaces_delete.py @@ -0,0 +1,42 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_bootstrap_interfaces_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.network_bootstrap_interfaces.begin_delete( + resource_group_name="example-rg", + network_bootstrap_device_name="example-device", + network_bootstrap_interface_name="example-interface", + ).result() + + +# x-ms-original-file: 2025-07-15/NetworkBootstrapInterfaces_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_interfaces_get.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_interfaces_get.py new file mode 100644 index 000000000000..2993141f255d --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_interfaces_get.py @@ -0,0 +1,43 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_bootstrap_interfaces_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_bootstrap_interfaces.get( + resource_group_name="example-rg", + network_bootstrap_device_name="example-device", + network_bootstrap_interface_name="example-interface", + ) + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkBootstrapInterfaces_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_interfaces_list_by_network_bootstrap_device.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_interfaces_list_by_network_bootstrap_device.py new file mode 100644 index 000000000000..80c80e32d422 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_interfaces_list_by_network_bootstrap_device.py @@ -0,0 +1,43 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_bootstrap_interfaces_list_by_network_bootstrap_device.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_bootstrap_interfaces.list_by_network_bootstrap_device( + resource_group_name="example-rg", + network_bootstrap_device_name="example-device", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2025-07-15/NetworkBootstrapInterfaces_ListByNetworkBootstrapDevice.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_interfaces_update.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_interfaces_update.py new file mode 100644 index 000000000000..2dfca5cc28e6 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_interfaces_update.py @@ -0,0 +1,46 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_bootstrap_interfaces_update.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_bootstrap_interfaces.begin_update( + resource_group_name="example-rg", + network_bootstrap_device_name="example-device", + network_bootstrap_interface_name="example-interface", + body={ + "properties": {"annotation": "annotation", "serialNumber": "Vendor;Model;HardwareRevisionId;SerialNumber"} + }, + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkBootstrapInterfaces_Update.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_update_administrative_state_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_interfaces_update_administrative_state.py similarity index 68% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_update_administrative_state_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_interfaces_update_administrative_state.py index f75c088089fe..7fa304a6223c 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_update_administrative_state_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_bootstrap_interfaces_update_administrative_state.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_tap_rules_update_administrative_state_maximum_set_gen.py + python network_bootstrap_interfaces_update_administrative_state.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,19 +25,20 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) - response = client.network_tap_rules.begin_update_administrative_state( + response = client.network_bootstrap_interfaces.begin_update_administrative_state( resource_group_name="example-rg", - network_tap_rule_name="example-tapRule", + network_bootstrap_device_name="example-device", + network_bootstrap_interface_name="example-interface", body={"resourceIds": [""], "state": "Enable"}, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_UpdateAdministrativeState_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkBootstrapInterfaces_UpdateAdministrativeState.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_device_skus_get_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_device_skus_get.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_device_skus_get_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_device_skus_get.py index 9f7b76ead378..636e16f1daca 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_device_skus_get_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_device_skus_get.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_device_skus_get_maximum_set_gen.py + python network_device_skus_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_device_skus.get( @@ -35,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDeviceSkus_Get_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkDeviceSkus_Get.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_device_skus_list_by_subscription_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_device_skus_list_by_subscription.py similarity index 73% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_device_skus_list_by_subscription_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_device_skus_list_by_subscription.py index 5c33c1499ae5..b5b80331a227 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_device_skus_list_by_subscription_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_device_skus_list_by_subscription.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_device_skus_list_by_subscription_maximum_set_gen.py + python network_device_skus_list_by_subscription.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_device_skus.list_by_subscription() @@ -34,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDeviceSkus_ListBySubscription_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkDeviceSkus_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_create.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_create.py new file mode 100644 index 000000000000..284c1014a99e --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_create.py @@ -0,0 +1,65 @@ +# pylint: disable=line-too-long,useless-suppression +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_devices_create.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_devices.begin_create( + resource_group_name="example-rg", + network_device_name="example-device", + body={ + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/example-identity": {} + }, + }, + "location": "eastuseuap", + "properties": { + "administrativeState": "Enabled", + "annotation": "annotation", + "hostName": "NFA-Device", + "identitySelector": { + "identityType": "UserAssignedIdentity", + "userAssignedIdentityResourceId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/example-identity", + }, + "networkDeviceRole": "CE", + "networkDeviceSku": "DeviceSku", + "serialNumber": "Vendor;DCS-7280XXX-24;12.05;JPE2111XXXX", + }, + "tags": {"KeyId": "KeyValue"}, + }, + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkDevices_Create.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_delete_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_delete.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_delete_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_delete.py index 133ccc5f264b..3925db89e237 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_delete_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_delete.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_devices_delete_maximum_set_gen.py + python network_devices_delete.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) client.network_devices.begin_delete( @@ -35,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkDevices_Delete.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_get_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_get.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_get_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_get.py index 8718a782d0ab..578b906ec235 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_get_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_get.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_devices_get_maximum_set_gen.py + python network_devices_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_devices.get( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_Get_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkDevices_Get.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_list_by_resource_group_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_list_by_resource_group.py similarity index 74% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_list_by_resource_group_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_list_by_resource_group.py index 467f2b86bbd6..40b9bef6e7ad 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_list_by_resource_group_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_list_by_resource_group.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_devices_list_by_resource_group_maximum_set_gen.py + python network_devices_list_by_resource_group.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_devices.list_by_resource_group( @@ -36,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_ListByResourceGroup_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkDevices_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_list_by_subscription_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_list_by_subscription.py similarity index 73% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_list_by_subscription_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_list_by_subscription.py index 06c6f3fd1855..602109750878 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_list_by_subscription_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_list_by_subscription.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_devices_list_by_subscription_maximum_set_gen.py + python network_devices_list_by_subscription.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_devices.list_by_subscription() @@ -34,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_ListBySubscription_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkDevices_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_reboot_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_reboot.py similarity index 76% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_reboot_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_reboot.py index a07f44bb125d..b988e283ee16 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_reboot_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_reboot.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_devices_reboot_maximum_set_gen.py + python network_devices_reboot.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_devices.begin_reboot( @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_Reboot_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkDevices_Reboot.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_refresh_configuration_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_refresh_configuration.py similarity index 74% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_refresh_configuration_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_refresh_configuration.py index f173a321db9b..d838aadd121d 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_refresh_configuration_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_refresh_configuration.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_devices_refresh_configuration_maximum_set_gen.py + python network_devices_refresh_configuration.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_devices.begin_refresh_configuration( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_RefreshConfiguration_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkDevices_RefreshConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_resync_certificates.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_resync_certificates.py new file mode 100644 index 000000000000..09e1b7546f86 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_resync_certificates.py @@ -0,0 +1,42 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_devices_resync_certificates.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_devices.begin_resync_certificates( + resource_group_name="example-rg", + network_device_name="example-device", + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkDevices_ResyncCertificates.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_resync_certificates_error.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_resync_certificates_error.py new file mode 100644 index 000000000000..91e634ffa73b --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_resync_certificates_error.py @@ -0,0 +1,42 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_devices_resync_certificates_error.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_devices.begin_resync_certificates( + resource_group_name="example-rg", + network_device_name="example-device", + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkDevices_ResyncCertificates_Error.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_resync_passwords.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_resync_passwords.py new file mode 100644 index 000000000000..f9e6b47945e5 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_resync_passwords.py @@ -0,0 +1,42 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_devices_resync_passwords.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_devices.begin_resync_passwords( + resource_group_name="example-rg", + network_device_name="example-device", + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkDevices_ResyncPasswords.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_resync_passwords_error.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_resync_passwords_error.py new file mode 100644 index 000000000000..5ee9b90fb757 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_resync_passwords_error.py @@ -0,0 +1,42 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_devices_resync_passwords_error.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_devices.begin_resync_passwords( + resource_group_name="example-rg", + network_device_name="example-device", + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkDevices_ResyncPasswords_Error.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_run_ro_command.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_run_ro_command.py new file mode 100644 index 000000000000..37aace2af9b3 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_run_ro_command.py @@ -0,0 +1,43 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_devices_run_ro_command.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_devices.begin_run_ro_command( + resource_group_name="example-rg", + network_device_name="example-device", + body={"command": "show version"}, + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkDevices_RunRoCommand.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_run_rw_command.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_run_rw_command.py new file mode 100644 index 000000000000..5bcd2e51b95f --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_run_rw_command.py @@ -0,0 +1,46 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_devices_run_rw_command.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_devices.begin_run_rw_command( + resource_group_name="example-rg", + network_device_name="example-device", + body={ + "command": "show running-config", + "commandUrl": "https://example.blob.core.windows.net/commands/config.txt", + }, + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkDevices_RunRwCommand.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_update.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_update.py new file mode 100644 index 000000000000..088a115f9331 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_update.py @@ -0,0 +1,61 @@ +# pylint: disable=line-too-long,useless-suppression +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_devices_update.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_devices.begin_update( + resource_group_name="example-rg", + network_device_name="example-device", + body={ + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/example-identity": {} + }, + }, + "properties": { + "annotation": "annotation", + "hostName": "NFA-Device", + "identitySelector": { + "identityType": "UserAssignedIdentity", + "userAssignedIdentityResourceId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/example-identity", + }, + "serialNumber": "Vendor;DCS-7280XXX-24;12.05;JPE2111XXXX", + }, + "tags": {"KeyId": "KeyValue"}, + }, + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkDevices_Update.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_update_administrative_state_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_update_administrative_state.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_update_administrative_state_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_update_administrative_state.py index 19f939dd29c0..38225e3d58cc 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_update_administrative_state_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_update_administrative_state.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_devices_update_administrative_state_maximum_set_gen.py + python network_devices_update_administrative_state.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_devices.begin_update_administrative_state( @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_UpdateAdministrativeState_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkDevices_UpdateAdministrativeState.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_upgrade_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_upgrade.py similarity index 71% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_upgrade_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_upgrade.py index ccc7914b2336..93450c26d8b9 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_upgrade_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_devices_upgrade.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_devices_upgrade_maximum_set_gen.py + python network_devices_upgrade.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,19 +25,19 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_devices.begin_upgrade( - resource_group_name="example-rg", + resource_group_name="rgmanagednetworkfabric", network_device_name="example-device", - body={"version": "1.0.0"}, + body={"rwDeviceConfigUrl": "https://microsoft.com/a", "version": "1.0.0"}, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_Upgrade_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkDevices_Upgrade.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_create_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_create.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_create_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_create.py index 8c0d6d9a7438..b0360f550baa 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_create_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_create.py @@ -1,20 +1,22 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_fabric_controllers_create_maximum_set_gen.py + python network_fabric_controllers_create.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,24 +26,26 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_fabric_controllers.begin_create( resource_group_name="example-rg", network_fabric_controller_name="example-networkController", body={ + "identity": {"type": "None", "userAssignedIdentities": {"key4876": {}}}, "location": "eastus", "properties": { "annotation": "annotation", "infrastructureExpressRouteConnections": [ { - "expressRouteAuthorizationKey": "1234ABCD-0A1B-1234-5678-123456ABCDEF", + "expressRouteAuthorizationKey": "xxx-xxx-xxx", "expressRouteCircuitId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", } ], + "infrastructureServices": {"ipv4AddressSpaces": ["172.253.0.0/19"], "ipv6AddressSpaces": []}, "ipv4AddressSpace": "172.253.0.0/19", "ipv6AddressSpace": "::/60", "isWorkloadManagementNetworkEnabled": "True", @@ -49,16 +53,18 @@ def main(): "nfcSku": "Standard", "workloadExpressRouteConnections": [ { - "expressRouteAuthorizationKey": "xxxxx", + "expressRouteAuthorizationKey": "xxx-xxx-xxx", "expressRouteCircuitId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", } ], + "workloadServices": {"ipv4AddressSpaces": ["172.253.28.0/22"], "ipv6AddressSpaces": []}, }, + "tags": {"keyId": "KeyValue"}, }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricControllers_Create_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkFabricControllers_Create.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_delete_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_delete.py similarity index 74% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_delete_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_delete.py index 96f4566a6837..5c5257f6a65b 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_delete_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_delete.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_fabric_controllers_delete_maximum_set_gen.py + python network_fabric_controllers_delete.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) client.network_fabric_controllers.begin_delete( @@ -35,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricControllers_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkFabricControllers_Delete.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_get_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_get.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_get_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_get.py index 1a0d1e8fb1bb..1e13de6d8597 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_get_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_get.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_fabric_controllers_get_maximum_set_gen.py + python network_fabric_controllers_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_fabric_controllers.get( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricControllers_Get_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkFabricControllers_Get.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_list_by_resource_group_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_list_by_resource_group.py similarity index 73% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_list_by_resource_group_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_list_by_resource_group.py index 8e51268bd24f..089dfd5ace26 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_list_by_resource_group_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_list_by_resource_group.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_fabric_controllers_list_by_resource_group_maximum_set_gen.py + python network_fabric_controllers_list_by_resource_group.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_fabric_controllers.list_by_resource_group( @@ -36,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricControllers_ListByResourceGroup_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkFabricControllers_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_list_by_subscription_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_list_by_subscription.py similarity index 72% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_list_by_subscription_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_list_by_subscription.py index 6a6bd1025e3b..79046a98557f 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_list_by_subscription_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_list_by_subscription.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_fabric_controllers_list_by_subscription_maximum_set_gen.py + python network_fabric_controllers_list_by_subscription.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_fabric_controllers.list_by_subscription() @@ -34,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricControllers_ListBySubscription_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkFabricControllers_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_update_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_update.py similarity index 76% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_update_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_update.py index 0ea51dd27850..d1943f78b020 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_update_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_controllers_update.py @@ -1,20 +1,22 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_fabric_controllers_update_maximum_set_gen.py + python network_fabric_controllers_update.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,34 +26,36 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_fabric_controllers.begin_update( resource_group_name="example-rg", network_fabric_controller_name="example-networkController", body={ + "identity": {"type": "None", "userAssignedIdentities": {"key1402": {}}}, "properties": { "infrastructureExpressRouteConnections": [ { - "expressRouteAuthorizationKey": "xxxxxxx", + "expressRouteAuthorizationKey": "xxx-xxx-xxx", "expressRouteCircuitId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", } ], "workloadExpressRouteConnections": [ { - "expressRouteAuthorizationKey": "xxxxxxx", + "expressRouteAuthorizationKey": "xxx-xxx-xxx", "expressRouteCircuitId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", } ], - } + }, + "tags": {"keyId": "KeyValue"}, }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricControllers_Update_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkFabricControllers_Update.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_skus_get_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_skus_get.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_skus_get_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_skus_get.py index df69d855e24f..b15f9a8141d8 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_skus_get_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_skus_get.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_fabric_skus_get_maximum_set_gen.py + python network_fabric_skus_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_fabric_skus.get( @@ -35,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricSkus_Get_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkFabricSkus_Get.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_skus_list_by_subscription_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_skus_list_by_subscription.py similarity index 73% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_skus_list_by_subscription_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_skus_list_by_subscription.py index f11f6a1e586a..37e8bf447f90 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_skus_list_by_subscription_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabric_skus_list_by_subscription.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_fabric_skus_list_by_subscription_maximum_set_gen.py + python network_fabric_skus_list_by_subscription.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_fabric_skus.list_by_subscription() @@ -34,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricSkus_ListBySubscription_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkFabricSkus_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_arm_configuration_diff.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_arm_configuration_diff.py new file mode 100644 index 000000000000..ba7d4e8b3365 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_arm_configuration_diff.py @@ -0,0 +1,42 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_fabrics_arm_configuration_diff.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_fabrics.begin_arm_configuration_diff( + resource_group_name="example-rg", + network_fabric_name="example-fabric", + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkFabrics_ArmConfigurationDiff.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_commit_batch_status.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_commit_batch_status.py new file mode 100644 index 000000000000..63eea1e538f5 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_commit_batch_status.py @@ -0,0 +1,43 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_fabrics_commit_batch_status.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_fabrics.begin_commit_batch_status( + resource_group_name="example-rg", + network_fabric_name="example-fabric", + body={"commitBatchId": "batch-id"}, + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkFabrics_CommitBatchStatus.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_commit_configuration_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_commit_configuration.py similarity index 72% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_commit_configuration_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_commit_configuration.py index c0a1871b565f..fa46c5602fb6 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_commit_configuration_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_commit_configuration.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_fabrics_commit_configuration_maximum_set_gen.py + python network_fabrics_commit_configuration.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,18 +25,18 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_fabrics.begin_commit_configuration( resource_group_name="example-rg", - network_fabric_name="example-fabric", + network_fabric_name="example-networkFabric", ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_CommitConfiguration_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkFabrics_CommitConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_create_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_create.py similarity index 72% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_create_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_create.py index 1c38e1e37dfa..1418fa4f546a 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_create_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_create.py @@ -1,20 +1,22 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_fabrics_create_maximum_set_gen.py + python network_fabrics_create.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,19 +26,26 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_fabrics.begin_create( resource_group_name="example-rg", network_fabric_name="example-fabric", body={ + "identity": {"type": "None", "userAssignedIdentities": {"key872": {}}}, "location": "eastuseuap", "properties": { "annotation": "annotation", + "authorizedTransceiver": {"key": "example", "vendor": "vendorX"}, + "controlPlaneAcls": [ + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl" + ], "fabricASN": 29249, + "fabricVersion": "version1", + "hardwareAlertThreshold": 74, "ipv4Prefix": "10.18.0.0/19", "ipv6Prefix": "3FFE:FFFF:0:CD40::/59", "managementNetworkConfiguration": { @@ -56,10 +65,10 @@ def main(): "exportRouteTargets": ["65046:10050"], "importRouteTargets": ["65046:10050"], "routeTargets": { - "exportIpv4RouteTargets": ["65046:10039"], - "exportIpv6RouteTargets": ["65046:10039"], - "importIpv4RouteTargets": ["65046:10039"], - "importIpv6RouteTargets": ["65046:10039"], + "exportIpv4RouteTargets": ["65046:10050"], + "exportIpv6RouteTargets": ["65046:10050"], + "importIpv4RouteTargets": ["65046:10050"], + "importIpv6RouteTargets": ["65046:10050"], }, }, "peeringOption": "OptionA", @@ -80,10 +89,10 @@ def main(): "exportRouteTargets": ["65046:10050"], "importRouteTargets": ["65046:10050"], "routeTargets": { - "exportIpv4RouteTargets": ["65046:10039"], - "exportIpv6RouteTargets": ["65046:10039"], - "importIpv4RouteTargets": ["65046:10039"], - "importIpv6RouteTargets": ["65046:10039"], + "exportIpv4RouteTargets": ["65046:10050"], + "exportIpv6RouteTargets": ["65046:10050"], + "importIpv4RouteTargets": ["65046:10050"], + "importIpv6RouteTargets": ["65046:10050"], }, }, "peeringOption": "OptionA", @@ -93,22 +102,37 @@ def main(): "networkFabricSku": "M4-A400-A100-C16-aa", "rackCount": 4, "serverCountPerRack": 8, + "storageAccountConfiguration": { + "storageAccountId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Storage/storageAccounts/nfStorage", + "storageAccountIdentity": { + "identityType": "UserAssignedIdentity", + "userAssignedIdentityResourceId": "/subscriptions/12345678-1234-1234-1234-123456789abc/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-id", + }, + }, + "storageArrayCount": 1, "terminalServerConfiguration": { - "password": "xxxx", + "password": "xxx-xx-xx", "primaryIpv4Prefix": "10.0.0.12/30", "primaryIpv6Prefix": "4FFE:FFFF:0:CD30::a8/127", - "secondaryIpv4Prefix": "20.0.0.13/30", + "secondaryIpv4Prefix": "40.0.0.14/30", "secondaryIpv6Prefix": "6FFE:FFFF:0:CD30::ac/127", "serialNumber": "123456", "username": "username", }, + "trustedIpPrefixes": [ + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-prefix" + ], + "uniqueRdConfiguration": { + "nniDerivedUniqueRdConfigurationState": "Enabled", + "uniqueRdConfigurationState": "Enabled", + }, }, - "tags": {"keyID": "keyValue"}, + "tags": {"keyId": "keyValue"}, }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_Create_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkFabrics_Create.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_delete_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_delete.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_delete_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_delete.py index aec3e447ddc3..a1696288e3c3 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_delete_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_delete.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_fabrics_delete_maximum_set_gen.py + python network_fabrics_delete.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) client.network_fabrics.begin_delete( @@ -35,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkFabrics_Delete.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_deprovision_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_deprovision.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_deprovision_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_deprovision.py index 1ff66325bca9..93e79af72fab 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_deprovision_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_deprovision.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_fabrics_deprovision_maximum_set_gen.py + python network_fabrics_deprovision.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_fabrics.begin_deprovision( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_deprovision_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkFabrics_Deprovision.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_discard_commit_batch.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_discard_commit_batch.py new file mode 100644 index 000000000000..434e39c09c77 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_discard_commit_batch.py @@ -0,0 +1,43 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_fabrics_discard_commit_batch.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_fabrics.begin_discard_commit_batch( + resource_group_name="example-rg", + network_fabric_name="example-fabric", + body={"commitBatchId": "batchId1"}, + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkFabrics_DiscardCommitBatch.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_get_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_get.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_get_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_get.py index 053bfcd649e2..7ba5ef26bfbf 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_get_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_get.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_fabrics_get_maximum_set_gen.py + python network_fabrics_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_fabrics.get( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_Get_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkFabrics_Get.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_get_topology_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_get_topology.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_get_topology_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_get_topology.py index 2f65fa77f17e..879ceb918c7f 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_get_topology_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_get_topology.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_fabrics_get_topology_maximum_set_gen.py + python network_fabrics_get_topology.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_fabrics.begin_get_topology( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_GetTopology_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkFabrics_GetTopology.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_list_by_resource_group_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_list_by_resource_group.py similarity index 74% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_list_by_resource_group_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_list_by_resource_group.py index 40d43893524d..2b72df9f7e89 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_list_by_resource_group_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_list_by_resource_group.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_fabrics_list_by_resource_group_maximum_set_gen.py + python network_fabrics_list_by_resource_group.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_fabrics.list_by_resource_group( @@ -36,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_ListByResourceGroup_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkFabrics_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_list_by_subscription_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_list_by_subscription.py similarity index 73% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_list_by_subscription_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_list_by_subscription.py index 496eddd2f152..5af9cd77a82e 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_list_by_subscription_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_list_by_subscription.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_fabrics_list_by_subscription_maximum_set_gen.py + python network_fabrics_list_by_subscription.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_fabrics.list_by_subscription() @@ -34,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_ListBySubscription_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkFabrics_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_lock_fabric.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_lock_fabric.py new file mode 100644 index 000000000000..3965e5b4e82a --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_lock_fabric.py @@ -0,0 +1,43 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_fabrics_lock_fabric.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_fabrics.begin_lock_fabric( + resource_group_name="example-rg", + network_fabric_name="example-networkFabric", + body={"action": "Lock", "lockType": "Administrative"}, + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkFabrics_LockFabric.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_provision_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_provision.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_provision_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_provision.py index 680a8c9ceeb1..b2becc38bb8f 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_provision_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_provision.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_fabrics_provision_maximum_set_gen.py + python network_fabrics_provision.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_fabrics.begin_provision( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_provision_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkFabrics_Provision.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_refresh_configuration_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_refresh_configuration.py similarity index 74% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_refresh_configuration_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_refresh_configuration.py index 53634263d08f..f936c6878c13 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_refresh_configuration_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_refresh_configuration.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_fabrics_refresh_configuration_maximum_set_gen.py + python network_fabrics_refresh_configuration.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_fabrics.begin_refresh_configuration( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_refreshConfiguration_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkFabrics_RefreshConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_resync_certificates.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_resync_certificates.py new file mode 100644 index 000000000000..4812663d9b52 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_resync_certificates.py @@ -0,0 +1,42 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_fabrics_resync_certificates.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_fabrics.begin_resync_certificates( + resource_group_name="example-rg", + network_fabric_name="example-fabric", + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkFabrics_ResyncCertificates.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_resync_certificates_error.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_resync_certificates_error.py new file mode 100644 index 000000000000..5fcedf181f09 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_resync_certificates_error.py @@ -0,0 +1,42 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_fabrics_resync_certificates_error.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_fabrics.begin_resync_certificates( + resource_group_name="example-rg", + network_fabric_name="example-fabric", + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkFabrics_ResyncCertificates_Error.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_resync_certificates_partial_success.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_resync_certificates_partial_success.py new file mode 100644 index 000000000000..eb27468d66b4 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_resync_certificates_partial_success.py @@ -0,0 +1,42 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_fabrics_resync_certificates_partial_success.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_fabrics.begin_resync_certificates( + resource_group_name="example-rg", + network_fabric_name="example-fabric", + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkFabrics_ResyncCertificates_PartialSuccess.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_resync_passwords.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_resync_passwords.py new file mode 100644 index 000000000000..6519e4d1f4f4 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_resync_passwords.py @@ -0,0 +1,42 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_fabrics_resync_passwords.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_fabrics.begin_resync_passwords( + resource_group_name="example-rg", + network_fabric_name="example-fabric", + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkFabrics_ResyncPasswords.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_resync_passwords_error.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_resync_passwords_error.py new file mode 100644 index 000000000000..9d97d77e062b --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_resync_passwords_error.py @@ -0,0 +1,42 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_fabrics_resync_passwords_error.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_fabrics.begin_resync_passwords( + resource_group_name="example-rg", + network_fabric_name="example-fabric", + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkFabrics_ResyncPasswords_Error.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_resync_passwords_partial_success.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_resync_passwords_partial_success.py new file mode 100644 index 000000000000..1cf08a702677 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_resync_passwords_partial_success.py @@ -0,0 +1,42 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_fabrics_resync_passwords_partial_success.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_fabrics.begin_resync_passwords( + resource_group_name="example-rg", + network_fabric_name="example-fabric", + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkFabrics_ResyncPasswords_PartialSuccess.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_rotate_certificates.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_rotate_certificates.py new file mode 100644 index 000000000000..f0b22009fb98 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_rotate_certificates.py @@ -0,0 +1,42 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_fabrics_rotate_certificates.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_fabrics.begin_rotate_certificates( + resource_group_name="example-rg", + network_fabric_name="example-fabric", + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkFabrics_RotateCertificates.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_rotate_certificates_error.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_rotate_certificates_error.py new file mode 100644 index 000000000000..7acaf047e2a5 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_rotate_certificates_error.py @@ -0,0 +1,42 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_fabrics_rotate_certificates_error.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_fabrics.begin_rotate_certificates( + resource_group_name="example-rg", + network_fabric_name="example-fabric", + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkFabrics_RotateCertificates_Error.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_rotate_certificates_partial_success.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_rotate_certificates_partial_success.py new file mode 100644 index 000000000000..58805967cc7f --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_rotate_certificates_partial_success.py @@ -0,0 +1,42 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_fabrics_rotate_certificates_partial_success.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_fabrics.begin_rotate_certificates( + resource_group_name="example-rg", + network_fabric_name="example-fabric", + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkFabrics_RotateCertificates_PartialSuccess.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_rotate_passwords.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_rotate_passwords.py new file mode 100644 index 000000000000..b46e7732266c --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_rotate_passwords.py @@ -0,0 +1,42 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_fabrics_rotate_passwords.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_fabrics.begin_rotate_passwords( + resource_group_name="example-rg", + network_fabric_name="example-fabric", + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkFabrics_RotatePasswords.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_rotate_passwords_error.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_rotate_passwords_error.py new file mode 100644 index 000000000000..0a688371ec11 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_rotate_passwords_error.py @@ -0,0 +1,42 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_fabrics_rotate_passwords_error.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_fabrics.begin_rotate_passwords( + resource_group_name="example-rg", + network_fabric_name="example-fabric", + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkFabrics_RotatePasswords_Error.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_rotate_passwords_partial_success.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_rotate_passwords_partial_success.py new file mode 100644 index 000000000000..a01b8a419578 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_rotate_passwords_partial_success.py @@ -0,0 +1,42 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_fabrics_rotate_passwords_partial_success.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_fabrics.begin_rotate_passwords( + resource_group_name="example-rg", + network_fabric_name="example-fabric", + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkFabrics_RotatePasswords_PartialSuccess.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_update_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_update.py similarity index 72% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_update_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_update.py index e980b716249d..4faa626c1c54 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_update_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_update.py @@ -1,20 +1,22 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_fabrics_update_maximum_set_gen.py + python network_fabrics_update.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,18 +26,24 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_fabrics.begin_update( resource_group_name="example-rg", network_fabric_name="example-fabric", body={ + "identity": {"type": "None", "userAssignedIdentities": {"key872": {}}}, "properties": { "annotation": "annotation1", + "controlPlaneAcls": [ + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl" + ], "fabricASN": 12345, + "featureFlags": [{"featureFlagName": "uniqueRdConfiguration", "featureFlagValue": "Enabled"}], + "hardwareAlertThreshold": 43, "ipv4Prefix": "10.18.0.0/17", "ipv6Prefix": "3FFE:FFFF:0:CD40::/60", "managementNetworkConfiguration": { @@ -61,12 +69,12 @@ def main(): "importIpv6RouteTargets": ["65046:10050"], }, }, - "peeringOption": "OptionB", + "peeringOption": "OptionA", }, "workloadVpnConfiguration": { "networkToNetworkInterconnectId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni", "optionAProperties": { - "bfdConfiguration": {"intervalInMilliSeconds": 300, "multiplier": 5}, + "bfdConfiguration": {"intervalInMilliSeconds": 300, "multiplier": 10}, "mtu": 1500, "peerASN": 61234, "primaryIpv4Prefix": "10.0.0.14/30", @@ -88,8 +96,16 @@ def main(): "peeringOption": "OptionA", }, }, + "qosConfiguration": {"qosConfigurationState": "Enabled"}, "rackCount": 6, "serverCountPerRack": 10, + "storageAccountConfiguration": { + "storageAccountId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Storage/storageAccounts/nfStorage", + "storageAccountIdentity": { + "identityType": "UserAssignedIdentity", + "userAssignedIdentityResourceId": "/subscriptions/12345678-1234-1234-1234-123456789abc/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-id", + }, + }, "terminalServerConfiguration": { "password": "xxxxxxxx", "primaryIpv4Prefix": "10.0.0.12/30", @@ -99,13 +115,20 @@ def main(): "serialNumber": "1234567", "username": "username1", }, + "trustedIpPrefixes": [ + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-prefix" + ], + "uniqueRdConfiguration": { + "nniDerivedUniqueRdConfigurationState": "Enabled", + "uniqueRdConfigurationState": "Enabled", + }, }, - "tags": {"keyID": "KeyValue"}, + "tags": {"keyId": "keyValue"}, }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_Update_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkFabrics_Update.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_update_infra_management_bfd_configuration_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_update_infra_management_bfd_configuration.py similarity index 77% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_update_infra_management_bfd_configuration_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_update_infra_management_bfd_configuration.py index 58e9cd6c407a..91ab76757ef6 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_update_infra_management_bfd_configuration_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_update_infra_management_bfd_configuration.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_fabrics_update_infra_management_bfd_configuration_maximum_set_gen.py + python network_fabrics_update_infra_management_bfd_configuration.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_fabrics.begin_update_infra_management_bfd_configuration( @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_UpdateInfraManagementBfdConfiguration_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkFabrics_UpdateInfraManagementBfdConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_update_qo_s.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_update_qo_s.py new file mode 100644 index 000000000000..31ebd87285a8 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_update_qo_s.py @@ -0,0 +1,43 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_fabrics_update_qo_s.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_fabrics.begin_update( + resource_group_name="example-rg", + network_fabric_name="example-fabric", + body={"properties": {"qosConfiguration": {"qosConfigurationState": "Enabled"}}}, + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkFabrics_Update_QoS.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_update_workload_management_bfd_configuration_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_update_workload_management_bfd_configuration.py similarity index 77% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_update_workload_management_bfd_configuration_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_update_workload_management_bfd_configuration.py index 5e4dc296c7ff..4190a853baef 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_update_workload_management_bfd_configuration_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_update_workload_management_bfd_configuration.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_fabrics_update_workload_management_bfd_configuration_maximum_set_gen.py + python network_fabrics_update_workload_management_bfd_configuration.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_fabrics.begin_update_workload_management_bfd_configuration( @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_UpdateWorkloadManagementBfdConfiguration_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkFabrics_UpdateWorkloadManagementBfdConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_upgrade_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_upgrade.py similarity index 74% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_upgrade_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_upgrade.py index ca1b5f37ef4a..de78017d35e2 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_upgrade_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_upgrade.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_fabrics_upgrade_maximum_set_gen.py + python network_fabrics_upgrade.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,19 +25,19 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_fabrics.begin_upgrade( resource_group_name="example-rg", network_fabric_name="example-fabric", - body={"version": "version1"}, + body={"action": "Start", "version": "3.x.x"}, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_upgrade_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkFabrics_Upgrade.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_validate_configuration_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_validate_configuration.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_validate_configuration_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_validate_configuration.py index 4e2f61a6190e..72152181a796 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_validate_configuration_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_validate_configuration.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_fabrics_validate_configuration_maximum_set_gen.py + python network_fabrics_validate_configuration.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_fabrics.begin_validate_configuration( @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_ValidateConfiguration_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkFabrics_ValidateConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_view_device_configuration.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_view_device_configuration.py new file mode 100644 index 000000000000..febb8c5b7e85 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_fabrics_view_device_configuration.py @@ -0,0 +1,42 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_fabrics_view_device_configuration.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_fabrics.begin_view_device_configuration( + resource_group_name="example-rg", + network_fabric_name="example-fabric", + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkFabrics_ViewDeviceConfiguration.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_create_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_create.py similarity index 73% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_create_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_create.py index 4424954c9d2e..484b447e7e56 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_create_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_create.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_interfaces_create_maximum_set_gen.py + python network_interfaces_create.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,20 +25,26 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_interfaces.begin_create( resource_group_name="example-rg", network_device_name="example-device", network_interface_name="example-interface", - body={"properties": {"annotation": "annotation"}}, + body={ + "properties": { + "additionalDescription": "device 1", + "annotation": "annotation", + "interfaceType": "Management", + } + }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkInterfaces_Create_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkInterfaces_Create.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_delete.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_delete.py new file mode 100644 index 000000000000..c39d910823d3 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_delete.py @@ -0,0 +1,42 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_interfaces_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.network_interfaces.begin_delete( + resource_group_name="example-rg", + network_device_name="example-device", + network_interface_name="example-interface", + ).result() + + +# x-ms-original-file: 2025-07-15/NetworkInterfaces_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_delete_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_delete_maximum_set_gen.py deleted file mode 100644 index 855e9f59a8ba..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_delete_maximum_set_gen.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-managednetworkfabric -# USAGE - python network_interfaces_delete_maximum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ManagedNetworkFabricMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="94D0FD57-C08B-4CA3-A926-6B76D8B7B956", - ) - - client.network_interfaces.begin_delete( - resource_group_name="rgNetworkDevices", - network_device_name="sjzd", - network_interface_name="emrgu", - ).result() - - -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkInterfaces_Delete_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_get_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_get.py similarity index 76% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_get_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_get.py index cef1d4c687b5..76cf91221761 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_get_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_get.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_interfaces_get_maximum_set_gen.py + python network_interfaces_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_interfaces.get( @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkInterfaces_Get_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkInterfaces_Get.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_list_by_network_device_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_list_by_network_device.py similarity index 74% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_list_by_network_device_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_list_by_network_device.py index bd77197c2c4d..572e48bd2d51 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_list_by_network_device_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_list_by_network_device.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_interfaces_list_by_network_device_maximum_set_gen.py + python network_interfaces_list_by_network_device.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_interfaces.list_by_network_device( @@ -37,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkInterfaces_ListByNetworkDevice_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkInterfaces_ListByNetworkDevice.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_update_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_update.py similarity index 73% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_update_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_update.py index ac5566ebf4cd..9ccff3240160 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_update_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_update.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_interfaces_update_maximum_set_gen.py + python network_interfaces_update.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,20 +25,20 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_interfaces.begin_update( resource_group_name="example-rg", network_device_name="example-device", network_interface_name="example-interface", - body={"properties": {"annotation": "annotation"}}, + body={"properties": {"additionalDescription": "device 1", "annotation": "annotation"}}, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkInterfaces_Update_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkInterfaces_Update.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_update_administrative_state_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_update_administrative_state.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_update_administrative_state_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_update_administrative_state.py index f845a30ac9a5..1c4d87b2dadf 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_update_administrative_state_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_interfaces_update_administrative_state.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_interfaces_update_administrative_state_maximum_set_gen.py + python network_interfaces_update_administrative_state.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_interfaces.begin_update_administrative_state( @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkInterfaces_UpdateAdministrativeState_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkInterfaces_UpdateAdministrativeState.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_monitors_create.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_monitors_create.py new file mode 100644 index 000000000000..37da7f8dd0da --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_monitors_create.py @@ -0,0 +1,67 @@ +# pylint: disable=line-too-long,useless-suppression +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_monitors_create.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_monitors.begin_create( + resource_group_name="example-rg", + network_monitor_name="example-monitor", + body={ + "location": "eastus", + "properties": { + "administrativeState": "Enabled", + "annotation": "annotation", + "bmpConfiguration": { + "exportPolicy": "Pre-Policy", + "exportPolicyConfiguration": {"exportPolicies": ["Pre-Policy"]}, + "monitoredAddressFamilies": ["ipv4Unicast"], + "monitoredNetworks": [ + "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain" + ], + "scopeResourceId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric", + "stationConfigurationState": "Enabled", + "stationConnectionMode": "Active", + "stationConnectionProperties": {"keepaliveIdleTime": 49, "probeCount": 43, "probeInterval": 3558}, + "stationIp": "10.0.0.1", + "stationName": "name", + "stationNetwork": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain/internalNetworks/example-internalnetwork", + "stationPort": 62695, + }, + }, + "tags": {"key": "value"}, + }, + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkMonitors_Create.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_monitors_delete.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_monitors_delete.py new file mode 100644 index 000000000000..b9cc94a131f9 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_monitors_delete.py @@ -0,0 +1,41 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_monitors_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.network_monitors.begin_delete( + resource_group_name="rgmanagednetworkfabric", + network_monitor_name="example-monitor", + ).result() + + +# x-ms-original-file: 2025-07-15/NetworkMonitors_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_monitors_get.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_monitors_get.py new file mode 100644 index 000000000000..8b6480e12152 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_monitors_get.py @@ -0,0 +1,42 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_monitors_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_monitors.get( + resource_group_name="example-rg", + network_monitor_name="example-monitor", + ) + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkMonitors_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_monitors_list_by_resource_group.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_monitors_list_by_resource_group.py new file mode 100644 index 000000000000..f83c92983f5d --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_monitors_list_by_resource_group.py @@ -0,0 +1,42 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_monitors_list_by_resource_group.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_monitors.list_by_resource_group( + resource_group_name="example-rg", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2025-07-15/NetworkMonitors_ListByResourceGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_monitors_list_by_subscription.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_monitors_list_by_subscription.py new file mode 100644 index 000000000000..4f3693121eab --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_monitors_list_by_subscription.py @@ -0,0 +1,40 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_monitors_list_by_subscription.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_monitors.list_by_subscription() + for item in response: + print(item) + + +# x-ms-original-file: 2025-07-15/NetworkMonitors_ListBySubscription.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_monitors_update.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_monitors_update.py new file mode 100644 index 000000000000..86f2196e4244 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_monitors_update.py @@ -0,0 +1,64 @@ +# pylint: disable=line-too-long,useless-suppression +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_monitors_update.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_monitors.begin_update( + resource_group_name="example-rg", + network_monitor_name="example-monitor", + body={ + "properties": { + "bmpConfiguration": { + "exportPolicy": "Pre-Policy", + "exportPolicyConfiguration": {"exportPolicies": ["Pre-Policy"]}, + "monitoredAddressFamilies": ["ipv4Unicast"], + "monitoredNetworks": [ + "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain" + ], + "scopeResourceId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric", + "stationConfigurationState": "Enabled", + "stationConnectionMode": "Active", + "stationConnectionProperties": {"keepaliveIdleTime": 49, "probeCount": 43, "probeInterval": 3558}, + "stationIp": "10.0.0.1", + "stationName": "name", + "stationNetwork": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain/internalNetworks/example-internalnetwork", + "stationPort": 64685, + } + }, + "tags": {"key": "value"}, + }, + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkMonitors_Update.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_monitors_update_administrative_state.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_monitors_update_administrative_state.py new file mode 100644 index 000000000000..5dd121d611a8 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_monitors_update_administrative_state.py @@ -0,0 +1,43 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_monitors_update_administrative_state.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_monitors.begin_update_administrative_state( + resource_group_name="example-rg", + network_monitor_name="example-monitor", + body={"resourceIds": [""], "state": "Enable"}, + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkMonitors_UpdateAdministrativeState.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_create_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_create.py similarity index 77% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_create_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_create.py index 5fd1f5fae6f4..5a2cc8d3862c 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_create_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_create.py @@ -1,20 +1,22 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_packet_brokers_create_maximum_set_gen.py + python network_packet_brokers_create.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,25 +26,26 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_packet_brokers.begin_create( resource_group_name="example-rg", network_packet_broker_name="example-networkPacketBroker", body={ + "identity": {"type": "None", "userAssignedIdentities": {"key3673": {}}}, "location": "eastuseuap", "properties": { "networkFabricId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-networkFabric" }, - "tags": {"key2806": "key"}, + "tags": {"keyId": "keyValue"}, }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkPacketBrokers_Create_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkPacketBrokers_Create.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_delete_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_delete.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_delete_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_delete.py index 6c54d0bf2190..fc54cbcbd9fb 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_delete_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_delete.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_packet_brokers_delete_maximum_set_gen.py + python network_packet_brokers_delete.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) client.network_packet_brokers.begin_delete( @@ -35,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkPacketBrokers_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkPacketBrokers_Delete.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_get_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_get.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_get_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_get.py index de37bd56763b..4ee7528755ab 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_get_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_get.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_packet_brokers_get_maximum_set_gen.py + python network_packet_brokers_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_packet_brokers.get( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkPacketBrokers_Get_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkPacketBrokers_Get.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_list_by_resource_group_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_list_by_resource_group.py similarity index 73% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_list_by_resource_group_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_list_by_resource_group.py index c10c1ee817fa..3f811a27a98e 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_list_by_resource_group_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_list_by_resource_group.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_packet_brokers_list_by_resource_group_maximum_set_gen.py + python network_packet_brokers_list_by_resource_group.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_packet_brokers.list_by_resource_group( @@ -36,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkPacketBrokers_ListByResourceGroup_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkPacketBrokers_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_list_by_subscription_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_list_by_subscription.py similarity index 73% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_list_by_subscription_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_list_by_subscription.py index bf7d372801d6..12770a1ea20e 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_list_by_subscription_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_list_by_subscription.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_packet_brokers_list_by_subscription_maximum_set_gen.py + python network_packet_brokers_list_by_subscription.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_packet_brokers.list_by_subscription() @@ -34,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkPacketBrokers_ListBySubscription_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkPacketBrokers_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_update_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_update.py similarity index 73% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_update_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_update.py index e1b584e32d8d..78a077b1285e 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_update_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_packet_brokers_update.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_packet_brokers_update_maximum_set_gen.py + python network_packet_brokers_update.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,19 +25,19 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_packet_brokers.begin_update( resource_group_name="example-rg", network_packet_broker_name="example-networkPacketBroker", - body={"tags": {"key8772": "1234"}}, + body={"identity": {"type": "None", "userAssignedIdentities": {"key8793": {}}}, "tags": {"keyId": "keyValue"}}, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkPacketBrokers_Update_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkPacketBrokers_Update.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_create_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_create.py similarity index 78% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_create_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_create.py index aad6e0ca4a4a..f2b5dcfda934 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_create_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_create.py @@ -1,20 +1,22 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_racks_create_maximum_set_gen.py + python network_racks_create.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +26,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_racks.begin_create( @@ -39,12 +41,12 @@ def main(): "networkFabricId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-networkFabric", "networkRackType": "Aggregate", }, - "tags": {"keyID": "keyValue"}, + "tags": {"keyId": "keyValue"}, }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkRacks_Create_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkRacks_Create.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_delete_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_delete.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_delete_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_delete.py index d2afe6232339..172a6f62cf6c 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_delete_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_delete.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_racks_delete_maximum_set_gen.py + python network_racks_delete.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) client.network_racks.begin_delete( @@ -35,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkRacks_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkRacks_Delete.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_get_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_get.py similarity index 76% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_get_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_get.py index a6e4dae1964d..0d42acdc3cca 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_get_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_get.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_racks_get_maximum_set_gen.py + python network_racks_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_racks.get( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkRacks_Get_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkRacks_Get.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_list_by_resource_group_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_list_by_resource_group.py similarity index 74% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_list_by_resource_group_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_list_by_resource_group.py index 3e76a2f75242..fdb86a720966 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_list_by_resource_group_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_list_by_resource_group.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_racks_list_by_resource_group_maximum_set_gen.py + python network_racks_list_by_resource_group.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_racks.list_by_resource_group( @@ -36,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkRacks_ListByResourceGroup_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkRacks_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_list_by_subscription_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_list_by_subscription.py similarity index 73% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_list_by_subscription_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_list_by_subscription.py index 84c5f5e9c711..dfa056609876 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_list_by_subscription_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_list_by_subscription.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_racks_list_by_subscription_maximum_set_gen.py + python network_racks_list_by_subscription.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_racks.list_by_subscription() @@ -34,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkRacks_ListBySubscription_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkRacks_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_update_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_update.py similarity index 73% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_update_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_update.py index a07d0ac91e00..a46aac255cb8 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_update_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_racks_update.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_racks_update_maximum_set_gen.py + python network_racks_update.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,19 +25,19 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_racks.begin_update( resource_group_name="example-rg", network_rack_name="example-rack", - body={"tags": {"keyID": "keyValue"}}, + body={"tags": {"keyId": "keyValue"}}, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkRacks_Update_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkRacks_Update.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_create_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_create.py similarity index 71% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_create_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_create.py index 1a01c738274a..45fd04bd43ae 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_create_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_create.py @@ -1,20 +1,22 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_tap_rules_create_maximum_set_gen.py + python network_tap_rules_create.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,31 +26,35 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_tap_rules.begin_create( resource_group_name="example-rg", network_tap_rule_name="example-tapRule", body={ - "location": "eastus", + "identity": {"type": "UserAssigned", "userAssignedIdentities": {"key872": {}}}, + "location": "eastuseuap", "properties": { + "administrativeState": "Enabled", "annotation": "annotation", "configurationType": "File", "dynamicMatchConfigurations": [ { "ipGroups": [ - {"ipAddressType": "IPv4", "ipPrefixes": ["10.10.10.10/30"], "name": "example-ipGroup1"} - ], - "portGroups": [ - {"name": "example-portGroup1", "ports": ["100-200"]}, - {"name": "example-portGroup2", "ports": ["900", "1000-2000"]}, + {"ipAddressType": "IPv4", "ipPrefixes": ["10.20.3.1/20"], "name": "example-ipGroup"} ], - "vlanGroups": [{"name": "exmaple-vlanGroup", "vlans": ["10", "100-200"]}], + "portGroups": [{"name": "example-portGroup", "ports": ["100-200"]}], + "vlanGroups": [{"name": "example-vlanGroup", "vlans": ["20-30"]}], } ], + "globalNetworkTapRuleActions": {"enableCount": "True", "truncate": "truncate-name"}, + "identitySelector": { + "identityType": "UserAssignedIdentity", + "userAssignedIdentityResourceId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/example-identity", + }, "matchConfigurations": [ { "actions": [ @@ -66,7 +72,7 @@ def main(): "encapsulationType": "None", "ipCondition": { "ipGroupNames": ["example-ipGroup"], - "ipPrefixValues": ["10.10.10.10/20"], + "ipPrefixValues": ["10.20.20.20/12"], "prefixType": "Prefix", "type": "SourceIP", }, @@ -78,9 +84,9 @@ def main(): }, "protocolTypes": ["TCP"], "vlanMatchCondition": { - "innerVlans": ["11-20"], - "vlanGroupNames": ["exmaple-vlanGroup"], - "vlans": ["10"], + "innerVlans": ["30"], + "vlanGroupNames": ["example-vlanGroup"], + "vlans": ["20-30"], }, } ], @@ -91,12 +97,12 @@ def main(): "pollingIntervalInSeconds": 30, "tapRulesUrl": "https://microsoft.com/a", }, - "tags": {"keyID": "keyValue"}, + "tags": {"keyId": "keyValue"}, }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_Create_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkTapRules_Create.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_delete_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_delete.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_delete_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_delete.py index 6aef1728047d..5b7fec653277 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_delete_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_delete.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_tap_rules_delete_maximum_set_gen.py + python network_tap_rules_delete.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) client.network_tap_rules.begin_delete( @@ -35,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkTapRules_Delete.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_get_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_get.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_get_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_get.py index 87f58a4fd322..ccf9b91f43bf 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_get_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_get.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_tap_rules_get_maximum_set_gen.py + python network_tap_rules_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_tap_rules.get( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_Get_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkTapRules_Get.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_list_by_resource_group_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_list_by_resource_group.py similarity index 74% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_list_by_resource_group_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_list_by_resource_group.py index 75598d5b31d8..3389ab4c3bf8 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_list_by_resource_group_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_list_by_resource_group.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_tap_rules_list_by_resource_group_maximum_set_gen.py + python network_tap_rules_list_by_resource_group.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_tap_rules.list_by_resource_group( @@ -36,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_ListByResourceGroup_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkTapRules_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_list_by_subscription_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_list_by_subscription.py similarity index 73% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_list_by_subscription_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_list_by_subscription.py index c6acb7d4899f..d7805374a242 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_list_by_subscription_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_list_by_subscription.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_tap_rules_list_by_subscription_maximum_set_gen.py + python network_tap_rules_list_by_subscription.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_tap_rules.list_by_subscription() @@ -34,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_ListBySubscription_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkTapRules_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_resync_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_resync.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_resync_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_resync.py index d4270a396144..84ccc373df91 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_resync_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_resync.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_tap_rules_resync_maximum_set_gen.py + python network_tap_rules_resync.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_tap_rules.begin_resync( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_Resync_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkTapRules_Resync.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_update_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_update.py similarity index 72% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_update_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_update.py index 1e2515ed6b96..fe7fb14f4e9f 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_update_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_update.py @@ -1,20 +1,22 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_tap_rules_update_maximum_set_gen.py + python network_tap_rules_update.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,27 +26,33 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_tap_rules.begin_update( resource_group_name="example-rg", network_tap_rule_name="example-tapRule", body={ + "identity": {"type": "UserAssigned", "userAssignedIdentities": {"key872": {}}}, "properties": { "annotation": "annotation", "configurationType": "File", "dynamicMatchConfigurations": [ { "ipGroups": [ - {"ipAddressType": "IPv4", "ipPrefixes": ["10.10.10.10/30"], "name": "example-ipGroup1"} + {"ipAddressType": "IPv4", "ipPrefixes": ["10.20.3.1/20"], "name": "example-ipGroup"} ], - "portGroups": [{"name": "example-portGroup1", "ports": ["100-200"]}], - "vlanGroups": [{"name": "exmaple-vlanGroup", "vlans": ["10", "100-200"]}], + "portGroups": [{"name": "example-portGroup", "ports": ["100-200"]}], + "vlanGroups": [{"name": "example-vlanGroup", "vlans": ["20-30"]}], } ], + "globalNetworkTapRuleActions": {"enableCount": "True", "truncate": "truncate-name"}, + "identitySelector": { + "identityType": "UserAssignedIdentity", + "userAssignedIdentityResourceId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/example-identity", + }, "matchConfigurations": [ { "actions": [ @@ -53,7 +61,7 @@ def main(): "isTimestampEnabled": "True", "matchConfigurationName": "match1", "truncate": "100", - "type": "Goto", + "type": "Drop", } ], "ipAddressType": "IPv4", @@ -62,7 +70,7 @@ def main(): "encapsulationType": "None", "ipCondition": { "ipGroupNames": ["example-ipGroup"], - "ipPrefixValues": ["10.10.10.10/20"], + "ipPrefixValues": ["10.20.20.20/12"], "prefixType": "Prefix", "type": "SourceIP", }, @@ -74,9 +82,9 @@ def main(): }, "protocolTypes": ["TCP"], "vlanMatchCondition": { - "innerVlans": ["11-20"], - "vlanGroupNames": ["exmaple-vlanGroup"], - "vlans": ["10"], + "innerVlans": ["30"], + "vlanGroupNames": ["example-vlanGroup"], + "vlans": ["20-30"], }, } ], @@ -86,12 +94,12 @@ def main(): ], "tapRulesUrl": "https://microsoft.com/amdsdx", }, - "tags": {"keyID": "keyValue"}, + "tags": {"keyId": "keyValue"}, }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_Update_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkTapRules_Update.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_update_administrative_state.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_update_administrative_state.py new file mode 100644 index 000000000000..17e7dc7f7274 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_update_administrative_state.py @@ -0,0 +1,49 @@ +# pylint: disable=line-too-long,useless-suppression +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_tap_rules_update_administrative_state.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_tap_rules.begin_update_administrative_state( + resource_group_name="example-rg", + network_tap_rule_name="example-tapRule", + body={ + "resourceIds": [ + "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-tapRule" + ], + "state": "Enable", + }, + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkTapRules_UpdateAdministrativeState.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_validate_configuration_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_validate_configuration.py similarity index 74% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_validate_configuration_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_validate_configuration.py index c1e89ed1784e..21d5a5c721b1 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_validate_configuration_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_tap_rules_validate_configuration.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_tap_rules_validate_configuration_maximum_set_gen.py + python network_tap_rules_validate_configuration.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_tap_rules.begin_validate_configuration( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_ValidateConfiguration_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkTapRules_ValidateConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_create_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_create.py similarity index 85% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_create_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_create.py index 47ac85c9377d..e3561bb3d286 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_create_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_create.py @@ -1,20 +1,22 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_taps_create_maximum_set_gen.py + python network_taps_create.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,17 +26,19 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_taps.begin_create( resource_group_name="example-rg", network_tap_name="example-networkTap", body={ + "identity": {"type": "None", "userAssignedIdentities": {"key3673": {}}}, "location": "eastuseuap", "properties": { + "administrativeState": "Enabled", "annotation": "annotation", "destinations": [ { @@ -53,12 +57,12 @@ def main(): "networkPacketBrokerId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/example-networkPacketBroker", "pollingType": "Pull", }, - "tags": {"key6024": "1234"}, + "tags": {"keyId": "keyValue"}, }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_Create_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkTaps_Create.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_delete_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_delete.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_delete_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_delete.py index 5263735845bc..2c7edc21c43c 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_delete_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_delete.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_taps_delete_maximum_set_gen.py + python network_taps_delete.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) client.network_taps.begin_delete( @@ -35,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkTaps_Delete.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_get_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_get.py similarity index 76% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_get_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_get.py index 9c89fa006879..98fd0e3475eb 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_get_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_get.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_taps_get_maximum_set_gen.py + python network_taps_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_taps.get( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_Get_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkTaps_Get.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_list_by_resource_group_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_list_by_resource_group.py similarity index 74% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_list_by_resource_group_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_list_by_resource_group.py index 1146dbf0e123..26560b98b2ea 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_list_by_resource_group_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_list_by_resource_group.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_taps_list_by_resource_group_maximum_set_gen.py + python network_taps_list_by_resource_group.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_taps.list_by_resource_group( @@ -36,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_ListByResourceGroup_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkTaps_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_list_by_subscription_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_list_by_subscription.py similarity index 73% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_list_by_subscription_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_list_by_subscription.py index 59787bd05855..942ab7f5f4e0 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_list_by_subscription_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_list_by_subscription.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_taps_list_by_subscription_maximum_set_gen.py + python network_taps_list_by_subscription.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_taps.list_by_subscription() @@ -34,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_ListBySubscription_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkTaps_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_resync_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_resync.py similarity index 76% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_resync_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_resync.py index d134909e14fb..8484315139c9 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_resync_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_resync.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_taps_resync_maximum_set_gen.py + python network_taps_resync.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_taps.begin_resync( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_Resync_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkTaps_Resync.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_update_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_update.py similarity index 84% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_update_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_update.py index 06fc9bdeed57..65e5074c2998 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_update_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_update.py @@ -1,20 +1,22 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_taps_update_maximum_set_gen.py + python network_taps_update.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,15 +26,16 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_taps.begin_update( resource_group_name="example-rg", network_tap_name="example-networkTap", body={ + "identity": {"type": "None", "userAssignedIdentities": {"key8793": {}}}, "properties": { "annotation": "annotation1", "destinations": [ @@ -51,12 +54,12 @@ def main(): ], "pollingType": "Pull", }, - "tags": {"key6024": "1234"}, + "tags": {"keyId": "keyValue"}, }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_Update_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkTaps_Update.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_update_administrative_state_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_update_administrative_state.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_update_administrative_state_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_update_administrative_state.py index b2d58892f038..635c82db34a4 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_update_administrative_state_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_taps_update_administrative_state.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_taps_update_administrative_state_maximum_set_gen.py + python network_taps_update_administrative_state.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_taps.begin_update_administrative_state( @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_UpdateAdministrativeState_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkTaps_UpdateAdministrativeState.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_create_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_create.py similarity index 72% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_create_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_create.py index 045bb36b4d51..e7ae5cd67255 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_create_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_create.py @@ -1,20 +1,22 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_to_network_interconnects_create_maximum_set_gen.py + python network_to_network_interconnects_create.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,17 +26,21 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_to_network_interconnects.begin_create( resource_group_name="example-rg", - network_fabric_name="example-fabric", + network_fabric_name="example-nf", network_to_network_interconnect_name="example-nni", body={ "properties": { + "conditionalDefaultRouteConfiguration": { + "ipv4Routes": [{"nextHop": ["10.0.0.1"], "prefix": "10.0.0.1/24"}], + "ipv6Routes": [{"nextHop": ["fe01::1"], "prefix": "fe08:00/64"}], + }, "egressAclId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl", "exportRoutePolicy": { "exportIpv4RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy", @@ -52,20 +58,29 @@ def main(): ], "mtu": 1500, }, + "microBfdState": "Enabled", "nniType": "CE", "npbStaticRouteConfiguration": { - "bfdConfiguration": {"intervalInMilliSeconds": 300, "multiplier": 25}, - "ipv4Routes": [{"nextHop": ["21.20.20.20"], "prefix": "20.0.0.12/30"}], - "ipv6Routes": [{"nextHop": ["4FFE:FFFF:0:CD30::ac"], "prefix": "3FFE:FFFF:0:CD30::ac/127"}], + "bfdConfiguration": {"intervalInMilliSeconds": 300, "multiplier": 10}, + "ipv4Routes": [{"nextHop": ["10.0.0.1"], "prefix": "jffgck"}], + "ipv6Routes": [{"nextHop": ["10.0.0.1"], "prefix": "jffgck"}], }, "optionBLayer3Configuration": { + "bmpConfiguration": {"configurationState": "Enabled"}, + "peLoopbackIpAddress": ["10.0.0.1"], "peerASN": 61234, + "prefixLimits": [{"maximumRoutes": 24}], "primaryIpv4Prefix": "10.0.0.12/30", "primaryIpv6Prefix": "4FFE:FFFF:0:CD30::a8/127", "secondaryIpv4Prefix": "40.0.0.14/30", "secondaryIpv6Prefix": "6FFE:FFFF:0:CD30::ac/127", "vlanId": 1234, }, + "staticRouteConfiguration": { + "bfdConfiguration": {"intervalInMilliSeconds": 300, "multiplier": 10}, + "ipv4Routes": [{"nextHop": ["10.0.0.1"], "prefix": "jffgck"}], + "ipv6Routes": [{"nextHop": ["3ffe::1"], "prefix": "2fff::/64"}], + }, "useOptionB": "True", } }, @@ -73,6 +88,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_Create_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkToNetworkInterconnects_Create.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_delete_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_delete.py similarity index 72% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_delete_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_delete.py index 6b243dc9e231..186dd7e92e05 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_delete_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_delete.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_to_network_interconnects_delete_maximum_set_gen.py + python network_to_network_interconnects_delete.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,18 +25,18 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) client.network_to_network_interconnects.begin_delete( resource_group_name="example-rg", - network_fabric_name="example-fabric", + network_fabric_name="example-nf", network_to_network_interconnect_name="example-nni", ).result() -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkToNetworkInterconnects_Delete.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_get_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_get.py similarity index 72% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_get_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_get.py index 0e3f6a737b8a..20a7b1460f51 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_get_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_get.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_to_network_interconnects_get_maximum_set_gen.py + python network_to_network_interconnects_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,19 +25,19 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_to_network_interconnects.get( resource_group_name="example-rg", - network_fabric_name="example-fabric", + network_fabric_name="example-nf", network_to_network_interconnect_name="example-nni", ) print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_Get_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkToNetworkInterconnects_Get.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_list_by_network_fabric_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_list_by_network_fabric.py similarity index 74% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_list_by_network_fabric_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_list_by_network_fabric.py index 1120b04fd593..177169835761 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_list_by_network_fabric_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_list_by_network_fabric.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_to_network_interconnects_list_by_network_fabric_maximum_set_gen.py + python network_to_network_interconnects_list_by_network_fabric.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,19 +25,19 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_to_network_interconnects.list_by_network_fabric( resource_group_name="example-rg", - network_fabric_name="example-fabric", + network_fabric_name="example-nf", ) for item in response: print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_ListByNetworkFabric_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkToNetworkInterconnects_ListByNetworkFabric.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_update_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_update.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_update_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_update.py index f9ca0e814a1e..2ff094a8ed06 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_update_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_update.py @@ -1,20 +1,22 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_to_network_interconnects_update_maximum_set_gen.py + python network_to_network_interconnects_update.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,25 +26,25 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_to_network_interconnects.begin_update( resource_group_name="example-rg", - network_fabric_name="example-fabric", + network_fabric_name="example-nf", network_to_network_interconnect_name="example-nni", body={ "properties": { "egressAclId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl", "exportRoutePolicy": { - "exportIpv4RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy1", - "exportIpv6RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy1", + "exportIpv4RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy", + "exportIpv6RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy", }, "importRoutePolicy": { - "importIpv4RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy1", - "importIpv6RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy1", + "importIpv4RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy", + "importIpv6RoutePolicyId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy", }, "ingressAclId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl", "layer2Configuration": { @@ -51,25 +53,34 @@ def main(): ], "mtu": 1500, }, + "microBfdState": "Enabled", "npbStaticRouteConfiguration": { - "bfdConfiguration": {"intervalInMilliSeconds": 310, "multiplier": 15}, - "ipv4Routes": [{"nextHop": ["21.20.20.10"], "prefix": "20.0.0.11/30"}], - "ipv6Routes": [{"nextHop": ["5FFE:FFFF:0:CD30::ac"], "prefix": "4FFE:FFFF:0:CD30::ac/127"}], + "bfdConfiguration": {"intervalInMilliSeconds": 300, "multiplier": 10}, + "ipv4Routes": [{"nextHop": ["10.0.0.1"], "prefix": "10.0.0.1/24"}], + "ipv6Routes": [{"nextHop": ["fe80::1"], "prefix": "fe80::/64"}], }, "optionBLayer3Configuration": { + "bmpConfiguration": {"configurationState": "Enabled"}, + "peLoopbackIpAddress": ["10.0.0.1"], "peerASN": 2345, + "prefixLimits": [{"maximumRoutes": 1}], "primaryIpv4Prefix": "20.0.0.12/29", "primaryIpv6Prefix": "4FFE:FFFF:0:CD30::a8/127", "secondaryIpv4Prefix": "20.0.0.14/29", "secondaryIpv6Prefix": "6FFE:FFFF:0:CD30::ac/127", "vlanId": 1235, }, + "staticRouteConfiguration": { + "bfdConfiguration": {"intervalInMilliSeconds": 300, "multiplier": 10}, + "ipv4Routes": [{"nextHop": ["10.0.0.1"], "prefix": "10.0.0.1"}], + "ipv6Routes": [{"nextHop": ["3ffe::1"], "prefix": "2fff::/64"}], + }, } }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_Update_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkToNetworkInterconnects_Update.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_update_administrative_state.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_update_administrative_state.py new file mode 100644 index 000000000000..7efd2ea643a0 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_update_administrative_state.py @@ -0,0 +1,50 @@ +# pylint: disable=line-too-long,useless-suppression +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-managednetworkfabric +# USAGE + python network_to_network_interconnects_update_administrative_state.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedNetworkFabricClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.network_to_network_interconnects.begin_update_administrative_state( + resource_group_name="example-rg", + network_fabric_name="example-nf", + network_to_network_interconnect_name="example-nni", + body={ + "resourceIds": [ + "/subscriptions/0000ABCD-0A0B-0000-0000-000000ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-nf/networkToNetworkInterconnects/example-nni" + ], + "state": "Enable", + }, + ).result() + print(response) + + +# x-ms-original-file: 2025-07-15/NetworkToNetworkInterconnects_UpdateAdministrativeState.json +if __name__ == "__main__": + main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_update_administrative_state_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_update_bfd_administrative_state.py similarity index 68% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_update_administrative_state_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_update_bfd_administrative_state.py index 1834d0385c60..b260d27c374c 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_update_administrative_state_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_update_bfd_administrative_state.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_to_network_interconnects_update_administrative_state_maximum_set_gen.py + python network_to_network_interconnects_update_bfd_administrative_state.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,20 +25,20 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) - response = client.network_to_network_interconnects.begin_update_administrative_state( + response = client.network_to_network_interconnects.begin_update_bfd_administrative_state( resource_group_name="example-rg", - network_fabric_name="example-fabric", + network_fabric_name="example-nf", network_to_network_interconnect_name="example-nni", - body={"resourceIds": [""], "state": "Enable"}, + body={"administrativeState": "Enable", "routeType": "Static"}, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_updateAdministrativeState_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkToNetworkInterconnects_UpdateBfdAdministrativeState.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_update_npb_static_route_bfd_administrative_state_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_update_npb_static_route_bfd_administrative_state.py similarity index 77% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_update_npb_static_route_bfd_administrative_state_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_update_npb_static_route_bfd_administrative_state.py index af48e496156d..e6d4deb681ed 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_update_npb_static_route_bfd_administrative_state_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/network_to_network_interconnects_update_npb_static_route_bfd_administrative_state.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python network_to_network_interconnects_update_npb_static_route_bfd_administrative_state_maximum_set_gen.py + python network_to_network_interconnects_update_npb_static_route_bfd_administrative_state.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_to_network_interconnects.begin_update_npb_static_route_bfd_administrative_state( @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_updateNpbStaticRouteBfdAdministrativeState_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/NetworkToNetworkInterconnects_UpdateNpbStaticRouteBfdAdministrativeState.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/list_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/operations_list.py similarity index 80% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/list_operations.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/operations_list.py index 4a4eb9120ae2..73e2f8364bb5 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/list_operations.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/operations_list.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python list_operations.py + python operations_list.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,7 +25,7 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), subscription_id="SUBSCRIPTION_ID", ) @@ -34,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ListOperations.json +# x-ms-original-file: 2025-07-15/Operations_List.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_commit_configuration_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_commit_configuration.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_commit_configuration_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_commit_configuration.py index 132d2fb76ca2..e609c78ccf1b 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_commit_configuration_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_commit_configuration.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python route_policies_commit_configuration_maximum_set_gen.py + python route_policies_commit_configuration.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.route_policies.begin_commit_configuration( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_CommitConfiguration_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/RoutePolicies_CommitConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_create_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_create.py similarity index 92% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_create_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_create.py index dec316882edf..301c475939c3 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_create_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_create.py @@ -1,20 +1,22 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python route_policies_create_maximum_set_gen.py + python route_policies_create.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +26,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.route_policies.begin_create( @@ -36,7 +38,9 @@ def main(): "location": "eastus", "properties": { "addressFamilyType": "IPv4", + "administrativeState": "Enabled", "annotation": "annotation", + "defaultAction": "Permit", "networkFabricId": "/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric", "statements": [ { @@ -93,12 +97,12 @@ def main(): } ], }, - "tags": {"keyID": "keyValue"}, + "tags": {"keyId": "keyValue"}, }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_Create_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/RoutePolicies_Create.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_delete_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_delete.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_delete_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_delete.py index e3b4ba7b75fa..911e778de17a 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_delete_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_delete.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python route_policies_delete_maximum_set_gen.py + python route_policies_delete.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) client.route_policies.begin_delete( @@ -35,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/RoutePolicies_Delete.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_get_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_get.py similarity index 76% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_get_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_get.py index 122f18c46451..0f330fb51af3 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_get_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_get.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python route_policies_get_maximum_set_gen.py + python route_policies_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.route_policies.get( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_Get_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/RoutePolicies_Get.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_list_by_resource_group_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_list_by_resource_group.py similarity index 74% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_list_by_resource_group_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_list_by_resource_group.py index f27a37bdd1e4..0f24018f79e8 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_list_by_resource_group_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_list_by_resource_group.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python route_policies_list_by_resource_group_maximum_set_gen.py + python route_policies_list_by_resource_group.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.route_policies.list_by_resource_group( @@ -36,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_ListByResourceGroup_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/RoutePolicies_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_list_by_subscription_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_list_by_subscription.py similarity index 73% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_list_by_subscription_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_list_by_subscription.py index 1a2225a26e6d..9a0b4bb16489 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_list_by_subscription_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_list_by_subscription.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python route_policies_list_by_subscription_maximum_set_gen.py + python route_policies_list_by_subscription.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.route_policies.list_by_subscription() @@ -34,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_ListBySubscription_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/RoutePolicies_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_update_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_update.py similarity index 91% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_update_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_update.py index 628956f07c86..7dd83a6ff1d9 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_update_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_update.py @@ -1,20 +1,22 @@ +# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python route_policies_update_maximum_set_gen.py + python route_policies_update.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +26,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.route_policies.begin_update( @@ -34,6 +36,7 @@ def main(): route_policy_name="example-routePolicy", body={ "properties": { + "defaultAction": "Permit", "statements": [ { "action": { @@ -87,14 +90,14 @@ def main(): }, "sequenceNumber": 7, } - ] + ], }, - "tags": {"keyID": "keyValue"}, + "tags": {"keyId": "keyValue"}, }, ).result() print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_Update_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/RoutePolicies_Update.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_update_administrative_state_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_update_administrative_state.py similarity index 75% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_update_administrative_state_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_update_administrative_state.py index 8b58cde0f1d4..c9cfe276e729 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_update_administrative_state_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_update_administrative_state.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python route_policies_update_administrative_state_maximum_set_gen.py + python route_policies_update_administrative_state.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.route_policies.begin_update_administrative_state( @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_UpdateAdministrativeState_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/RoutePolicies_UpdateAdministrativeState.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_validate_configuration_maximum_set_gen.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_validate_configuration.py similarity index 74% rename from sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_validate_configuration_maximum_set_gen.py rename to sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_validate_configuration.py index 2b4e95c2830a..e218a84c8f77 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_validate_configuration_maximum_set_gen.py +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_samples/route_policies_validate_configuration.py @@ -2,19 +2,20 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.managednetworkfabric import ManagedNetworkFabricMgmtClient + +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-managednetworkfabric # USAGE - python route_policies_validate_configuration_maximum_set_gen.py + python route_policies_validate_configuration.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -24,9 +25,9 @@ def main(): - client = ManagedNetworkFabricMgmtClient( + client = ManagedNetworkFabricClient( credential=DefaultAzureCredential(), - subscription_id="1234ABCD-0A1B-1234-5678-123456ABCDEF", + subscription_id="SUBSCRIPTION_ID", ) response = client.route_policies.begin_validate_configuration( @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_ValidateConfiguration_MaximumSet_Gen.json +# x-ms-original-file: 2025-07-15/RoutePolicies_ValidateConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/conftest.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/conftest.py new file mode 100644 index 000000000000..6a1c23dd2236 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/conftest.py @@ -0,0 +1,39 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import os +import pytest +from dotenv import load_dotenv +from devtools_testutils import ( + test_proxy, + add_general_regex_sanitizer, + add_body_key_sanitizer, + add_header_regex_sanitizer, +) + +load_dotenv() + + +# For security, please avoid record sensitive identity information in recordings +@pytest.fixture(scope="session", autouse=True) +def add_sanitizers(test_proxy): + managednetworkfabric_subscription_id = os.environ.get( + "AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000" + ) + managednetworkfabric_tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000") + managednetworkfabric_client_id = os.environ.get("AZURE_CLIENT_ID", "00000000-0000-0000-0000-000000000000") + managednetworkfabric_client_secret = os.environ.get("AZURE_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer( + regex=managednetworkfabric_subscription_id, value="00000000-0000-0000-0000-000000000000" + ) + add_general_regex_sanitizer(regex=managednetworkfabric_tenant_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=managednetworkfabric_client_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=managednetworkfabric_client_secret, value="00000000-0000-0000-0000-000000000000") + + add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]") + add_header_regex_sanitizer(key="Cookie", value="cookie;") + add_body_key_sanitizer(json_path="$..access_token", value="access_token") diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_access_control_lists_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_access_control_lists_operations.py new file mode 100644 index 000000000000..474bfdb2adca --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_access_control_lists_operations.py @@ -0,0 +1,313 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricAccessControlListsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_access_control_lists_get(self, resource_group): + response = self.client.access_control_lists.get( + resource_group_name=resource_group.name, + access_control_list_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_access_control_lists_begin_create(self, resource_group): + response = self.client.access_control_lists.begin_create( + resource_group_name=resource_group.name, + access_control_list_name="str", + body={ + "location": "str", + "properties": { + "configurationType": "str", + "aclType": "str", + "aclsUrl": "str", + "administrativeState": "str", + "annotation": "str", + "configurationState": "str", + "controlPlaneAclConfiguration": [ + { + "ipAddressType": "str", + "matchConfigurations": [ + { + "action": {"remarkComment": "str", "type": "str"}, + "matchCondition": { + "flags": ["str"], + "icmpConfiguration": {"icmpTypes": ["str"]}, + "ipCondition": {"destinationIpPrefix": "str", "sourceIpPrefix": "str"}, + "portCondition": { + "destinationPorts": {"portMatchType": "str", "ports": ["str"]}, + "sourcePorts": {"portMatchType": "str", "ports": ["str"]}, + }, + "protocolTypes": "str", + "ttlMatchCondition": {"ttlMatchType": "str", "ttlValue": "str"}, + }, + "matchConfigurationName": "str", + "sequenceNumber": 0, + } + ], + } + ], + "defaultAction": "str", + "deviceRole": "str", + "dynamicMatchConfigurations": [ + { + "ipGroups": [{"ipAddressType": "str", "ipPrefixes": ["str"], "name": "str"}], + "portGroups": [{"name": "str", "ports": ["str"]}], + "vlanGroups": [{"name": "str", "vlans": ["str"]}], + } + ], + "globalAccessControlListActions": {"enableCount": "str"}, + "lastOperation": {"details": "str"}, + "lastSyncedTime": "2020-02-20 00:00:00", + "matchConfigurations": [ + { + "actions": [ + { + "counterName": "str", + "policeRateConfiguration": { + "bitRate": {"rate": 0, "unit": "str"}, + "burstSize": {"size": 0, "unit": "str"}, + }, + "remarkComment": "str", + "type": "str", + } + ], + "ipAddressType": "str", + "matchConditions": [ + { + "dscpMarkings": ["str"], + "etherTypes": ["str"], + "fragments": ["str"], + "icmpConfiguration": {"icmpTypes": ["str"]}, + "ipCondition": { + "ipGroupNames": ["str"], + "ipPrefixValues": ["str"], + "prefixType": "str", + "type": "str", + }, + "ipLengths": ["str"], + "portCondition": { + "layer4Protocol": "str", + "flags": ["str"], + "portGroupNames": ["str"], + "portType": "str", + "ports": ["str"], + }, + "protocolNeighbors": ["str"], + "protocolTypes": ["str"], + "ttlValues": ["str"], + "vlanMatchCondition": { + "innerVlans": ["str"], + "vlanGroupNames": ["str"], + "vlans": ["str"], + }, + } + ], + "matchConfigurationName": "str", + "sequenceNumber": 0, + } + ], + "networkFabricIds": ["str"], + "provisioningState": "str", + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_access_control_lists_begin_update(self, resource_group): + response = self.client.access_control_lists.begin_update( + resource_group_name=resource_group.name, + access_control_list_name="str", + body={ + "properties": { + "aclType": "str", + "aclsUrl": "str", + "annotation": "str", + "configurationType": "str", + "controlPlaneAclConfiguration": [ + { + "ipAddressType": "str", + "matchConfigurations": [ + { + "action": {"remarkComment": "str", "type": "str"}, + "matchCondition": { + "flags": ["str"], + "icmpConfiguration": {"icmpTypes": ["str"]}, + "ipCondition": {"destinationIpPrefix": "str", "sourceIpPrefix": "str"}, + "portCondition": { + "destinationPorts": {"portMatchType": "str", "ports": ["str"]}, + "sourcePorts": {"portMatchType": "str", "ports": ["str"]}, + }, + "protocolTypes": "str", + "ttlMatchCondition": {"ttlMatchType": "str", "ttlValue": "str"}, + }, + "matchConfigurationName": "str", + "sequenceNumber": 0, + } + ], + } + ], + "defaultAction": "str", + "deviceRole": "str", + "dynamicMatchConfigurations": [ + { + "ipGroups": [{"ipAddressType": "str", "ipPrefixes": ["str"], "name": "str"}], + "portGroups": [{"name": "str", "ports": ["str"]}], + "vlanGroups": [{"name": "str", "vlans": ["str"]}], + } + ], + "globalAccessControlListActions": {"enableCount": "str"}, + "matchConfigurations": [ + { + "actions": [ + { + "counterName": "str", + "policeRateConfiguration": { + "bitRate": {"rate": 0, "unit": "str"}, + "burstSize": {"size": 0, "unit": "str"}, + }, + "remarkComment": "str", + "type": "str", + } + ], + "ipAddressType": "str", + "matchConditions": [ + { + "dscpMarkings": ["str"], + "etherTypes": ["str"], + "fragments": ["str"], + "icmpConfiguration": {"icmpTypes": ["str"]}, + "ipCondition": { + "ipGroupNames": ["str"], + "ipPrefixValues": ["str"], + "prefixType": "str", + "type": "str", + }, + "ipLengths": ["str"], + "portCondition": { + "flags": ["str"], + "layer4Protocol": "str", + "portGroupNames": ["str"], + "portType": "str", + "ports": ["str"], + }, + "protocolNeighbors": ["str"], + "protocolTypes": ["str"], + "ttlValues": ["str"], + "vlanMatchCondition": { + "innerVlans": ["str"], + "vlanGroupNames": ["str"], + "vlans": ["str"], + }, + } + ], + "matchConfigurationName": "str", + "sequenceNumber": 0, + } + ], + }, + "tags": {"str": "str"}, + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_access_control_lists_begin_delete(self, resource_group): + response = self.client.access_control_lists.begin_delete( + resource_group_name=resource_group.name, + access_control_list_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_access_control_lists_list_by_resource_group(self, resource_group): + response = self.client.access_control_lists.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_access_control_lists_list_by_subscription(self, resource_group): + response = self.client.access_control_lists.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_access_control_lists_begin_update_administrative_state(self, resource_group): + response = self.client.access_control_lists.begin_update_administrative_state( + resource_group_name=resource_group.name, + access_control_list_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_access_control_lists_begin_resync(self, resource_group): + response = self.client.access_control_lists.begin_resync( + resource_group_name=resource_group.name, + access_control_list_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_access_control_lists_begin_validate_configuration(self, resource_group): + response = self.client.access_control_lists.begin_validate_configuration( + resource_group_name=resource_group.name, + access_control_list_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_access_control_lists_operations_async.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_access_control_lists_operations_async.py new file mode 100644 index 000000000000..475078304430 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_access_control_lists_operations_async.py @@ -0,0 +1,326 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric.aio import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricAccessControlListsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_access_control_lists_get(self, resource_group): + response = await self.client.access_control_lists.get( + resource_group_name=resource_group.name, + access_control_list_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_access_control_lists_begin_create(self, resource_group): + response = await ( + await self.client.access_control_lists.begin_create( + resource_group_name=resource_group.name, + access_control_list_name="str", + body={ + "location": "str", + "properties": { + "configurationType": "str", + "aclType": "str", + "aclsUrl": "str", + "administrativeState": "str", + "annotation": "str", + "configurationState": "str", + "controlPlaneAclConfiguration": [ + { + "ipAddressType": "str", + "matchConfigurations": [ + { + "action": {"remarkComment": "str", "type": "str"}, + "matchCondition": { + "flags": ["str"], + "icmpConfiguration": {"icmpTypes": ["str"]}, + "ipCondition": {"destinationIpPrefix": "str", "sourceIpPrefix": "str"}, + "portCondition": { + "destinationPorts": {"portMatchType": "str", "ports": ["str"]}, + "sourcePorts": {"portMatchType": "str", "ports": ["str"]}, + }, + "protocolTypes": "str", + "ttlMatchCondition": {"ttlMatchType": "str", "ttlValue": "str"}, + }, + "matchConfigurationName": "str", + "sequenceNumber": 0, + } + ], + } + ], + "defaultAction": "str", + "deviceRole": "str", + "dynamicMatchConfigurations": [ + { + "ipGroups": [{"ipAddressType": "str", "ipPrefixes": ["str"], "name": "str"}], + "portGroups": [{"name": "str", "ports": ["str"]}], + "vlanGroups": [{"name": "str", "vlans": ["str"]}], + } + ], + "globalAccessControlListActions": {"enableCount": "str"}, + "lastOperation": {"details": "str"}, + "lastSyncedTime": "2020-02-20 00:00:00", + "matchConfigurations": [ + { + "actions": [ + { + "counterName": "str", + "policeRateConfiguration": { + "bitRate": {"rate": 0, "unit": "str"}, + "burstSize": {"size": 0, "unit": "str"}, + }, + "remarkComment": "str", + "type": "str", + } + ], + "ipAddressType": "str", + "matchConditions": [ + { + "dscpMarkings": ["str"], + "etherTypes": ["str"], + "fragments": ["str"], + "icmpConfiguration": {"icmpTypes": ["str"]}, + "ipCondition": { + "ipGroupNames": ["str"], + "ipPrefixValues": ["str"], + "prefixType": "str", + "type": "str", + }, + "ipLengths": ["str"], + "portCondition": { + "layer4Protocol": "str", + "flags": ["str"], + "portGroupNames": ["str"], + "portType": "str", + "ports": ["str"], + }, + "protocolNeighbors": ["str"], + "protocolTypes": ["str"], + "ttlValues": ["str"], + "vlanMatchCondition": { + "innerVlans": ["str"], + "vlanGroupNames": ["str"], + "vlans": ["str"], + }, + } + ], + "matchConfigurationName": "str", + "sequenceNumber": 0, + } + ], + "networkFabricIds": ["str"], + "provisioningState": "str", + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_access_control_lists_begin_update(self, resource_group): + response = await ( + await self.client.access_control_lists.begin_update( + resource_group_name=resource_group.name, + access_control_list_name="str", + body={ + "properties": { + "aclType": "str", + "aclsUrl": "str", + "annotation": "str", + "configurationType": "str", + "controlPlaneAclConfiguration": [ + { + "ipAddressType": "str", + "matchConfigurations": [ + { + "action": {"remarkComment": "str", "type": "str"}, + "matchCondition": { + "flags": ["str"], + "icmpConfiguration": {"icmpTypes": ["str"]}, + "ipCondition": {"destinationIpPrefix": "str", "sourceIpPrefix": "str"}, + "portCondition": { + "destinationPorts": {"portMatchType": "str", "ports": ["str"]}, + "sourcePorts": {"portMatchType": "str", "ports": ["str"]}, + }, + "protocolTypes": "str", + "ttlMatchCondition": {"ttlMatchType": "str", "ttlValue": "str"}, + }, + "matchConfigurationName": "str", + "sequenceNumber": 0, + } + ], + } + ], + "defaultAction": "str", + "deviceRole": "str", + "dynamicMatchConfigurations": [ + { + "ipGroups": [{"ipAddressType": "str", "ipPrefixes": ["str"], "name": "str"}], + "portGroups": [{"name": "str", "ports": ["str"]}], + "vlanGroups": [{"name": "str", "vlans": ["str"]}], + } + ], + "globalAccessControlListActions": {"enableCount": "str"}, + "matchConfigurations": [ + { + "actions": [ + { + "counterName": "str", + "policeRateConfiguration": { + "bitRate": {"rate": 0, "unit": "str"}, + "burstSize": {"size": 0, "unit": "str"}, + }, + "remarkComment": "str", + "type": "str", + } + ], + "ipAddressType": "str", + "matchConditions": [ + { + "dscpMarkings": ["str"], + "etherTypes": ["str"], + "fragments": ["str"], + "icmpConfiguration": {"icmpTypes": ["str"]}, + "ipCondition": { + "ipGroupNames": ["str"], + "ipPrefixValues": ["str"], + "prefixType": "str", + "type": "str", + }, + "ipLengths": ["str"], + "portCondition": { + "flags": ["str"], + "layer4Protocol": "str", + "portGroupNames": ["str"], + "portType": "str", + "ports": ["str"], + }, + "protocolNeighbors": ["str"], + "protocolTypes": ["str"], + "ttlValues": ["str"], + "vlanMatchCondition": { + "innerVlans": ["str"], + "vlanGroupNames": ["str"], + "vlans": ["str"], + }, + } + ], + "matchConfigurationName": "str", + "sequenceNumber": 0, + } + ], + }, + "tags": {"str": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_access_control_lists_begin_delete(self, resource_group): + response = await ( + await self.client.access_control_lists.begin_delete( + resource_group_name=resource_group.name, + access_control_list_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_access_control_lists_list_by_resource_group(self, resource_group): + response = self.client.access_control_lists.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_access_control_lists_list_by_subscription(self, resource_group): + response = self.client.access_control_lists.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_access_control_lists_begin_update_administrative_state(self, resource_group): + response = await ( + await self.client.access_control_lists.begin_update_administrative_state( + resource_group_name=resource_group.name, + access_control_list_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_access_control_lists_begin_resync(self, resource_group): + response = await ( + await self.client.access_control_lists.begin_resync( + resource_group_name=resource_group.name, + access_control_list_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_access_control_lists_begin_validate_configuration(self, resource_group): + response = await ( + await self.client.access_control_lists.begin_validate_configuration( + resource_group_name=resource_group.name, + access_control_list_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_external_networks_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_external_networks_operations.py new file mode 100644 index 000000000000..1270c2dbe932 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_external_networks_operations.py @@ -0,0 +1,241 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricExternalNetworksOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_external_networks_get(self, resource_group): + response = self.client.external_networks.get( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + external_network_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_external_networks_begin_create(self, resource_group): + response = self.client.external_networks.begin_create( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + external_network_name="str", + body={ + "properties": { + "peeringOption": "str", + "administrativeState": "str", + "annotation": "str", + "configurationState": "str", + "exportRoutePolicy": {"exportIpv4RoutePolicyId": "str", "exportIpv6RoutePolicyId": "str"}, + "importRoutePolicy": {"importIpv4RoutePolicyId": "str", "importIpv6RoutePolicyId": "str"}, + "lastOperation": {"details": "str"}, + "networkFabricId": "str", + "networkToNetworkInterconnectId": "str", + "optionAProperties": { + "peerASN": 0, + "vlanId": 0, + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "bmpConfiguration": {"configurationState": "str"}, + "egressAclId": "str", + "fabricASN": 0, + "ingressAclId": "str", + "mtu": 0, + "nativeIpv4PrefixLimit": { + "prefixLimits": [{"idleTimeExpiry": 0, "maximumRoutes": 0, "threshold": 0}] + }, + "nativeIpv6PrefixLimit": { + "prefixLimits": [{"idleTimeExpiry": 0, "maximumRoutes": 0, "threshold": 0}] + }, + "primaryIpv4Prefix": "str", + "primaryIpv6Prefix": "str", + "secondaryIpv4Prefix": "str", + "secondaryIpv6Prefix": "str", + "v4OverV6BgpSession": "str", + "v6OverV4BgpSession": "str", + }, + "optionBProperties": { + "exportRouteTargets": ["str"], + "importRouteTargets": ["str"], + "routeTargets": { + "exportIpv4RouteTargets": ["str"], + "exportIpv6RouteTargets": ["str"], + "importIpv4RouteTargets": ["str"], + "importIpv6RouteTargets": ["str"], + }, + }, + "provisioningState": "str", + "staticRouteConfiguration": { + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "ipv4Routes": [{"nextHop": ["str"], "prefix": "str"}], + "ipv6Routes": [{"nextHop": ["str"], "prefix": "str"}], + }, + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_external_networks_begin_update(self, resource_group): + response = self.client.external_networks.begin_update( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + external_network_name="str", + body={ + "properties": { + "annotation": "str", + "exportRoutePolicy": {"exportIpv4RoutePolicyId": "str", "exportIpv6RoutePolicyId": "str"}, + "importRoutePolicy": {"importIpv4RoutePolicyId": "str", "importIpv6RoutePolicyId": "str"}, + "networkToNetworkInterconnectId": "str", + "optionAProperties": { + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "bmpConfiguration": {"configurationState": "str"}, + "egressAclId": "str", + "fabricASN": 0, + "ingressAclId": "str", + "mtu": 0, + "nativeIpv4PrefixLimit": { + "prefixLimits": [{"idleTimeExpiry": 0, "maximumRoutes": 0, "threshold": 0}] + }, + "nativeIpv6PrefixLimit": { + "prefixLimits": [{"idleTimeExpiry": 0, "maximumRoutes": 0, "threshold": 0}] + }, + "peerASN": 0, + "primaryIpv4Prefix": "str", + "primaryIpv6Prefix": "str", + "secondaryIpv4Prefix": "str", + "secondaryIpv6Prefix": "str", + "v4OverV6BgpSession": "str", + "v6OverV4BgpSession": "str", + "vlanId": 0, + }, + "optionBProperties": { + "exportRouteTargets": ["str"], + "importRouteTargets": ["str"], + "routeTargets": { + "exportIpv4RouteTargets": ["str"], + "exportIpv6RouteTargets": ["str"], + "importIpv4RouteTargets": ["str"], + "importIpv6RouteTargets": ["str"], + }, + }, + "peeringOption": "str", + "staticRouteConfiguration": { + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "ipv4Routes": [{"nextHop": ["str"], "prefix": "str"}], + "ipv6Routes": [{"nextHop": ["str"], "prefix": "str"}], + }, + } + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_external_networks_begin_delete(self, resource_group): + response = self.client.external_networks.begin_delete( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + external_network_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_external_networks_list_by_l3_isolation_domain(self, resource_group): + response = self.client.external_networks.list_by_l3_isolation_domain( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_external_networks_begin_update_administrative_state(self, resource_group): + response = self.client.external_networks.begin_update_administrative_state( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + external_network_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_external_networks_begin_update_static_route_bfd_administrative_state(self, resource_group): + response = self.client.external_networks.begin_update_static_route_bfd_administrative_state( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + external_network_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_external_networks_begin_update_bfd_administrative_state(self, resource_group): + response = self.client.external_networks.begin_update_bfd_administrative_state( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + external_network_name="str", + body={"administrativeState": "str", "routeType": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_external_networks_operations_async.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_external_networks_operations_async.py new file mode 100644 index 000000000000..1101dab57684 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_external_networks_operations_async.py @@ -0,0 +1,254 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric.aio import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricExternalNetworksOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_external_networks_get(self, resource_group): + response = await self.client.external_networks.get( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + external_network_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_external_networks_begin_create(self, resource_group): + response = await ( + await self.client.external_networks.begin_create( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + external_network_name="str", + body={ + "properties": { + "peeringOption": "str", + "administrativeState": "str", + "annotation": "str", + "configurationState": "str", + "exportRoutePolicy": {"exportIpv4RoutePolicyId": "str", "exportIpv6RoutePolicyId": "str"}, + "importRoutePolicy": {"importIpv4RoutePolicyId": "str", "importIpv6RoutePolicyId": "str"}, + "lastOperation": {"details": "str"}, + "networkFabricId": "str", + "networkToNetworkInterconnectId": "str", + "optionAProperties": { + "peerASN": 0, + "vlanId": 0, + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "bmpConfiguration": {"configurationState": "str"}, + "egressAclId": "str", + "fabricASN": 0, + "ingressAclId": "str", + "mtu": 0, + "nativeIpv4PrefixLimit": { + "prefixLimits": [{"idleTimeExpiry": 0, "maximumRoutes": 0, "threshold": 0}] + }, + "nativeIpv6PrefixLimit": { + "prefixLimits": [{"idleTimeExpiry": 0, "maximumRoutes": 0, "threshold": 0}] + }, + "primaryIpv4Prefix": "str", + "primaryIpv6Prefix": "str", + "secondaryIpv4Prefix": "str", + "secondaryIpv6Prefix": "str", + "v4OverV6BgpSession": "str", + "v6OverV4BgpSession": "str", + }, + "optionBProperties": { + "exportRouteTargets": ["str"], + "importRouteTargets": ["str"], + "routeTargets": { + "exportIpv4RouteTargets": ["str"], + "exportIpv6RouteTargets": ["str"], + "importIpv4RouteTargets": ["str"], + "importIpv6RouteTargets": ["str"], + }, + }, + "provisioningState": "str", + "staticRouteConfiguration": { + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "ipv4Routes": [{"nextHop": ["str"], "prefix": "str"}], + "ipv6Routes": [{"nextHop": ["str"], "prefix": "str"}], + }, + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_external_networks_begin_update(self, resource_group): + response = await ( + await self.client.external_networks.begin_update( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + external_network_name="str", + body={ + "properties": { + "annotation": "str", + "exportRoutePolicy": {"exportIpv4RoutePolicyId": "str", "exportIpv6RoutePolicyId": "str"}, + "importRoutePolicy": {"importIpv4RoutePolicyId": "str", "importIpv6RoutePolicyId": "str"}, + "networkToNetworkInterconnectId": "str", + "optionAProperties": { + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "bmpConfiguration": {"configurationState": "str"}, + "egressAclId": "str", + "fabricASN": 0, + "ingressAclId": "str", + "mtu": 0, + "nativeIpv4PrefixLimit": { + "prefixLimits": [{"idleTimeExpiry": 0, "maximumRoutes": 0, "threshold": 0}] + }, + "nativeIpv6PrefixLimit": { + "prefixLimits": [{"idleTimeExpiry": 0, "maximumRoutes": 0, "threshold": 0}] + }, + "peerASN": 0, + "primaryIpv4Prefix": "str", + "primaryIpv6Prefix": "str", + "secondaryIpv4Prefix": "str", + "secondaryIpv6Prefix": "str", + "v4OverV6BgpSession": "str", + "v6OverV4BgpSession": "str", + "vlanId": 0, + }, + "optionBProperties": { + "exportRouteTargets": ["str"], + "importRouteTargets": ["str"], + "routeTargets": { + "exportIpv4RouteTargets": ["str"], + "exportIpv6RouteTargets": ["str"], + "importIpv4RouteTargets": ["str"], + "importIpv6RouteTargets": ["str"], + }, + }, + "peeringOption": "str", + "staticRouteConfiguration": { + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "ipv4Routes": [{"nextHop": ["str"], "prefix": "str"}], + "ipv6Routes": [{"nextHop": ["str"], "prefix": "str"}], + }, + } + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_external_networks_begin_delete(self, resource_group): + response = await ( + await self.client.external_networks.begin_delete( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + external_network_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_external_networks_list_by_l3_isolation_domain(self, resource_group): + response = self.client.external_networks.list_by_l3_isolation_domain( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_external_networks_begin_update_administrative_state(self, resource_group): + response = await ( + await self.client.external_networks.begin_update_administrative_state( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + external_network_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_external_networks_begin_update_static_route_bfd_administrative_state(self, resource_group): + response = await ( + await self.client.external_networks.begin_update_static_route_bfd_administrative_state( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + external_network_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_external_networks_begin_update_bfd_administrative_state(self, resource_group): + response = await ( + await self.client.external_networks.begin_update_bfd_administrative_state( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + external_network_name="str", + body={"administrativeState": "str", "routeType": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_internal_networks_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_internal_networks_operations.py new file mode 100644 index 000000000000..cb5539f0f949 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_internal_networks_operations.py @@ -0,0 +1,277 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricInternalNetworksOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_internal_networks_get(self, resource_group): + response = self.client.internal_networks.get( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + internal_network_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_internal_networks_begin_create(self, resource_group): + response = self.client.internal_networks.begin_create( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + internal_network_name="str", + body={ + "properties": { + "vlanId": 0, + "administrativeState": "str", + "annotation": "str", + "bgpConfiguration": { + "peerASN": 0, + "allowAS": 0, + "allowASOverride": "str", + "annotation": "str", + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "bmpConfiguration": { + "bmpConfigurationState": "str", + "exportPolicyConfiguration": {"exportPolicies": ["str"]}, + "neighborIpExclusions": ["str"], + }, + "defaultRouteOriginate": "str", + "fabricASN": 0, + "ipv4ListenRangePrefixes": ["str"], + "ipv4NeighborAddress": [ + { + "address": "str", + "bfdAdministrativeState": "str", + "bgpAdministrativeState": "str", + "configurationState": "str", + } + ], + "ipv6ListenRangePrefixes": ["str"], + "ipv6NeighborAddress": [ + { + "address": "str", + "bfdAdministrativeState": "str", + "bgpAdministrativeState": "str", + "configurationState": "str", + } + ], + "v4OverV6BgpSession": "str", + "v6OverV4BgpSession": "str", + }, + "configurationState": "str", + "connectedIPv4Subnets": [{"prefix": "str", "annotation": "str"}], + "connectedIPv6Subnets": [{"prefix": "str", "annotation": "str"}], + "egressAclId": "str", + "exportRoutePolicy": {"exportIpv4RoutePolicyId": "str", "exportIpv6RoutePolicyId": "str"}, + "extension": "str", + "importRoutePolicy": {"importIpv4RoutePolicyId": "str", "importIpv6RoutePolicyId": "str"}, + "ingressAclId": "str", + "isMonitoringEnabled": "str", + "lastOperation": {"details": "str"}, + "mtu": 0, + "nativeIpv4PrefixLimit": { + "prefixLimits": [{"idleTimeExpiry": 0, "maximumRoutes": 0, "threshold": 0}] + }, + "nativeIpv6PrefixLimit": { + "prefixLimits": [{"idleTimeExpiry": 0, "maximumRoutes": 0, "threshold": 0}] + }, + "networkFabricId": "str", + "provisioningState": "str", + "staticRouteConfiguration": { + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "extension": "str", + "ipv4Routes": [{"nextHop": ["str"], "prefix": "str"}], + "ipv6Routes": [{"nextHop": ["str"], "prefix": "str"}], + }, + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_internal_networks_begin_update(self, resource_group): + response = self.client.internal_networks.begin_update( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + internal_network_name="str", + body={ + "properties": { + "annotation": "str", + "bgpConfiguration": { + "allowAS": 0, + "allowASOverride": "str", + "annotation": "str", + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "bmpConfiguration": {"bmpConfigurationState": "str", "neighborIpExclusions": ["str"]}, + "defaultRouteOriginate": "str", + "fabricASN": 0, + "ipv4ListenRangePrefixes": ["str"], + "ipv4NeighborAddress": [ + { + "address": "str", + "bfdAdministrativeState": "str", + "bgpAdministrativeState": "str", + "configurationState": "str", + } + ], + "ipv6ListenRangePrefixes": ["str"], + "ipv6NeighborAddress": [ + { + "address": "str", + "bfdAdministrativeState": "str", + "bgpAdministrativeState": "str", + "configurationState": "str", + } + ], + "peerASN": 0, + "v4OverV6BgpSession": "str", + "v6OverV4BgpSession": "str", + }, + "connectedIPv4Subnets": [{"prefix": "str", "annotation": "str"}], + "connectedIPv6Subnets": [{"prefix": "str", "annotation": "str"}], + "egressAclId": "str", + "exportRoutePolicy": {"exportIpv4RoutePolicyId": "str", "exportIpv6RoutePolicyId": "str"}, + "importRoutePolicy": {"importIpv4RoutePolicyId": "str", "importIpv6RoutePolicyId": "str"}, + "ingressAclId": "str", + "isMonitoringEnabled": "str", + "mtu": 0, + "nativeIpv4PrefixLimit": { + "prefixLimits": [{"idleTimeExpiry": 0, "maximumRoutes": 0, "threshold": 0}] + }, + "nativeIpv6PrefixLimit": { + "prefixLimits": [{"idleTimeExpiry": 0, "maximumRoutes": 0, "threshold": 0}] + }, + "staticRouteConfiguration": { + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "ipv4Routes": [{"nextHop": ["str"], "prefix": "str"}], + "ipv6Routes": [{"nextHop": ["str"], "prefix": "str"}], + }, + } + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_internal_networks_begin_delete(self, resource_group): + response = self.client.internal_networks.begin_delete( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + internal_network_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_internal_networks_list_by_l3_isolation_domain(self, resource_group): + response = self.client.internal_networks.list_by_l3_isolation_domain( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_internal_networks_begin_update_administrative_state(self, resource_group): + response = self.client.internal_networks.begin_update_administrative_state( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + internal_network_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_internal_networks_begin_update_bgp_administrative_state(self, resource_group): + response = self.client.internal_networks.begin_update_bgp_administrative_state( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + internal_network_name="str", + body={"administrativeState": "str", "neighborAddress": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_internal_networks_begin_update_static_route_bfd_administrative_state(self, resource_group): + response = self.client.internal_networks.begin_update_static_route_bfd_administrative_state( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + internal_network_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_internal_networks_begin_update_bfd_administrative_state(self, resource_group): + response = self.client.internal_networks.begin_update_bfd_administrative_state( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + internal_network_name="str", + body={"administrativeState": "str", "neighborAddress": "str", "routeType": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_internal_networks_operations_async.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_internal_networks_operations_async.py new file mode 100644 index 000000000000..c579c2b7261e --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_internal_networks_operations_async.py @@ -0,0 +1,292 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric.aio import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricInternalNetworksOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_internal_networks_get(self, resource_group): + response = await self.client.internal_networks.get( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + internal_network_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_internal_networks_begin_create(self, resource_group): + response = await ( + await self.client.internal_networks.begin_create( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + internal_network_name="str", + body={ + "properties": { + "vlanId": 0, + "administrativeState": "str", + "annotation": "str", + "bgpConfiguration": { + "peerASN": 0, + "allowAS": 0, + "allowASOverride": "str", + "annotation": "str", + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "bmpConfiguration": { + "bmpConfigurationState": "str", + "exportPolicyConfiguration": {"exportPolicies": ["str"]}, + "neighborIpExclusions": ["str"], + }, + "defaultRouteOriginate": "str", + "fabricASN": 0, + "ipv4ListenRangePrefixes": ["str"], + "ipv4NeighborAddress": [ + { + "address": "str", + "bfdAdministrativeState": "str", + "bgpAdministrativeState": "str", + "configurationState": "str", + } + ], + "ipv6ListenRangePrefixes": ["str"], + "ipv6NeighborAddress": [ + { + "address": "str", + "bfdAdministrativeState": "str", + "bgpAdministrativeState": "str", + "configurationState": "str", + } + ], + "v4OverV6BgpSession": "str", + "v6OverV4BgpSession": "str", + }, + "configurationState": "str", + "connectedIPv4Subnets": [{"prefix": "str", "annotation": "str"}], + "connectedIPv6Subnets": [{"prefix": "str", "annotation": "str"}], + "egressAclId": "str", + "exportRoutePolicy": {"exportIpv4RoutePolicyId": "str", "exportIpv6RoutePolicyId": "str"}, + "extension": "str", + "importRoutePolicy": {"importIpv4RoutePolicyId": "str", "importIpv6RoutePolicyId": "str"}, + "ingressAclId": "str", + "isMonitoringEnabled": "str", + "lastOperation": {"details": "str"}, + "mtu": 0, + "nativeIpv4PrefixLimit": { + "prefixLimits": [{"idleTimeExpiry": 0, "maximumRoutes": 0, "threshold": 0}] + }, + "nativeIpv6PrefixLimit": { + "prefixLimits": [{"idleTimeExpiry": 0, "maximumRoutes": 0, "threshold": 0}] + }, + "networkFabricId": "str", + "provisioningState": "str", + "staticRouteConfiguration": { + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "extension": "str", + "ipv4Routes": [{"nextHop": ["str"], "prefix": "str"}], + "ipv6Routes": [{"nextHop": ["str"], "prefix": "str"}], + }, + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_internal_networks_begin_update(self, resource_group): + response = await ( + await self.client.internal_networks.begin_update( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + internal_network_name="str", + body={ + "properties": { + "annotation": "str", + "bgpConfiguration": { + "allowAS": 0, + "allowASOverride": "str", + "annotation": "str", + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "bmpConfiguration": {"bmpConfigurationState": "str", "neighborIpExclusions": ["str"]}, + "defaultRouteOriginate": "str", + "fabricASN": 0, + "ipv4ListenRangePrefixes": ["str"], + "ipv4NeighborAddress": [ + { + "address": "str", + "bfdAdministrativeState": "str", + "bgpAdministrativeState": "str", + "configurationState": "str", + } + ], + "ipv6ListenRangePrefixes": ["str"], + "ipv6NeighborAddress": [ + { + "address": "str", + "bfdAdministrativeState": "str", + "bgpAdministrativeState": "str", + "configurationState": "str", + } + ], + "peerASN": 0, + "v4OverV6BgpSession": "str", + "v6OverV4BgpSession": "str", + }, + "connectedIPv4Subnets": [{"prefix": "str", "annotation": "str"}], + "connectedIPv6Subnets": [{"prefix": "str", "annotation": "str"}], + "egressAclId": "str", + "exportRoutePolicy": {"exportIpv4RoutePolicyId": "str", "exportIpv6RoutePolicyId": "str"}, + "importRoutePolicy": {"importIpv4RoutePolicyId": "str", "importIpv6RoutePolicyId": "str"}, + "ingressAclId": "str", + "isMonitoringEnabled": "str", + "mtu": 0, + "nativeIpv4PrefixLimit": { + "prefixLimits": [{"idleTimeExpiry": 0, "maximumRoutes": 0, "threshold": 0}] + }, + "nativeIpv6PrefixLimit": { + "prefixLimits": [{"idleTimeExpiry": 0, "maximumRoutes": 0, "threshold": 0}] + }, + "staticRouteConfiguration": { + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "ipv4Routes": [{"nextHop": ["str"], "prefix": "str"}], + "ipv6Routes": [{"nextHop": ["str"], "prefix": "str"}], + }, + } + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_internal_networks_begin_delete(self, resource_group): + response = await ( + await self.client.internal_networks.begin_delete( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + internal_network_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_internal_networks_list_by_l3_isolation_domain(self, resource_group): + response = self.client.internal_networks.list_by_l3_isolation_domain( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_internal_networks_begin_update_administrative_state(self, resource_group): + response = await ( + await self.client.internal_networks.begin_update_administrative_state( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + internal_network_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_internal_networks_begin_update_bgp_administrative_state(self, resource_group): + response = await ( + await self.client.internal_networks.begin_update_bgp_administrative_state( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + internal_network_name="str", + body={"administrativeState": "str", "neighborAddress": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_internal_networks_begin_update_static_route_bfd_administrative_state(self, resource_group): + response = await ( + await self.client.internal_networks.begin_update_static_route_bfd_administrative_state( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + internal_network_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_internal_networks_begin_update_bfd_administrative_state(self, resource_group): + response = await ( + await self.client.internal_networks.begin_update_bfd_administrative_state( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + internal_network_name="str", + body={"administrativeState": "str", "neighborAddress": "str", "routeType": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_internet_gateway_rules_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_internet_gateway_rules_operations.py new file mode 100644 index 000000000000..7fb85cd7fb9c --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_internet_gateway_rules_operations.py @@ -0,0 +1,111 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricInternetGatewayRulesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_internet_gateway_rules_get(self, resource_group): + response = self.client.internet_gateway_rules.get( + resource_group_name=resource_group.name, + internet_gateway_rule_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_internet_gateway_rules_begin_create(self, resource_group): + response = self.client.internet_gateway_rules.begin_create( + resource_group_name=resource_group.name, + internet_gateway_rule_name="str", + body={ + "location": "str", + "properties": { + "ruleProperties": { + "action": "str", + "addressList": ["str"], + "condition": "str", + "destinationAddressList": ["str"], + "headerAddressList": [{"addressList": ["str"], "headerName": "str"}], + "sourceAddressList": ["str"], + }, + "annotation": "str", + "internetGatewayIds": ["str"], + "lastOperation": {"details": "str"}, + "provisioningState": "str", + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_internet_gateway_rules_begin_update(self, resource_group): + response = self.client.internet_gateway_rules.begin_update( + resource_group_name=resource_group.name, + internet_gateway_rule_name="str", + body={"tags": {"str": "str"}}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_internet_gateway_rules_begin_delete(self, resource_group): + response = self.client.internet_gateway_rules.begin_delete( + resource_group_name=resource_group.name, + internet_gateway_rule_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_internet_gateway_rules_list_by_resource_group(self, resource_group): + response = self.client.internet_gateway_rules.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_internet_gateway_rules_list_by_subscription(self, resource_group): + response = self.client.internet_gateway_rules.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_internet_gateway_rules_operations_async.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_internet_gateway_rules_operations_async.py new file mode 100644 index 000000000000..dceccf542815 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_internet_gateway_rules_operations_async.py @@ -0,0 +1,118 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric.aio import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricInternetGatewayRulesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_internet_gateway_rules_get(self, resource_group): + response = await self.client.internet_gateway_rules.get( + resource_group_name=resource_group.name, + internet_gateway_rule_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_internet_gateway_rules_begin_create(self, resource_group): + response = await ( + await self.client.internet_gateway_rules.begin_create( + resource_group_name=resource_group.name, + internet_gateway_rule_name="str", + body={ + "location": "str", + "properties": { + "ruleProperties": { + "action": "str", + "addressList": ["str"], + "condition": "str", + "destinationAddressList": ["str"], + "headerAddressList": [{"addressList": ["str"], "headerName": "str"}], + "sourceAddressList": ["str"], + }, + "annotation": "str", + "internetGatewayIds": ["str"], + "lastOperation": {"details": "str"}, + "provisioningState": "str", + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_internet_gateway_rules_begin_update(self, resource_group): + response = await ( + await self.client.internet_gateway_rules.begin_update( + resource_group_name=resource_group.name, + internet_gateway_rule_name="str", + body={"tags": {"str": "str"}}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_internet_gateway_rules_begin_delete(self, resource_group): + response = await ( + await self.client.internet_gateway_rules.begin_delete( + resource_group_name=resource_group.name, + internet_gateway_rule_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_internet_gateway_rules_list_by_resource_group(self, resource_group): + response = self.client.internet_gateway_rules.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_internet_gateway_rules_list_by_subscription(self, resource_group): + response = self.client.internet_gateway_rules.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_internet_gateways_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_internet_gateways_operations.py new file mode 100644 index 000000000000..92cb8e979fdc --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_internet_gateways_operations.py @@ -0,0 +1,108 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricInternetGatewaysOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_internet_gateways_get(self, resource_group): + response = self.client.internet_gateways.get( + resource_group_name=resource_group.name, + internet_gateway_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_internet_gateways_begin_create(self, resource_group): + response = self.client.internet_gateways.begin_create( + resource_group_name=resource_group.name, + internet_gateway_name="str", + body={ + "location": "str", + "properties": { + "networkFabricControllerId": "str", + "annotation": "str", + "internetGatewayRuleId": "str", + "internetGatewayType": "str", + "ipv4Address": "str", + "lastOperation": {"details": "str"}, + "port": 0, + "provisioningState": "str", + "type": "str", + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_internet_gateways_begin_update(self, resource_group): + response = self.client.internet_gateways.begin_update( + resource_group_name=resource_group.name, + internet_gateway_name="str", + body={"properties": {"internetGatewayRuleId": "str"}, "tags": {"str": "str"}}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_internet_gateways_begin_delete(self, resource_group): + response = self.client.internet_gateways.begin_delete( + resource_group_name=resource_group.name, + internet_gateway_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_internet_gateways_list_by_resource_group(self, resource_group): + response = self.client.internet_gateways.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_internet_gateways_list_by_subscription(self, resource_group): + response = self.client.internet_gateways.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_internet_gateways_operations_async.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_internet_gateways_operations_async.py new file mode 100644 index 000000000000..e41a0e1f57b2 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_internet_gateways_operations_async.py @@ -0,0 +1,115 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric.aio import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricInternetGatewaysOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_internet_gateways_get(self, resource_group): + response = await self.client.internet_gateways.get( + resource_group_name=resource_group.name, + internet_gateway_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_internet_gateways_begin_create(self, resource_group): + response = await ( + await self.client.internet_gateways.begin_create( + resource_group_name=resource_group.name, + internet_gateway_name="str", + body={ + "location": "str", + "properties": { + "networkFabricControllerId": "str", + "annotation": "str", + "internetGatewayRuleId": "str", + "internetGatewayType": "str", + "ipv4Address": "str", + "lastOperation": {"details": "str"}, + "port": 0, + "provisioningState": "str", + "type": "str", + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_internet_gateways_begin_update(self, resource_group): + response = await ( + await self.client.internet_gateways.begin_update( + resource_group_name=resource_group.name, + internet_gateway_name="str", + body={"properties": {"internetGatewayRuleId": "str"}, "tags": {"str": "str"}}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_internet_gateways_begin_delete(self, resource_group): + response = await ( + await self.client.internet_gateways.begin_delete( + resource_group_name=resource_group.name, + internet_gateway_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_internet_gateways_list_by_resource_group(self, resource_group): + response = self.client.internet_gateways.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_internet_gateways_list_by_subscription(self, resource_group): + response = self.client.internet_gateways.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_ip_communities_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_ip_communities_operations.py new file mode 100644 index 000000000000..455e057b5f9c --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_ip_communities_operations.py @@ -0,0 +1,125 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricIpCommunitiesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_ip_communities_get(self, resource_group): + response = self.client.ip_communities.get( + resource_group_name=resource_group.name, + ip_community_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_ip_communities_begin_create(self, resource_group): + response = self.client.ip_communities.begin_create( + resource_group_name=resource_group.name, + ip_community_name="str", + body={ + "location": "str", + "properties": { + "ipCommunityRules": [ + { + "action": "str", + "communityMembers": ["str"], + "sequenceNumber": 0, + "wellKnownCommunities": ["str"], + } + ], + "administrativeState": "str", + "annotation": "str", + "configurationState": "str", + "lastOperation": {"details": "str"}, + "networkFabricId": "str", + "provisioningState": "str", + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_ip_communities_begin_update(self, resource_group): + response = self.client.ip_communities.begin_update( + resource_group_name=resource_group.name, + ip_community_name="str", + body={ + "properties": { + "ipCommunityRules": [ + { + "action": "str", + "communityMembers": ["str"], + "sequenceNumber": 0, + "wellKnownCommunities": ["str"], + } + ] + }, + "tags": {"str": "str"}, + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_ip_communities_begin_delete(self, resource_group): + response = self.client.ip_communities.begin_delete( + resource_group_name=resource_group.name, + ip_community_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_ip_communities_list_by_resource_group(self, resource_group): + response = self.client.ip_communities.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_ip_communities_list_by_subscription(self, resource_group): + response = self.client.ip_communities.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_ip_communities_operations_async.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_ip_communities_operations_async.py new file mode 100644 index 000000000000..2fa6561a0ac0 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_ip_communities_operations_async.py @@ -0,0 +1,132 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric.aio import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricIpCommunitiesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_ip_communities_get(self, resource_group): + response = await self.client.ip_communities.get( + resource_group_name=resource_group.name, + ip_community_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_ip_communities_begin_create(self, resource_group): + response = await ( + await self.client.ip_communities.begin_create( + resource_group_name=resource_group.name, + ip_community_name="str", + body={ + "location": "str", + "properties": { + "ipCommunityRules": [ + { + "action": "str", + "communityMembers": ["str"], + "sequenceNumber": 0, + "wellKnownCommunities": ["str"], + } + ], + "administrativeState": "str", + "annotation": "str", + "configurationState": "str", + "lastOperation": {"details": "str"}, + "networkFabricId": "str", + "provisioningState": "str", + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_ip_communities_begin_update(self, resource_group): + response = await ( + await self.client.ip_communities.begin_update( + resource_group_name=resource_group.name, + ip_community_name="str", + body={ + "properties": { + "ipCommunityRules": [ + { + "action": "str", + "communityMembers": ["str"], + "sequenceNumber": 0, + "wellKnownCommunities": ["str"], + } + ] + }, + "tags": {"str": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_ip_communities_begin_delete(self, resource_group): + response = await ( + await self.client.ip_communities.begin_delete( + resource_group_name=resource_group.name, + ip_community_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_ip_communities_list_by_resource_group(self, resource_group): + response = self.client.ip_communities.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_ip_communities_list_by_subscription(self, resource_group): + response = self.client.ip_communities.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_ip_extended_communities_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_ip_extended_communities_operations.py new file mode 100644 index 000000000000..d603a28a0ba2 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_ip_extended_communities_operations.py @@ -0,0 +1,112 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricIpExtendedCommunitiesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_ip_extended_communities_get(self, resource_group): + response = self.client.ip_extended_communities.get( + resource_group_name=resource_group.name, + ip_extended_community_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_ip_extended_communities_begin_create(self, resource_group): + response = self.client.ip_extended_communities.begin_create( + resource_group_name=resource_group.name, + ip_extended_community_name="str", + body={ + "location": "str", + "properties": { + "ipExtendedCommunityRules": [{"action": "str", "routeTargets": ["str"], "sequenceNumber": 0}], + "administrativeState": "str", + "annotation": "str", + "configurationState": "str", + "lastOperation": {"details": "str"}, + "networkFabricId": "str", + "provisioningState": "str", + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_ip_extended_communities_begin_update(self, resource_group): + response = self.client.ip_extended_communities.begin_update( + resource_group_name=resource_group.name, + ip_extended_community_name="str", + body={ + "properties": { + "annotation": "str", + "ipExtendedCommunityRules": [{"action": "str", "routeTargets": ["str"], "sequenceNumber": 0}], + }, + "tags": {"str": "str"}, + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_ip_extended_communities_begin_delete(self, resource_group): + response = self.client.ip_extended_communities.begin_delete( + resource_group_name=resource_group.name, + ip_extended_community_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_ip_extended_communities_list_by_resource_group(self, resource_group): + response = self.client.ip_extended_communities.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_ip_extended_communities_list_by_subscription(self, resource_group): + response = self.client.ip_extended_communities.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_ip_extended_communities_operations_async.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_ip_extended_communities_operations_async.py new file mode 100644 index 000000000000..972d8c6b3cea --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_ip_extended_communities_operations_async.py @@ -0,0 +1,119 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric.aio import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricIpExtendedCommunitiesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_ip_extended_communities_get(self, resource_group): + response = await self.client.ip_extended_communities.get( + resource_group_name=resource_group.name, + ip_extended_community_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_ip_extended_communities_begin_create(self, resource_group): + response = await ( + await self.client.ip_extended_communities.begin_create( + resource_group_name=resource_group.name, + ip_extended_community_name="str", + body={ + "location": "str", + "properties": { + "ipExtendedCommunityRules": [{"action": "str", "routeTargets": ["str"], "sequenceNumber": 0}], + "administrativeState": "str", + "annotation": "str", + "configurationState": "str", + "lastOperation": {"details": "str"}, + "networkFabricId": "str", + "provisioningState": "str", + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_ip_extended_communities_begin_update(self, resource_group): + response = await ( + await self.client.ip_extended_communities.begin_update( + resource_group_name=resource_group.name, + ip_extended_community_name="str", + body={ + "properties": { + "annotation": "str", + "ipExtendedCommunityRules": [{"action": "str", "routeTargets": ["str"], "sequenceNumber": 0}], + }, + "tags": {"str": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_ip_extended_communities_begin_delete(self, resource_group): + response = await ( + await self.client.ip_extended_communities.begin_delete( + resource_group_name=resource_group.name, + ip_extended_community_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_ip_extended_communities_list_by_resource_group(self, resource_group): + response = self.client.ip_extended_communities.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_ip_extended_communities_list_by_subscription(self, resource_group): + response = self.client.ip_extended_communities.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_ip_prefixes_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_ip_prefixes_operations.py new file mode 100644 index 000000000000..f513320d0151 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_ip_prefixes_operations.py @@ -0,0 +1,128 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricIpPrefixesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_ip_prefixes_get(self, resource_group): + response = self.client.ip_prefixes.get( + resource_group_name=resource_group.name, + ip_prefix_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_ip_prefixes_begin_create(self, resource_group): + response = self.client.ip_prefixes.begin_create( + resource_group_name=resource_group.name, + ip_prefix_name="str", + body={ + "location": "str", + "properties": { + "ipPrefixRules": [ + { + "action": "str", + "networkPrefix": "str", + "sequenceNumber": 0, + "condition": "str", + "subnetMaskLength": "str", + } + ], + "administrativeState": "str", + "annotation": "str", + "configurationState": "str", + "lastOperation": {"details": "str"}, + "networkFabricId": "str", + "provisioningState": "str", + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_ip_prefixes_begin_update(self, resource_group): + response = self.client.ip_prefixes.begin_update( + resource_group_name=resource_group.name, + ip_prefix_name="str", + body={ + "properties": { + "annotation": "str", + "ipPrefixRules": [ + { + "action": "str", + "networkPrefix": "str", + "sequenceNumber": 0, + "condition": "str", + "subnetMaskLength": "str", + } + ], + }, + "tags": {"str": "str"}, + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_ip_prefixes_begin_delete(self, resource_group): + response = self.client.ip_prefixes.begin_delete( + resource_group_name=resource_group.name, + ip_prefix_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_ip_prefixes_list_by_resource_group(self, resource_group): + response = self.client.ip_prefixes.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_ip_prefixes_list_by_subscription(self, resource_group): + response = self.client.ip_prefixes.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_ip_prefixes_operations_async.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_ip_prefixes_operations_async.py new file mode 100644 index 000000000000..fbf1dff3ea0d --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_ip_prefixes_operations_async.py @@ -0,0 +1,135 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric.aio import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricIpPrefixesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_ip_prefixes_get(self, resource_group): + response = await self.client.ip_prefixes.get( + resource_group_name=resource_group.name, + ip_prefix_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_ip_prefixes_begin_create(self, resource_group): + response = await ( + await self.client.ip_prefixes.begin_create( + resource_group_name=resource_group.name, + ip_prefix_name="str", + body={ + "location": "str", + "properties": { + "ipPrefixRules": [ + { + "action": "str", + "networkPrefix": "str", + "sequenceNumber": 0, + "condition": "str", + "subnetMaskLength": "str", + } + ], + "administrativeState": "str", + "annotation": "str", + "configurationState": "str", + "lastOperation": {"details": "str"}, + "networkFabricId": "str", + "provisioningState": "str", + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_ip_prefixes_begin_update(self, resource_group): + response = await ( + await self.client.ip_prefixes.begin_update( + resource_group_name=resource_group.name, + ip_prefix_name="str", + body={ + "properties": { + "annotation": "str", + "ipPrefixRules": [ + { + "action": "str", + "networkPrefix": "str", + "sequenceNumber": 0, + "condition": "str", + "subnetMaskLength": "str", + } + ], + }, + "tags": {"str": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_ip_prefixes_begin_delete(self, resource_group): + response = await ( + await self.client.ip_prefixes.begin_delete( + resource_group_name=resource_group.name, + ip_prefix_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_ip_prefixes_list_by_resource_group(self, resource_group): + response = self.client.ip_prefixes.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_ip_prefixes_list_by_subscription(self, resource_group): + response = self.client.ip_prefixes.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_l2_isolation_domains_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_l2_isolation_domains_operations.py new file mode 100644 index 000000000000..395e0ace4b78 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_l2_isolation_domains_operations.py @@ -0,0 +1,161 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricL2IsolationDomainsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_l2_isolation_domains_get(self, resource_group): + response = self.client.l2_isolation_domains.get( + resource_group_name=resource_group.name, + l2_isolation_domain_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_l2_isolation_domains_begin_create(self, resource_group): + response = self.client.l2_isolation_domains.begin_create( + resource_group_name=resource_group.name, + l2_isolation_domain_name="str", + body={ + "location": "str", + "properties": { + "networkFabricId": "str", + "vlanId": 0, + "administrativeState": "str", + "annotation": "str", + "configurationState": "str", + "extendedVlan": "str", + "lastOperation": {"details": "str"}, + "mtu": 0, + "networkToNetworkInterconnectId": "str", + "provisioningState": "str", + }, + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_l2_isolation_domains_begin_update(self, resource_group): + response = self.client.l2_isolation_domains.begin_update( + resource_group_name=resource_group.name, + l2_isolation_domain_name="str", + body={ + "identity": { + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "annotation": "str", + "extendedVlan": "str", + "mtu": 0, + "networkToNetworkInterconnectId": "str", + }, + "tags": {"str": "str"}, + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_l2_isolation_domains_begin_delete(self, resource_group): + response = self.client.l2_isolation_domains.begin_delete( + resource_group_name=resource_group.name, + l2_isolation_domain_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_l2_isolation_domains_list_by_resource_group(self, resource_group): + response = self.client.l2_isolation_domains.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_l2_isolation_domains_list_by_subscription(self, resource_group): + response = self.client.l2_isolation_domains.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_l2_isolation_domains_begin_update_administrative_state(self, resource_group): + response = self.client.l2_isolation_domains.begin_update_administrative_state( + resource_group_name=resource_group.name, + l2_isolation_domain_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_l2_isolation_domains_begin_validate_configuration(self, resource_group): + response = self.client.l2_isolation_domains.begin_validate_configuration( + resource_group_name=resource_group.name, + l2_isolation_domain_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_l2_isolation_domains_begin_commit_configuration(self, resource_group): + response = self.client.l2_isolation_domains.begin_commit_configuration( + resource_group_name=resource_group.name, + l2_isolation_domain_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_l2_isolation_domains_operations_async.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_l2_isolation_domains_operations_async.py new file mode 100644 index 000000000000..2eac4d7641d7 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_l2_isolation_domains_operations_async.py @@ -0,0 +1,174 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric.aio import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricL2IsolationDomainsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_l2_isolation_domains_get(self, resource_group): + response = await self.client.l2_isolation_domains.get( + resource_group_name=resource_group.name, + l2_isolation_domain_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_l2_isolation_domains_begin_create(self, resource_group): + response = await ( + await self.client.l2_isolation_domains.begin_create( + resource_group_name=resource_group.name, + l2_isolation_domain_name="str", + body={ + "location": "str", + "properties": { + "networkFabricId": "str", + "vlanId": 0, + "administrativeState": "str", + "annotation": "str", + "configurationState": "str", + "extendedVlan": "str", + "lastOperation": {"details": "str"}, + "mtu": 0, + "networkToNetworkInterconnectId": "str", + "provisioningState": "str", + }, + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_l2_isolation_domains_begin_update(self, resource_group): + response = await ( + await self.client.l2_isolation_domains.begin_update( + resource_group_name=resource_group.name, + l2_isolation_domain_name="str", + body={ + "identity": { + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "annotation": "str", + "extendedVlan": "str", + "mtu": 0, + "networkToNetworkInterconnectId": "str", + }, + "tags": {"str": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_l2_isolation_domains_begin_delete(self, resource_group): + response = await ( + await self.client.l2_isolation_domains.begin_delete( + resource_group_name=resource_group.name, + l2_isolation_domain_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_l2_isolation_domains_list_by_resource_group(self, resource_group): + response = self.client.l2_isolation_domains.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_l2_isolation_domains_list_by_subscription(self, resource_group): + response = self.client.l2_isolation_domains.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_l2_isolation_domains_begin_update_administrative_state(self, resource_group): + response = await ( + await self.client.l2_isolation_domains.begin_update_administrative_state( + resource_group_name=resource_group.name, + l2_isolation_domain_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_l2_isolation_domains_begin_validate_configuration(self, resource_group): + response = await ( + await self.client.l2_isolation_domains.begin_validate_configuration( + resource_group_name=resource_group.name, + l2_isolation_domain_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_l2_isolation_domains_begin_commit_configuration(self, resource_group): + response = await ( + await self.client.l2_isolation_domains.begin_commit_configuration( + resource_group_name=resource_group.name, + l2_isolation_domain_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_l3_isolation_domains_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_l3_isolation_domains_operations.py new file mode 100644 index 000000000000..c0092ef1a079 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_l3_isolation_domains_operations.py @@ -0,0 +1,185 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricL3IsolationDomainsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_l3_isolation_domains_get(self, resource_group): + response = self.client.l3_isolation_domains.get( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_l3_isolation_domains_begin_create(self, resource_group): + response = self.client.l3_isolation_domains.begin_create( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + body={ + "location": "str", + "properties": { + "networkFabricId": "str", + "administrativeState": "str", + "aggregateRouteConfiguration": { + "ipv4Routes": [{"prefix": "str"}], + "ipv6Routes": [{"prefix": "str"}], + }, + "annotation": "str", + "configurationState": "str", + "connectedSubnetRoutePolicy": { + "exportRoutePolicy": {"exportIpv4RoutePolicyId": "str", "exportIpv6RoutePolicyId": "str"} + }, + "exportPolicyConfiguration": {"exportPolicies": ["str"]}, + "lastOperation": {"details": "str"}, + "provisioningState": "str", + "redistributeConnectedSubnets": "str", + "redistributeStaticRoutes": "str", + "staticRouteRoutePolicy": { + "exportRoutePolicy": {"exportIpv4RoutePolicyId": "str", "exportIpv6RoutePolicyId": "str"} + }, + "uniqueRdConfiguration": {"uniqueRds": ["str"]}, + "v4routePrefixLimit": {"hardLimit": 0, "threshold": 0}, + "v6routePrefixLimit": {"hardLimit": 0, "threshold": 0}, + }, + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_l3_isolation_domains_begin_update(self, resource_group): + response = self.client.l3_isolation_domains.begin_update( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + body={ + "identity": { + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "aggregateRouteConfiguration": { + "ipv4Routes": [{"prefix": "str"}], + "ipv6Routes": [{"prefix": "str"}], + }, + "annotation": "str", + "connectedSubnetRoutePolicy": { + "exportRoutePolicy": {"exportIpv4RoutePolicyId": "str", "exportIpv6RoutePolicyId": "str"} + }, + "exportPolicyConfiguration": {"exportPolicies": ["str"]}, + "redistributeConnectedSubnets": "str", + "redistributeStaticRoutes": "str", + "staticRouteRoutePolicy": { + "exportRoutePolicy": {"exportIpv4RoutePolicyId": "str", "exportIpv6RoutePolicyId": "str"} + }, + "v4routePrefixLimit": {"hardLimit": 0, "threshold": 0}, + "v6routePrefixLimit": {"hardLimit": 0, "threshold": 0}, + }, + "tags": {"str": "str"}, + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_l3_isolation_domains_begin_delete(self, resource_group): + response = self.client.l3_isolation_domains.begin_delete( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_l3_isolation_domains_list_by_resource_group(self, resource_group): + response = self.client.l3_isolation_domains.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_l3_isolation_domains_list_by_subscription(self, resource_group): + response = self.client.l3_isolation_domains.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_l3_isolation_domains_begin_update_administrative_state(self, resource_group): + response = self.client.l3_isolation_domains.begin_update_administrative_state( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_l3_isolation_domains_begin_validate_configuration(self, resource_group): + response = self.client.l3_isolation_domains.begin_validate_configuration( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_l3_isolation_domains_begin_commit_configuration(self, resource_group): + response = self.client.l3_isolation_domains.begin_commit_configuration( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_l3_isolation_domains_operations_async.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_l3_isolation_domains_operations_async.py new file mode 100644 index 000000000000..6f7298caecf6 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_l3_isolation_domains_operations_async.py @@ -0,0 +1,198 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric.aio import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricL3IsolationDomainsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_l3_isolation_domains_get(self, resource_group): + response = await self.client.l3_isolation_domains.get( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_l3_isolation_domains_begin_create(self, resource_group): + response = await ( + await self.client.l3_isolation_domains.begin_create( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + body={ + "location": "str", + "properties": { + "networkFabricId": "str", + "administrativeState": "str", + "aggregateRouteConfiguration": { + "ipv4Routes": [{"prefix": "str"}], + "ipv6Routes": [{"prefix": "str"}], + }, + "annotation": "str", + "configurationState": "str", + "connectedSubnetRoutePolicy": { + "exportRoutePolicy": {"exportIpv4RoutePolicyId": "str", "exportIpv6RoutePolicyId": "str"} + }, + "exportPolicyConfiguration": {"exportPolicies": ["str"]}, + "lastOperation": {"details": "str"}, + "provisioningState": "str", + "redistributeConnectedSubnets": "str", + "redistributeStaticRoutes": "str", + "staticRouteRoutePolicy": { + "exportRoutePolicy": {"exportIpv4RoutePolicyId": "str", "exportIpv6RoutePolicyId": "str"} + }, + "uniqueRdConfiguration": {"uniqueRds": ["str"]}, + "v4routePrefixLimit": {"hardLimit": 0, "threshold": 0}, + "v6routePrefixLimit": {"hardLimit": 0, "threshold": 0}, + }, + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_l3_isolation_domains_begin_update(self, resource_group): + response = await ( + await self.client.l3_isolation_domains.begin_update( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + body={ + "identity": { + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "aggregateRouteConfiguration": { + "ipv4Routes": [{"prefix": "str"}], + "ipv6Routes": [{"prefix": "str"}], + }, + "annotation": "str", + "connectedSubnetRoutePolicy": { + "exportRoutePolicy": {"exportIpv4RoutePolicyId": "str", "exportIpv6RoutePolicyId": "str"} + }, + "exportPolicyConfiguration": {"exportPolicies": ["str"]}, + "redistributeConnectedSubnets": "str", + "redistributeStaticRoutes": "str", + "staticRouteRoutePolicy": { + "exportRoutePolicy": {"exportIpv4RoutePolicyId": "str", "exportIpv6RoutePolicyId": "str"} + }, + "v4routePrefixLimit": {"hardLimit": 0, "threshold": 0}, + "v6routePrefixLimit": {"hardLimit": 0, "threshold": 0}, + }, + "tags": {"str": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_l3_isolation_domains_begin_delete(self, resource_group): + response = await ( + await self.client.l3_isolation_domains.begin_delete( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_l3_isolation_domains_list_by_resource_group(self, resource_group): + response = self.client.l3_isolation_domains.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_l3_isolation_domains_list_by_subscription(self, resource_group): + response = self.client.l3_isolation_domains.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_l3_isolation_domains_begin_update_administrative_state(self, resource_group): + response = await ( + await self.client.l3_isolation_domains.begin_update_administrative_state( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_l3_isolation_domains_begin_validate_configuration(self, resource_group): + response = await ( + await self.client.l3_isolation_domains.begin_validate_configuration( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_l3_isolation_domains_begin_commit_configuration(self, resource_group): + response = await ( + await self.client.l3_isolation_domains.begin_commit_configuration( + resource_group_name=resource_group.name, + l3_isolation_domain_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_neighbor_groups_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_neighbor_groups_operations.py new file mode 100644 index 000000000000..dd032f8d3c9d --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_neighbor_groups_operations.py @@ -0,0 +1,134 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricNeighborGroupsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_neighbor_groups_get(self, resource_group): + response = self.client.neighbor_groups.get( + resource_group_name=resource_group.name, + neighbor_group_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_neighbor_groups_begin_create(self, resource_group): + response = self.client.neighbor_groups.begin_create( + resource_group_name=resource_group.name, + neighbor_group_name="str", + body={ + "location": "str", + "properties": { + "destination": {"ipv4Addresses": ["str"], "ipv6Addresses": ["str"]}, + "annotation": "str", + "configurationState": "str", + "lastOperation": {"details": "str"}, + "networkFabricIds": ["str"], + "networkTapIds": ["str"], + "networkTapRuleIds": ["str"], + "provisioningState": "str", + }, + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_neighbor_groups_begin_update(self, resource_group): + response = self.client.neighbor_groups.begin_update( + resource_group_name=resource_group.name, + neighbor_group_name="str", + body={ + "identity": { + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "annotation": "str", + "destination": {"ipv4Addresses": ["str"], "ipv6Addresses": ["str"]}, + }, + "tags": {"str": "str"}, + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_neighbor_groups_begin_delete(self, resource_group): + response = self.client.neighbor_groups.begin_delete( + resource_group_name=resource_group.name, + neighbor_group_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_neighbor_groups_list_by_resource_group(self, resource_group): + response = self.client.neighbor_groups.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_neighbor_groups_list_by_subscription(self, resource_group): + response = self.client.neighbor_groups.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_neighbor_groups_begin_resync(self, resource_group): + response = self.client.neighbor_groups.begin_resync( + resource_group_name=resource_group.name, + neighbor_group_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_neighbor_groups_operations_async.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_neighbor_groups_operations_async.py new file mode 100644 index 000000000000..8d549eedd3ec --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_neighbor_groups_operations_async.py @@ -0,0 +1,143 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric.aio import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricNeighborGroupsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_neighbor_groups_get(self, resource_group): + response = await self.client.neighbor_groups.get( + resource_group_name=resource_group.name, + neighbor_group_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_neighbor_groups_begin_create(self, resource_group): + response = await ( + await self.client.neighbor_groups.begin_create( + resource_group_name=resource_group.name, + neighbor_group_name="str", + body={ + "location": "str", + "properties": { + "destination": {"ipv4Addresses": ["str"], "ipv6Addresses": ["str"]}, + "annotation": "str", + "configurationState": "str", + "lastOperation": {"details": "str"}, + "networkFabricIds": ["str"], + "networkTapIds": ["str"], + "networkTapRuleIds": ["str"], + "provisioningState": "str", + }, + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_neighbor_groups_begin_update(self, resource_group): + response = await ( + await self.client.neighbor_groups.begin_update( + resource_group_name=resource_group.name, + neighbor_group_name="str", + body={ + "identity": { + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "annotation": "str", + "destination": {"ipv4Addresses": ["str"], "ipv6Addresses": ["str"]}, + }, + "tags": {"str": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_neighbor_groups_begin_delete(self, resource_group): + response = await ( + await self.client.neighbor_groups.begin_delete( + resource_group_name=resource_group.name, + neighbor_group_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_neighbor_groups_list_by_resource_group(self, resource_group): + response = self.client.neighbor_groups.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_neighbor_groups_list_by_subscription(self, resource_group): + response = self.client.neighbor_groups.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_neighbor_groups_begin_resync(self, resource_group): + response = await ( + await self.client.neighbor_groups.begin_resync( + resource_group_name=resource_group.name, + neighbor_group_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_bootstrap_devices_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_bootstrap_devices_operations.py new file mode 100644 index 000000000000..603c88f39f6f --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_bootstrap_devices_operations.py @@ -0,0 +1,183 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricNetworkBootstrapDevicesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_bootstrap_devices_get(self, resource_group): + response = self.client.network_bootstrap_devices.get( + resource_group_name=resource_group.name, + network_bootstrap_device_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_bootstrap_devices_begin_create(self, resource_group): + response = self.client.network_bootstrap_devices.begin_create( + resource_group_name=resource_group.name, + network_bootstrap_device_name="str", + body={ + "location": "str", + "properties": { + "administrativeState": "str", + "annotation": "str", + "configurationState": "str", + "dhcpV4ServerIpAddress": "str", + "hostName": "str", + "networkDeviceSku": "str", + "networkFabricId": "str", + "primaryManagementIpv4Address": "str", + "primaryManagementIpv6Address": "str", + "provisioningState": "str", + "secondaryManagementIpv4Address": "str", + "secondaryManagementIpv6Address": "str", + "serialNumber": "str", + "version": "str", + }, + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_bootstrap_devices_begin_update(self, resource_group): + response = self.client.network_bootstrap_devices.begin_update( + resource_group_name=resource_group.name, + network_bootstrap_device_name="str", + body={ + "identity": { + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": {"annotation": "str", "hostName": "str", "serialNumber": "str"}, + "tags": {"str": "str"}, + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_bootstrap_devices_begin_delete(self, resource_group): + response = self.client.network_bootstrap_devices.begin_delete( + resource_group_name=resource_group.name, + network_bootstrap_device_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_bootstrap_devices_list_by_resource_group(self, resource_group): + response = self.client.network_bootstrap_devices.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_bootstrap_devices_list_by_subscription(self, resource_group): + response = self.client.network_bootstrap_devices.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_bootstrap_devices_begin_reboot(self, resource_group): + response = self.client.network_bootstrap_devices.begin_reboot( + resource_group_name=resource_group.name, + network_bootstrap_device_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_bootstrap_devices_begin_refresh_configuration(self, resource_group): + response = self.client.network_bootstrap_devices.begin_refresh_configuration( + resource_group_name=resource_group.name, + network_bootstrap_device_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_bootstrap_devices_begin_upgrade(self, resource_group): + response = self.client.network_bootstrap_devices.begin_upgrade( + resource_group_name=resource_group.name, + network_bootstrap_device_name="str", + body={"version": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_bootstrap_devices_begin_update_administrative_state(self, resource_group): + response = self.client.network_bootstrap_devices.begin_update_administrative_state( + resource_group_name=resource_group.name, + network_bootstrap_device_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_bootstrap_devices_begin_resync_passwords(self, resource_group): + response = self.client.network_bootstrap_devices.begin_resync_passwords( + resource_group_name=resource_group.name, + network_bootstrap_device_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_bootstrap_devices_operations_async.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_bootstrap_devices_operations_async.py new file mode 100644 index 000000000000..70dcb1289168 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_bootstrap_devices_operations_async.py @@ -0,0 +1,200 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric.aio import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricNetworkBootstrapDevicesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_bootstrap_devices_get(self, resource_group): + response = await self.client.network_bootstrap_devices.get( + resource_group_name=resource_group.name, + network_bootstrap_device_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_bootstrap_devices_begin_create(self, resource_group): + response = await ( + await self.client.network_bootstrap_devices.begin_create( + resource_group_name=resource_group.name, + network_bootstrap_device_name="str", + body={ + "location": "str", + "properties": { + "administrativeState": "str", + "annotation": "str", + "configurationState": "str", + "dhcpV4ServerIpAddress": "str", + "hostName": "str", + "networkDeviceSku": "str", + "networkFabricId": "str", + "primaryManagementIpv4Address": "str", + "primaryManagementIpv6Address": "str", + "provisioningState": "str", + "secondaryManagementIpv4Address": "str", + "secondaryManagementIpv6Address": "str", + "serialNumber": "str", + "version": "str", + }, + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_bootstrap_devices_begin_update(self, resource_group): + response = await ( + await self.client.network_bootstrap_devices.begin_update( + resource_group_name=resource_group.name, + network_bootstrap_device_name="str", + body={ + "identity": { + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": {"annotation": "str", "hostName": "str", "serialNumber": "str"}, + "tags": {"str": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_bootstrap_devices_begin_delete(self, resource_group): + response = await ( + await self.client.network_bootstrap_devices.begin_delete( + resource_group_name=resource_group.name, + network_bootstrap_device_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_bootstrap_devices_list_by_resource_group(self, resource_group): + response = self.client.network_bootstrap_devices.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_bootstrap_devices_list_by_subscription(self, resource_group): + response = self.client.network_bootstrap_devices.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_bootstrap_devices_begin_reboot(self, resource_group): + response = await ( + await self.client.network_bootstrap_devices.begin_reboot( + resource_group_name=resource_group.name, + network_bootstrap_device_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_bootstrap_devices_begin_refresh_configuration(self, resource_group): + response = await ( + await self.client.network_bootstrap_devices.begin_refresh_configuration( + resource_group_name=resource_group.name, + network_bootstrap_device_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_bootstrap_devices_begin_upgrade(self, resource_group): + response = await ( + await self.client.network_bootstrap_devices.begin_upgrade( + resource_group_name=resource_group.name, + network_bootstrap_device_name="str", + body={"version": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_bootstrap_devices_begin_update_administrative_state(self, resource_group): + response = await ( + await self.client.network_bootstrap_devices.begin_update_administrative_state( + resource_group_name=resource_group.name, + network_bootstrap_device_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_bootstrap_devices_begin_resync_passwords(self, resource_group): + response = await ( + await self.client.network_bootstrap_devices.begin_resync_passwords( + resource_group_name=resource_group.name, + network_bootstrap_device_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_bootstrap_interfaces_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_bootstrap_interfaces_operations.py new file mode 100644 index 000000000000..75092040435d --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_bootstrap_interfaces_operations.py @@ -0,0 +1,119 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricNetworkBootstrapInterfacesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_bootstrap_interfaces_get(self, resource_group): + response = self.client.network_bootstrap_interfaces.get( + resource_group_name=resource_group.name, + network_bootstrap_device_name="str", + network_bootstrap_interface_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_bootstrap_interfaces_begin_create(self, resource_group): + response = self.client.network_bootstrap_interfaces.begin_create( + resource_group_name=resource_group.name, + network_bootstrap_device_name="str", + network_bootstrap_interface_name="str", + body={ + "properties": { + "additionalDescription": "str", + "administrativeState": "str", + "annotation": "str", + "configurationState": "str", + "connectedTo": "str", + "description": "str", + "interfaceType": "str", + "ipv4Address": "str", + "ipv6Address": "str", + "physicalIdentifier": "str", + "provisioningState": "str", + "serialNumber": "str", + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_bootstrap_interfaces_begin_update(self, resource_group): + response = self.client.network_bootstrap_interfaces.begin_update( + resource_group_name=resource_group.name, + network_bootstrap_device_name="str", + network_bootstrap_interface_name="str", + body={"properties": {"additionalDescription": "str", "annotation": "str", "serialNumber": "str"}}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_bootstrap_interfaces_begin_delete(self, resource_group): + response = self.client.network_bootstrap_interfaces.begin_delete( + resource_group_name=resource_group.name, + network_bootstrap_device_name="str", + network_bootstrap_interface_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_bootstrap_interfaces_list_by_network_bootstrap_device(self, resource_group): + response = self.client.network_bootstrap_interfaces.list_by_network_bootstrap_device( + resource_group_name=resource_group.name, + network_bootstrap_device_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_bootstrap_interfaces_begin_update_administrative_state(self, resource_group): + response = self.client.network_bootstrap_interfaces.begin_update_administrative_state( + resource_group_name=resource_group.name, + network_bootstrap_device_name="str", + network_bootstrap_interface_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_bootstrap_interfaces_operations_async.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_bootstrap_interfaces_operations_async.py new file mode 100644 index 000000000000..194c7b241c04 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_bootstrap_interfaces_operations_async.py @@ -0,0 +1,128 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric.aio import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricNetworkBootstrapInterfacesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_bootstrap_interfaces_get(self, resource_group): + response = await self.client.network_bootstrap_interfaces.get( + resource_group_name=resource_group.name, + network_bootstrap_device_name="str", + network_bootstrap_interface_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_bootstrap_interfaces_begin_create(self, resource_group): + response = await ( + await self.client.network_bootstrap_interfaces.begin_create( + resource_group_name=resource_group.name, + network_bootstrap_device_name="str", + network_bootstrap_interface_name="str", + body={ + "properties": { + "additionalDescription": "str", + "administrativeState": "str", + "annotation": "str", + "configurationState": "str", + "connectedTo": "str", + "description": "str", + "interfaceType": "str", + "ipv4Address": "str", + "ipv6Address": "str", + "physicalIdentifier": "str", + "provisioningState": "str", + "serialNumber": "str", + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_bootstrap_interfaces_begin_update(self, resource_group): + response = await ( + await self.client.network_bootstrap_interfaces.begin_update( + resource_group_name=resource_group.name, + network_bootstrap_device_name="str", + network_bootstrap_interface_name="str", + body={"properties": {"additionalDescription": "str", "annotation": "str", "serialNumber": "str"}}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_bootstrap_interfaces_begin_delete(self, resource_group): + response = await ( + await self.client.network_bootstrap_interfaces.begin_delete( + resource_group_name=resource_group.name, + network_bootstrap_device_name="str", + network_bootstrap_interface_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_bootstrap_interfaces_list_by_network_bootstrap_device(self, resource_group): + response = self.client.network_bootstrap_interfaces.list_by_network_bootstrap_device( + resource_group_name=resource_group.name, + network_bootstrap_device_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_bootstrap_interfaces_begin_update_administrative_state(self, resource_group): + response = await ( + await self.client.network_bootstrap_interfaces.begin_update_administrative_state( + resource_group_name=resource_group.name, + network_bootstrap_device_name="str", + network_bootstrap_interface_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_device_skus_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_device_skus_operations.py new file mode 100644 index 000000000000..65d7436a8d00 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_device_skus_operations.py @@ -0,0 +1,37 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricNetworkDeviceSkusOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_device_skus_get(self, resource_group): + response = self.client.network_device_skus.get( + network_device_sku_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_device_skus_list_by_subscription(self, resource_group): + response = self.client.network_device_skus.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_device_skus_operations_async.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_device_skus_operations_async.py new file mode 100644 index 000000000000..8437dbbc18ee --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_device_skus_operations_async.py @@ -0,0 +1,38 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric.aio import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricNetworkDeviceSkusOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_device_skus_get(self, resource_group): + response = await self.client.network_device_skus.get( + network_device_sku_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_device_skus_list_by_subscription(self, resource_group): + response = self.client.network_device_skus.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_devices_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_devices_operations.py new file mode 100644 index 000000000000..c3b2df406056 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_devices_operations.py @@ -0,0 +1,253 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricNetworkDevicesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_devices_get(self, resource_group): + response = self.client.network_devices.get( + resource_group_name=resource_group.name, + network_device_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_devices_begin_create(self, resource_group): + response = self.client.network_devices.begin_create( + resource_group_name=resource_group.name, + network_device_name="str", + body={ + "location": "str", + "properties": { + "serialNumber": "str", + "administrativeState": "str", + "annotation": "str", + "certificateRotationStatus": [ + { + "certificateArchiveReference": { + "certificateName": "str", + "certificateVersion": "str", + "keyVaultId": "str", + "keyVaultUri": "str", + }, + "certificateType": "str", + "expireTime": "2020-02-20 00:00:00", + "lastRotationTime": "2020-02-20 00:00:00", + "synchronizationStatus": "str", + } + ], + "configurationState": "str", + "hostName": "str", + "identitySelector": {"identityType": "str", "userAssignedIdentityResourceId": "str"}, + "lastOperation": {"details": "str"}, + "managementIpv4Address": "str", + "managementIpv6Address": "str", + "networkDeviceRole": "str", + "networkDeviceSku": "str", + "networkFabricId": "str", + "networkRackId": "str", + "provisioningState": "str", + "rwDeviceConfig": "str", + "secretRotationStatus": [ + { + "lastRotationTime": "2020-02-20 00:00:00", + "secretArchiveReference": { + "keyVaultId": "str", + "keyVaultUri": "str", + "secretName": "str", + "secretVersion": "str", + }, + "secretType": "str", + "synchronizationStatus": "str", + } + ], + "version": "str", + }, + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_devices_begin_update(self, resource_group): + response = self.client.network_devices.begin_update( + resource_group_name=resource_group.name, + network_device_name="str", + body={ + "identity": { + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "annotation": "str", + "hostName": "str", + "identitySelector": {"identityType": "str", "userAssignedIdentityResourceId": "str"}, + "serialNumber": "str", + }, + "tags": {"str": "str"}, + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_devices_begin_delete(self, resource_group): + response = self.client.network_devices.begin_delete( + resource_group_name=resource_group.name, + network_device_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_devices_list_by_resource_group(self, resource_group): + response = self.client.network_devices.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_devices_list_by_subscription(self, resource_group): + response = self.client.network_devices.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_devices_begin_reboot(self, resource_group): + response = self.client.network_devices.begin_reboot( + resource_group_name=resource_group.name, + network_device_name="str", + body={"rebootType": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_devices_begin_refresh_configuration(self, resource_group): + response = self.client.network_devices.begin_refresh_configuration( + resource_group_name=resource_group.name, + network_device_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_devices_begin_update_administrative_state(self, resource_group): + response = self.client.network_devices.begin_update_administrative_state( + resource_group_name=resource_group.name, + network_device_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_devices_begin_upgrade(self, resource_group): + response = self.client.network_devices.begin_upgrade( + resource_group_name=resource_group.name, + network_device_name="str", + body={"version": "str", "rwDeviceConfigUrl": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_devices_begin_run_ro_command(self, resource_group): + response = self.client.network_devices.begin_run_ro_command( + resource_group_name=resource_group.name, + network_device_name="str", + body={"command": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_devices_begin_run_rw_command(self, resource_group): + response = self.client.network_devices.begin_run_rw_command( + resource_group_name=resource_group.name, + network_device_name="str", + body={"command": "str", "commandUrl": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_devices_begin_resync_passwords(self, resource_group): + response = self.client.network_devices.begin_resync_passwords( + resource_group_name=resource_group.name, + network_device_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_devices_begin_resync_certificates(self, resource_group): + response = self.client.network_devices.begin_resync_certificates( + resource_group_name=resource_group.name, + network_device_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_devices_operations_async.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_devices_operations_async.py new file mode 100644 index 000000000000..127da0525ad3 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_devices_operations_async.py @@ -0,0 +1,276 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric.aio import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricNetworkDevicesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_devices_get(self, resource_group): + response = await self.client.network_devices.get( + resource_group_name=resource_group.name, + network_device_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_devices_begin_create(self, resource_group): + response = await ( + await self.client.network_devices.begin_create( + resource_group_name=resource_group.name, + network_device_name="str", + body={ + "location": "str", + "properties": { + "serialNumber": "str", + "administrativeState": "str", + "annotation": "str", + "certificateRotationStatus": [ + { + "certificateArchiveReference": { + "certificateName": "str", + "certificateVersion": "str", + "keyVaultId": "str", + "keyVaultUri": "str", + }, + "certificateType": "str", + "expireTime": "2020-02-20 00:00:00", + "lastRotationTime": "2020-02-20 00:00:00", + "synchronizationStatus": "str", + } + ], + "configurationState": "str", + "hostName": "str", + "identitySelector": {"identityType": "str", "userAssignedIdentityResourceId": "str"}, + "lastOperation": {"details": "str"}, + "managementIpv4Address": "str", + "managementIpv6Address": "str", + "networkDeviceRole": "str", + "networkDeviceSku": "str", + "networkFabricId": "str", + "networkRackId": "str", + "provisioningState": "str", + "rwDeviceConfig": "str", + "secretRotationStatus": [ + { + "lastRotationTime": "2020-02-20 00:00:00", + "secretArchiveReference": { + "keyVaultId": "str", + "keyVaultUri": "str", + "secretName": "str", + "secretVersion": "str", + }, + "secretType": "str", + "synchronizationStatus": "str", + } + ], + "version": "str", + }, + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_devices_begin_update(self, resource_group): + response = await ( + await self.client.network_devices.begin_update( + resource_group_name=resource_group.name, + network_device_name="str", + body={ + "identity": { + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "annotation": "str", + "hostName": "str", + "identitySelector": {"identityType": "str", "userAssignedIdentityResourceId": "str"}, + "serialNumber": "str", + }, + "tags": {"str": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_devices_begin_delete(self, resource_group): + response = await ( + await self.client.network_devices.begin_delete( + resource_group_name=resource_group.name, + network_device_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_devices_list_by_resource_group(self, resource_group): + response = self.client.network_devices.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_devices_list_by_subscription(self, resource_group): + response = self.client.network_devices.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_devices_begin_reboot(self, resource_group): + response = await ( + await self.client.network_devices.begin_reboot( + resource_group_name=resource_group.name, + network_device_name="str", + body={"rebootType": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_devices_begin_refresh_configuration(self, resource_group): + response = await ( + await self.client.network_devices.begin_refresh_configuration( + resource_group_name=resource_group.name, + network_device_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_devices_begin_update_administrative_state(self, resource_group): + response = await ( + await self.client.network_devices.begin_update_administrative_state( + resource_group_name=resource_group.name, + network_device_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_devices_begin_upgrade(self, resource_group): + response = await ( + await self.client.network_devices.begin_upgrade( + resource_group_name=resource_group.name, + network_device_name="str", + body={"version": "str", "rwDeviceConfigUrl": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_devices_begin_run_ro_command(self, resource_group): + response = await ( + await self.client.network_devices.begin_run_ro_command( + resource_group_name=resource_group.name, + network_device_name="str", + body={"command": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_devices_begin_run_rw_command(self, resource_group): + response = await ( + await self.client.network_devices.begin_run_rw_command( + resource_group_name=resource_group.name, + network_device_name="str", + body={"command": "str", "commandUrl": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_devices_begin_resync_passwords(self, resource_group): + response = await ( + await self.client.network_devices.begin_resync_passwords( + resource_group_name=resource_group.name, + network_device_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_devices_begin_resync_certificates(self, resource_group): + response = await ( + await self.client.network_devices.begin_resync_certificates( + resource_group_name=resource_group.name, + network_device_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_fabric_controllers_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_fabric_controllers_operations.py new file mode 100644 index 000000000000..04066ee1a31e --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_fabric_controllers_operations.py @@ -0,0 +1,137 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricNetworkFabricControllersOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabric_controllers_get(self, resource_group): + response = self.client.network_fabric_controllers.get( + resource_group_name=resource_group.name, + network_fabric_controller_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabric_controllers_begin_create(self, resource_group): + response = self.client.network_fabric_controllers.begin_create( + resource_group_name=resource_group.name, + network_fabric_controller_name="str", + body={ + "location": "str", + "properties": { + "annotation": "str", + "infrastructureExpressRouteConnections": [ + {"expressRouteAuthorizationKey": "str", "expressRouteCircuitId": "str"} + ], + "infrastructureServices": {"ipv4AddressSpaces": ["str"], "ipv6AddressSpaces": ["str"]}, + "ipv4AddressSpace": "str", + "ipv6AddressSpace": "str", + "isWorkloadManagementNetworkEnabled": "str", + "lastOperation": {"details": "str"}, + "managedResourceGroupConfiguration": {"location": "str", "name": "str"}, + "networkFabricIds": ["str"], + "nfcSku": "str", + "provisioningState": "str", + "tenantInternetGatewayIds": ["str"], + "workloadExpressRouteConnections": [ + {"expressRouteAuthorizationKey": "str", "expressRouteCircuitId": "str"} + ], + "workloadServices": {"ipv4AddressSpaces": ["str"], "ipv6AddressSpaces": ["str"]}, + }, + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabric_controllers_begin_update(self, resource_group): + response = self.client.network_fabric_controllers.begin_update( + resource_group_name=resource_group.name, + network_fabric_controller_name="str", + body={ + "identity": { + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "infrastructureExpressRouteConnections": [ + {"expressRouteAuthorizationKey": "str", "expressRouteCircuitId": "str"} + ], + "workloadExpressRouteConnections": [ + {"expressRouteAuthorizationKey": "str", "expressRouteCircuitId": "str"} + ], + }, + "tags": {"str": "str"}, + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabric_controllers_begin_delete(self, resource_group): + response = self.client.network_fabric_controllers.begin_delete( + resource_group_name=resource_group.name, + network_fabric_controller_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabric_controllers_list_by_resource_group(self, resource_group): + response = self.client.network_fabric_controllers.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabric_controllers_list_by_subscription(self, resource_group): + response = self.client.network_fabric_controllers.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_fabric_controllers_operations_async.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_fabric_controllers_operations_async.py new file mode 100644 index 000000000000..51c5c42749bf --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_fabric_controllers_operations_async.py @@ -0,0 +1,144 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric.aio import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricNetworkFabricControllersOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabric_controllers_get(self, resource_group): + response = await self.client.network_fabric_controllers.get( + resource_group_name=resource_group.name, + network_fabric_controller_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabric_controllers_begin_create(self, resource_group): + response = await ( + await self.client.network_fabric_controllers.begin_create( + resource_group_name=resource_group.name, + network_fabric_controller_name="str", + body={ + "location": "str", + "properties": { + "annotation": "str", + "infrastructureExpressRouteConnections": [ + {"expressRouteAuthorizationKey": "str", "expressRouteCircuitId": "str"} + ], + "infrastructureServices": {"ipv4AddressSpaces": ["str"], "ipv6AddressSpaces": ["str"]}, + "ipv4AddressSpace": "str", + "ipv6AddressSpace": "str", + "isWorkloadManagementNetworkEnabled": "str", + "lastOperation": {"details": "str"}, + "managedResourceGroupConfiguration": {"location": "str", "name": "str"}, + "networkFabricIds": ["str"], + "nfcSku": "str", + "provisioningState": "str", + "tenantInternetGatewayIds": ["str"], + "workloadExpressRouteConnections": [ + {"expressRouteAuthorizationKey": "str", "expressRouteCircuitId": "str"} + ], + "workloadServices": {"ipv4AddressSpaces": ["str"], "ipv6AddressSpaces": ["str"]}, + }, + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabric_controllers_begin_update(self, resource_group): + response = await ( + await self.client.network_fabric_controllers.begin_update( + resource_group_name=resource_group.name, + network_fabric_controller_name="str", + body={ + "identity": { + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "infrastructureExpressRouteConnections": [ + {"expressRouteAuthorizationKey": "str", "expressRouteCircuitId": "str"} + ], + "workloadExpressRouteConnections": [ + {"expressRouteAuthorizationKey": "str", "expressRouteCircuitId": "str"} + ], + }, + "tags": {"str": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabric_controllers_begin_delete(self, resource_group): + response = await ( + await self.client.network_fabric_controllers.begin_delete( + resource_group_name=resource_group.name, + network_fabric_controller_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabric_controllers_list_by_resource_group(self, resource_group): + response = self.client.network_fabric_controllers.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabric_controllers_list_by_subscription(self, resource_group): + response = self.client.network_fabric_controllers.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_fabric_skus_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_fabric_skus_operations.py new file mode 100644 index 000000000000..b88317c58ea4 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_fabric_skus_operations.py @@ -0,0 +1,37 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricNetworkFabricSkusOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabric_skus_get(self, resource_group): + response = self.client.network_fabric_skus.get( + network_fabric_sku_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabric_skus_list_by_subscription(self, resource_group): + response = self.client.network_fabric_skus.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_fabric_skus_operations_async.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_fabric_skus_operations_async.py new file mode 100644 index 000000000000..87620c0bec11 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_fabric_skus_operations_async.py @@ -0,0 +1,38 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric.aio import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricNetworkFabricSkusOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabric_skus_get(self, resource_group): + response = await self.client.network_fabric_skus.get( + network_fabric_sku_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabric_skus_list_by_subscription(self, resource_group): + response = self.client.network_fabric_skus.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_fabrics_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_fabrics_operations.py new file mode 100644 index 000000000000..3271b95061c9 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_fabrics_operations.py @@ -0,0 +1,524 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricNetworkFabricsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabrics_get(self, resource_group): + response = self.client.network_fabrics.get( + resource_group_name=resource_group.name, + network_fabric_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabrics_begin_create(self, resource_group): + response = self.client.network_fabrics.begin_create( + resource_group_name=resource_group.name, + network_fabric_name="str", + body={ + "location": "str", + "properties": { + "fabricASN": 0, + "ipv4Prefix": "str", + "managementNetworkConfiguration": { + "infrastructureVpnConfiguration": { + "peeringOption": "str", + "administrativeState": "str", + "networkToNetworkInterconnectId": "str", + "optionAProperties": { + "peerASN": 0, + "vlanId": 0, + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "mtu": 0, + "primaryIpv4Prefix": "str", + "primaryIpv6Prefix": "str", + "secondaryIpv4Prefix": "str", + "secondaryIpv6Prefix": "str", + }, + "optionBProperties": { + "exportRouteTargets": ["str"], + "importRouteTargets": ["str"], + "routeTargets": { + "exportIpv4RouteTargets": ["str"], + "exportIpv6RouteTargets": ["str"], + "importIpv4RouteTargets": ["str"], + "importIpv6RouteTargets": ["str"], + }, + }, + }, + "workloadVpnConfiguration": { + "peeringOption": "str", + "administrativeState": "str", + "networkToNetworkInterconnectId": "str", + "optionAProperties": { + "peerASN": 0, + "vlanId": 0, + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "mtu": 0, + "primaryIpv4Prefix": "str", + "primaryIpv6Prefix": "str", + "secondaryIpv4Prefix": "str", + "secondaryIpv6Prefix": "str", + }, + "optionBProperties": { + "exportRouteTargets": ["str"], + "importRouteTargets": ["str"], + "routeTargets": { + "exportIpv4RouteTargets": ["str"], + "exportIpv6RouteTargets": ["str"], + "importIpv4RouteTargets": ["str"], + "importIpv6RouteTargets": ["str"], + }, + }, + }, + }, + "networkFabricControllerId": "str", + "networkFabricSku": "str", + "serverCountPerRack": 0, + "terminalServerConfiguration": { + "password": "str", + "primaryIpv4Prefix": "str", + "secondaryIpv4Prefix": "str", + "username": "str", + "networkDeviceId": "str", + "primaryIpv6Prefix": "str", + "secondaryIpv6Prefix": "str", + "secretRotationStatus": [ + { + "lastRotationTime": "2020-02-20 00:00:00", + "secretArchiveReference": { + "keyVaultId": "str", + "keyVaultUri": "str", + "secretName": "str", + "secretVersion": "str", + }, + "secretType": "str", + "synchronizationStatus": "str", + } + ], + "serialNumber": "str", + }, + "activeCommitBatches": ["str"], + "administrativeState": "str", + "annotation": "str", + "authorizedTransceiver": {"key": "str", "vendor": "str"}, + "configurationState": "str", + "controlPlaneAcls": ["str"], + "fabricLocks": [{"lockState": "str", "lockType": "str"}], + "fabricVersion": "str", + "featureFlags": [{"featureFlagName": "str", "featureFlagValue": "str"}], + "hardwareAlertThreshold": 0, + "ipv6Prefix": "str", + "l2IsolationDomains": ["str"], + "l3IsolationDomains": ["str"], + "lastOperation": {"details": "str"}, + "provisioningState": "str", + "qosConfiguration": {"qosConfigurationState": "str"}, + "rackCount": 0, + "racks": ["str"], + "routerIds": ["str"], + "secretRotationSummary": {"activePasswordSetCount": 0}, + "storageAccountConfiguration": { + "storageAccountId": "str", + "storageAccountIdentity": {"identityType": "str", "userAssignedIdentityResourceId": "str"}, + }, + "storageArrayCount": 0, + "trustedIpPrefixes": ["str"], + "uniqueRdConfiguration": { + "nniDerivedUniqueRdConfigurationState": "str", + "uniqueRdConfigurationState": "str", + "uniqueRds": ["str"], + }, + }, + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabrics_begin_update(self, resource_group): + response = self.client.network_fabrics.begin_update( + resource_group_name=resource_group.name, + network_fabric_name="str", + body={ + "identity": { + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "annotation": "str", + "authorizedTransceiver": {"key": "str", "vendor": "str"}, + "controlPlaneAcls": ["str"], + "fabricASN": 0, + "featureFlags": [{"featureFlagName": "str", "featureFlagValue": "str"}], + "hardwareAlertThreshold": 0, + "ipv4Prefix": "str", + "ipv6Prefix": "str", + "managementNetworkConfiguration": { + "infrastructureVpnConfiguration": { + "networkToNetworkInterconnectId": "str", + "optionAProperties": { + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "mtu": 0, + "peerASN": 0, + "primaryIpv4Prefix": "str", + "primaryIpv6Prefix": "str", + "secondaryIpv4Prefix": "str", + "secondaryIpv6Prefix": "str", + "vlanId": 0, + }, + "optionBProperties": { + "exportRouteTargets": ["str"], + "importRouteTargets": ["str"], + "routeTargets": { + "exportIpv4RouteTargets": ["str"], + "exportIpv6RouteTargets": ["str"], + "importIpv4RouteTargets": ["str"], + "importIpv6RouteTargets": ["str"], + }, + }, + "peeringOption": "str", + }, + "workloadVpnConfiguration": { + "networkToNetworkInterconnectId": "str", + "optionAProperties": { + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "mtu": 0, + "peerASN": 0, + "primaryIpv4Prefix": "str", + "primaryIpv6Prefix": "str", + "secondaryIpv4Prefix": "str", + "secondaryIpv6Prefix": "str", + "vlanId": 0, + }, + "optionBProperties": { + "exportRouteTargets": ["str"], + "importRouteTargets": ["str"], + "routeTargets": { + "exportIpv4RouteTargets": ["str"], + "exportIpv6RouteTargets": ["str"], + "importIpv4RouteTargets": ["str"], + "importIpv6RouteTargets": ["str"], + }, + }, + "peeringOption": "str", + }, + }, + "qosConfiguration": {"qosConfigurationState": "str"}, + "rackCount": 0, + "serverCountPerRack": 0, + "storageAccountConfiguration": { + "storageAccountId": "str", + "storageAccountIdentity": {"identityType": "str", "userAssignedIdentityResourceId": "str"}, + }, + "terminalServerConfiguration": { + "password": "str", + "primaryIpv4Prefix": "str", + "primaryIpv6Prefix": "str", + "secondaryIpv4Prefix": "str", + "secondaryIpv6Prefix": "str", + "serialNumber": "str", + "username": "str", + }, + "trustedIpPrefixes": ["str"], + "uniqueRdConfiguration": { + "nniDerivedUniqueRdConfigurationState": "str", + "uniqueRdConfigurationState": "str", + }, + }, + "tags": {"str": "str"}, + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabrics_begin_delete(self, resource_group): + response = self.client.network_fabrics.begin_delete( + resource_group_name=resource_group.name, + network_fabric_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabrics_list_by_resource_group(self, resource_group): + response = self.client.network_fabrics.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabrics_list_by_subscription(self, resource_group): + response = self.client.network_fabrics.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabrics_begin_provision(self, resource_group): + response = self.client.network_fabrics.begin_provision( + resource_group_name=resource_group.name, + network_fabric_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabrics_begin_deprovision(self, resource_group): + response = self.client.network_fabrics.begin_deprovision( + resource_group_name=resource_group.name, + network_fabric_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabrics_begin_upgrade(self, resource_group): + response = self.client.network_fabrics.begin_upgrade( + resource_group_name=resource_group.name, + network_fabric_name="str", + body={"action": "str", "version": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabrics_begin_refresh_configuration(self, resource_group): + response = self.client.network_fabrics.begin_refresh_configuration( + resource_group_name=resource_group.name, + network_fabric_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabrics_begin_update_workload_management_bfd_configuration(self, resource_group): + response = self.client.network_fabrics.begin_update_workload_management_bfd_configuration( + resource_group_name=resource_group.name, + network_fabric_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabrics_begin_update_infra_management_bfd_configuration(self, resource_group): + response = self.client.network_fabrics.begin_update_infra_management_bfd_configuration( + resource_group_name=resource_group.name, + network_fabric_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabrics_begin_validate_configuration(self, resource_group): + response = self.client.network_fabrics.begin_validate_configuration( + resource_group_name=resource_group.name, + network_fabric_name="str", + body={"validateAction": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabrics_begin_get_topology(self, resource_group): + response = self.client.network_fabrics.begin_get_topology( + resource_group_name=resource_group.name, + network_fabric_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabrics_begin_commit_configuration(self, resource_group): + response = self.client.network_fabrics.begin_commit_configuration( + resource_group_name=resource_group.name, + network_fabric_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabrics_begin_commit_batch_status(self, resource_group): + response = self.client.network_fabrics.begin_commit_batch_status( + resource_group_name=resource_group.name, + network_fabric_name="str", + body={"commitBatchId": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabrics_begin_discard_commit_batch(self, resource_group): + response = self.client.network_fabrics.begin_discard_commit_batch( + resource_group_name=resource_group.name, + network_fabric_name="str", + body={"commitBatchId": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabrics_begin_lock_fabric(self, resource_group): + response = self.client.network_fabrics.begin_lock_fabric( + resource_group_name=resource_group.name, + network_fabric_name="str", + body={"action": "str", "lockType": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabrics_begin_view_device_configuration(self, resource_group): + response = self.client.network_fabrics.begin_view_device_configuration( + resource_group_name=resource_group.name, + network_fabric_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabrics_begin_arm_configuration_diff(self, resource_group): + response = self.client.network_fabrics.begin_arm_configuration_diff( + resource_group_name=resource_group.name, + network_fabric_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabrics_begin_rotate_passwords(self, resource_group): + response = self.client.network_fabrics.begin_rotate_passwords( + resource_group_name=resource_group.name, + network_fabric_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabrics_begin_resync_passwords(self, resource_group): + response = self.client.network_fabrics.begin_resync_passwords( + resource_group_name=resource_group.name, + network_fabric_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabrics_begin_rotate_certificates(self, resource_group): + response = self.client.network_fabrics.begin_rotate_certificates( + resource_group_name=resource_group.name, + network_fabric_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_fabrics_begin_resync_certificates(self, resource_group): + response = self.client.network_fabrics.begin_resync_certificates( + resource_group_name=resource_group.name, + network_fabric_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_fabrics_operations_async.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_fabrics_operations_async.py new file mode 100644 index 000000000000..558e09cc3848 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_fabrics_operations_async.py @@ -0,0 +1,567 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric.aio import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricNetworkFabricsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabrics_get(self, resource_group): + response = await self.client.network_fabrics.get( + resource_group_name=resource_group.name, + network_fabric_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabrics_begin_create(self, resource_group): + response = await ( + await self.client.network_fabrics.begin_create( + resource_group_name=resource_group.name, + network_fabric_name="str", + body={ + "location": "str", + "properties": { + "fabricASN": 0, + "ipv4Prefix": "str", + "managementNetworkConfiguration": { + "infrastructureVpnConfiguration": { + "peeringOption": "str", + "administrativeState": "str", + "networkToNetworkInterconnectId": "str", + "optionAProperties": { + "peerASN": 0, + "vlanId": 0, + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "mtu": 0, + "primaryIpv4Prefix": "str", + "primaryIpv6Prefix": "str", + "secondaryIpv4Prefix": "str", + "secondaryIpv6Prefix": "str", + }, + "optionBProperties": { + "exportRouteTargets": ["str"], + "importRouteTargets": ["str"], + "routeTargets": { + "exportIpv4RouteTargets": ["str"], + "exportIpv6RouteTargets": ["str"], + "importIpv4RouteTargets": ["str"], + "importIpv6RouteTargets": ["str"], + }, + }, + }, + "workloadVpnConfiguration": { + "peeringOption": "str", + "administrativeState": "str", + "networkToNetworkInterconnectId": "str", + "optionAProperties": { + "peerASN": 0, + "vlanId": 0, + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "mtu": 0, + "primaryIpv4Prefix": "str", + "primaryIpv6Prefix": "str", + "secondaryIpv4Prefix": "str", + "secondaryIpv6Prefix": "str", + }, + "optionBProperties": { + "exportRouteTargets": ["str"], + "importRouteTargets": ["str"], + "routeTargets": { + "exportIpv4RouteTargets": ["str"], + "exportIpv6RouteTargets": ["str"], + "importIpv4RouteTargets": ["str"], + "importIpv6RouteTargets": ["str"], + }, + }, + }, + }, + "networkFabricControllerId": "str", + "networkFabricSku": "str", + "serverCountPerRack": 0, + "terminalServerConfiguration": { + "password": "str", + "primaryIpv4Prefix": "str", + "secondaryIpv4Prefix": "str", + "username": "str", + "networkDeviceId": "str", + "primaryIpv6Prefix": "str", + "secondaryIpv6Prefix": "str", + "secretRotationStatus": [ + { + "lastRotationTime": "2020-02-20 00:00:00", + "secretArchiveReference": { + "keyVaultId": "str", + "keyVaultUri": "str", + "secretName": "str", + "secretVersion": "str", + }, + "secretType": "str", + "synchronizationStatus": "str", + } + ], + "serialNumber": "str", + }, + "activeCommitBatches": ["str"], + "administrativeState": "str", + "annotation": "str", + "authorizedTransceiver": {"key": "str", "vendor": "str"}, + "configurationState": "str", + "controlPlaneAcls": ["str"], + "fabricLocks": [{"lockState": "str", "lockType": "str"}], + "fabricVersion": "str", + "featureFlags": [{"featureFlagName": "str", "featureFlagValue": "str"}], + "hardwareAlertThreshold": 0, + "ipv6Prefix": "str", + "l2IsolationDomains": ["str"], + "l3IsolationDomains": ["str"], + "lastOperation": {"details": "str"}, + "provisioningState": "str", + "qosConfiguration": {"qosConfigurationState": "str"}, + "rackCount": 0, + "racks": ["str"], + "routerIds": ["str"], + "secretRotationSummary": {"activePasswordSetCount": 0}, + "storageAccountConfiguration": { + "storageAccountId": "str", + "storageAccountIdentity": {"identityType": "str", "userAssignedIdentityResourceId": "str"}, + }, + "storageArrayCount": 0, + "trustedIpPrefixes": ["str"], + "uniqueRdConfiguration": { + "nniDerivedUniqueRdConfigurationState": "str", + "uniqueRdConfigurationState": "str", + "uniqueRds": ["str"], + }, + }, + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabrics_begin_update(self, resource_group): + response = await ( + await self.client.network_fabrics.begin_update( + resource_group_name=resource_group.name, + network_fabric_name="str", + body={ + "identity": { + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "annotation": "str", + "authorizedTransceiver": {"key": "str", "vendor": "str"}, + "controlPlaneAcls": ["str"], + "fabricASN": 0, + "featureFlags": [{"featureFlagName": "str", "featureFlagValue": "str"}], + "hardwareAlertThreshold": 0, + "ipv4Prefix": "str", + "ipv6Prefix": "str", + "managementNetworkConfiguration": { + "infrastructureVpnConfiguration": { + "networkToNetworkInterconnectId": "str", + "optionAProperties": { + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "mtu": 0, + "peerASN": 0, + "primaryIpv4Prefix": "str", + "primaryIpv6Prefix": "str", + "secondaryIpv4Prefix": "str", + "secondaryIpv6Prefix": "str", + "vlanId": 0, + }, + "optionBProperties": { + "exportRouteTargets": ["str"], + "importRouteTargets": ["str"], + "routeTargets": { + "exportIpv4RouteTargets": ["str"], + "exportIpv6RouteTargets": ["str"], + "importIpv4RouteTargets": ["str"], + "importIpv6RouteTargets": ["str"], + }, + }, + "peeringOption": "str", + }, + "workloadVpnConfiguration": { + "networkToNetworkInterconnectId": "str", + "optionAProperties": { + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "mtu": 0, + "peerASN": 0, + "primaryIpv4Prefix": "str", + "primaryIpv6Prefix": "str", + "secondaryIpv4Prefix": "str", + "secondaryIpv6Prefix": "str", + "vlanId": 0, + }, + "optionBProperties": { + "exportRouteTargets": ["str"], + "importRouteTargets": ["str"], + "routeTargets": { + "exportIpv4RouteTargets": ["str"], + "exportIpv6RouteTargets": ["str"], + "importIpv4RouteTargets": ["str"], + "importIpv6RouteTargets": ["str"], + }, + }, + "peeringOption": "str", + }, + }, + "qosConfiguration": {"qosConfigurationState": "str"}, + "rackCount": 0, + "serverCountPerRack": 0, + "storageAccountConfiguration": { + "storageAccountId": "str", + "storageAccountIdentity": {"identityType": "str", "userAssignedIdentityResourceId": "str"}, + }, + "terminalServerConfiguration": { + "password": "str", + "primaryIpv4Prefix": "str", + "primaryIpv6Prefix": "str", + "secondaryIpv4Prefix": "str", + "secondaryIpv6Prefix": "str", + "serialNumber": "str", + "username": "str", + }, + "trustedIpPrefixes": ["str"], + "uniqueRdConfiguration": { + "nniDerivedUniqueRdConfigurationState": "str", + "uniqueRdConfigurationState": "str", + }, + }, + "tags": {"str": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabrics_begin_delete(self, resource_group): + response = await ( + await self.client.network_fabrics.begin_delete( + resource_group_name=resource_group.name, + network_fabric_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabrics_list_by_resource_group(self, resource_group): + response = self.client.network_fabrics.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabrics_list_by_subscription(self, resource_group): + response = self.client.network_fabrics.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabrics_begin_provision(self, resource_group): + response = await ( + await self.client.network_fabrics.begin_provision( + resource_group_name=resource_group.name, + network_fabric_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabrics_begin_deprovision(self, resource_group): + response = await ( + await self.client.network_fabrics.begin_deprovision( + resource_group_name=resource_group.name, + network_fabric_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabrics_begin_upgrade(self, resource_group): + response = await ( + await self.client.network_fabrics.begin_upgrade( + resource_group_name=resource_group.name, + network_fabric_name="str", + body={"action": "str", "version": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabrics_begin_refresh_configuration(self, resource_group): + response = await ( + await self.client.network_fabrics.begin_refresh_configuration( + resource_group_name=resource_group.name, + network_fabric_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabrics_begin_update_workload_management_bfd_configuration(self, resource_group): + response = await ( + await self.client.network_fabrics.begin_update_workload_management_bfd_configuration( + resource_group_name=resource_group.name, + network_fabric_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabrics_begin_update_infra_management_bfd_configuration(self, resource_group): + response = await ( + await self.client.network_fabrics.begin_update_infra_management_bfd_configuration( + resource_group_name=resource_group.name, + network_fabric_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabrics_begin_validate_configuration(self, resource_group): + response = await ( + await self.client.network_fabrics.begin_validate_configuration( + resource_group_name=resource_group.name, + network_fabric_name="str", + body={"validateAction": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabrics_begin_get_topology(self, resource_group): + response = await ( + await self.client.network_fabrics.begin_get_topology( + resource_group_name=resource_group.name, + network_fabric_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabrics_begin_commit_configuration(self, resource_group): + response = await ( + await self.client.network_fabrics.begin_commit_configuration( + resource_group_name=resource_group.name, + network_fabric_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabrics_begin_commit_batch_status(self, resource_group): + response = await ( + await self.client.network_fabrics.begin_commit_batch_status( + resource_group_name=resource_group.name, + network_fabric_name="str", + body={"commitBatchId": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabrics_begin_discard_commit_batch(self, resource_group): + response = await ( + await self.client.network_fabrics.begin_discard_commit_batch( + resource_group_name=resource_group.name, + network_fabric_name="str", + body={"commitBatchId": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabrics_begin_lock_fabric(self, resource_group): + response = await ( + await self.client.network_fabrics.begin_lock_fabric( + resource_group_name=resource_group.name, + network_fabric_name="str", + body={"action": "str", "lockType": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabrics_begin_view_device_configuration(self, resource_group): + response = await ( + await self.client.network_fabrics.begin_view_device_configuration( + resource_group_name=resource_group.name, + network_fabric_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabrics_begin_arm_configuration_diff(self, resource_group): + response = await ( + await self.client.network_fabrics.begin_arm_configuration_diff( + resource_group_name=resource_group.name, + network_fabric_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabrics_begin_rotate_passwords(self, resource_group): + response = await ( + await self.client.network_fabrics.begin_rotate_passwords( + resource_group_name=resource_group.name, + network_fabric_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabrics_begin_resync_passwords(self, resource_group): + response = await ( + await self.client.network_fabrics.begin_resync_passwords( + resource_group_name=resource_group.name, + network_fabric_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabrics_begin_rotate_certificates(self, resource_group): + response = await ( + await self.client.network_fabrics.begin_rotate_certificates( + resource_group_name=resource_group.name, + network_fabric_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_fabrics_begin_resync_certificates(self, resource_group): + response = await ( + await self.client.network_fabrics.begin_resync_certificates( + resource_group_name=resource_group.name, + network_fabric_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_interfaces_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_interfaces_operations.py new file mode 100644 index 000000000000..8fe471d47abd --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_interfaces_operations.py @@ -0,0 +1,132 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricNetworkInterfacesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_interfaces_get(self, resource_group): + response = self.client.network_interfaces.get( + resource_group_name=resource_group.name, + network_device_name="str", + network_interface_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_interfaces_begin_create(self, resource_group): + response = self.client.network_interfaces.begin_create( + resource_group_name=resource_group.name, + network_device_name="str", + network_interface_name="str", + body={ + "properties": { + "additionalDescription": "str", + "administrativeState": "str", + "annotation": "str", + "configurationState": "str", + "connectedTo": "str", + "description": "str", + "interfaceType": "str", + "ipv4Address": "str", + "ipv6Address": "str", + "lastOperation": {"details": "str"}, + "networkFabricId": "str", + "physicalIdentifier": "str", + "provisioningState": "str", + }, + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_interfaces_begin_update(self, resource_group): + response = self.client.network_interfaces.begin_update( + resource_group_name=resource_group.name, + network_device_name="str", + network_interface_name="str", + body={ + "identity": { + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": {"additionalDescription": "str", "annotation": "str"}, + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_interfaces_begin_delete(self, resource_group): + response = self.client.network_interfaces.begin_delete( + resource_group_name=resource_group.name, + network_device_name="str", + network_interface_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_interfaces_list_by_network_device(self, resource_group): + response = self.client.network_interfaces.list_by_network_device( + resource_group_name=resource_group.name, + network_device_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_interfaces_begin_update_administrative_state(self, resource_group): + response = self.client.network_interfaces.begin_update_administrative_state( + resource_group_name=resource_group.name, + network_device_name="str", + network_interface_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_interfaces_operations_async.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_interfaces_operations_async.py new file mode 100644 index 000000000000..935025811a24 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_interfaces_operations_async.py @@ -0,0 +1,141 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric.aio import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricNetworkInterfacesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_interfaces_get(self, resource_group): + response = await self.client.network_interfaces.get( + resource_group_name=resource_group.name, + network_device_name="str", + network_interface_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_interfaces_begin_create(self, resource_group): + response = await ( + await self.client.network_interfaces.begin_create( + resource_group_name=resource_group.name, + network_device_name="str", + network_interface_name="str", + body={ + "properties": { + "additionalDescription": "str", + "administrativeState": "str", + "annotation": "str", + "configurationState": "str", + "connectedTo": "str", + "description": "str", + "interfaceType": "str", + "ipv4Address": "str", + "ipv6Address": "str", + "lastOperation": {"details": "str"}, + "networkFabricId": "str", + "physicalIdentifier": "str", + "provisioningState": "str", + }, + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_interfaces_begin_update(self, resource_group): + response = await ( + await self.client.network_interfaces.begin_update( + resource_group_name=resource_group.name, + network_device_name="str", + network_interface_name="str", + body={ + "identity": { + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": {"additionalDescription": "str", "annotation": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_interfaces_begin_delete(self, resource_group): + response = await ( + await self.client.network_interfaces.begin_delete( + resource_group_name=resource_group.name, + network_device_name="str", + network_interface_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_interfaces_list_by_network_device(self, resource_group): + response = self.client.network_interfaces.list_by_network_device( + resource_group_name=resource_group.name, + network_device_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_interfaces_begin_update_administrative_state(self, resource_group): + response = await ( + await self.client.network_interfaces.begin_update_administrative_state( + resource_group_name=resource_group.name, + network_device_name="str", + network_interface_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_monitors_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_monitors_operations.py new file mode 100644 index 000000000000..cdb0adb6d46a --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_monitors_operations.py @@ -0,0 +1,148 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricNetworkMonitorsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_monitors_get(self, resource_group): + response = self.client.network_monitors.get( + resource_group_name=resource_group.name, + network_monitor_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_monitors_begin_create(self, resource_group): + response = self.client.network_monitors.begin_create( + resource_group_name=resource_group.name, + network_monitor_name="str", + body={ + "location": "str", + "properties": { + "administrativeState": "str", + "annotation": "str", + "bmpConfiguration": { + "exportPolicy": "str", + "exportPolicyConfiguration": {"exportPolicies": ["str"]}, + "monitoredAddressFamilies": ["str"], + "monitoredNetworks": ["str"], + "scopeResourceId": "str", + "stationConfigurationState": "str", + "stationConnectionMode": "str", + "stationConnectionProperties": {"keepaliveIdleTime": 0, "probeCount": 0, "probeInterval": 0}, + "stationIp": "str", + "stationName": "str", + "stationNetwork": "str", + "stationPort": 0, + }, + "configurationState": "str", + "lastOperation": {"details": "str"}, + "provisioningState": "str", + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_monitors_begin_update(self, resource_group): + response = self.client.network_monitors.begin_update( + resource_group_name=resource_group.name, + network_monitor_name="str", + body={ + "properties": { + "bmpConfiguration": { + "exportPolicy": "str", + "exportPolicyConfiguration": {"exportPolicies": ["str"]}, + "monitoredAddressFamilies": ["str"], + "monitoredNetworks": ["str"], + "scopeResourceId": "str", + "stationConfigurationState": "str", + "stationConnectionMode": "str", + "stationConnectionProperties": {"keepaliveIdleTime": 0, "probeCount": 0, "probeInterval": 0}, + "stationIp": "str", + "stationName": "str", + "stationNetwork": "str", + "stationPort": 0, + } + }, + "tags": {"str": "str"}, + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_monitors_begin_delete(self, resource_group): + response = self.client.network_monitors.begin_delete( + resource_group_name=resource_group.name, + network_monitor_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_monitors_list_by_resource_group(self, resource_group): + response = self.client.network_monitors.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_monitors_list_by_subscription(self, resource_group): + response = self.client.network_monitors.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_monitors_begin_update_administrative_state(self, resource_group): + response = self.client.network_monitors.begin_update_administrative_state( + resource_group_name=resource_group.name, + network_monitor_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_monitors_operations_async.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_monitors_operations_async.py new file mode 100644 index 000000000000..c84a02cf6a4c --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_monitors_operations_async.py @@ -0,0 +1,165 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric.aio import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricNetworkMonitorsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_monitors_get(self, resource_group): + response = await self.client.network_monitors.get( + resource_group_name=resource_group.name, + network_monitor_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_monitors_begin_create(self, resource_group): + response = await ( + await self.client.network_monitors.begin_create( + resource_group_name=resource_group.name, + network_monitor_name="str", + body={ + "location": "str", + "properties": { + "administrativeState": "str", + "annotation": "str", + "bmpConfiguration": { + "exportPolicy": "str", + "exportPolicyConfiguration": {"exportPolicies": ["str"]}, + "monitoredAddressFamilies": ["str"], + "monitoredNetworks": ["str"], + "scopeResourceId": "str", + "stationConfigurationState": "str", + "stationConnectionMode": "str", + "stationConnectionProperties": { + "keepaliveIdleTime": 0, + "probeCount": 0, + "probeInterval": 0, + }, + "stationIp": "str", + "stationName": "str", + "stationNetwork": "str", + "stationPort": 0, + }, + "configurationState": "str", + "lastOperation": {"details": "str"}, + "provisioningState": "str", + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_monitors_begin_update(self, resource_group): + response = await ( + await self.client.network_monitors.begin_update( + resource_group_name=resource_group.name, + network_monitor_name="str", + body={ + "properties": { + "bmpConfiguration": { + "exportPolicy": "str", + "exportPolicyConfiguration": {"exportPolicies": ["str"]}, + "monitoredAddressFamilies": ["str"], + "monitoredNetworks": ["str"], + "scopeResourceId": "str", + "stationConfigurationState": "str", + "stationConnectionMode": "str", + "stationConnectionProperties": { + "keepaliveIdleTime": 0, + "probeCount": 0, + "probeInterval": 0, + }, + "stationIp": "str", + "stationName": "str", + "stationNetwork": "str", + "stationPort": 0, + } + }, + "tags": {"str": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_monitors_begin_delete(self, resource_group): + response = await ( + await self.client.network_monitors.begin_delete( + resource_group_name=resource_group.name, + network_monitor_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_monitors_list_by_resource_group(self, resource_group): + response = self.client.network_monitors.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_monitors_list_by_subscription(self, resource_group): + response = self.client.network_monitors.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_monitors_begin_update_administrative_state(self, resource_group): + response = await ( + await self.client.network_monitors.begin_update_administrative_state( + resource_group_name=resource_group.name, + network_monitor_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_packet_brokers_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_packet_brokers_operations.py new file mode 100644 index 000000000000..6fd2b5e5de93 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_packet_brokers_operations.py @@ -0,0 +1,119 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricNetworkPacketBrokersOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_packet_brokers_get(self, resource_group): + response = self.client.network_packet_brokers.get( + resource_group_name=resource_group.name, + network_packet_broker_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_packet_brokers_begin_create(self, resource_group): + response = self.client.network_packet_brokers.begin_create( + resource_group_name=resource_group.name, + network_packet_broker_name="str", + body={ + "location": "str", + "properties": { + "networkFabricId": "str", + "configurationState": "str", + "lastOperation": {"details": "str"}, + "neighborGroupIds": ["str"], + "networkDeviceIds": ["str"], + "networkTapIds": ["str"], + "provisioningState": "str", + "sourceInterfaceIds": ["str"], + }, + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_packet_brokers_begin_update(self, resource_group): + response = self.client.network_packet_brokers.begin_update( + resource_group_name=resource_group.name, + network_packet_broker_name="str", + body={ + "identity": { + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "tags": {"str": "str"}, + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_packet_brokers_begin_delete(self, resource_group): + response = self.client.network_packet_brokers.begin_delete( + resource_group_name=resource_group.name, + network_packet_broker_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_packet_brokers_list_by_resource_group(self, resource_group): + response = self.client.network_packet_brokers.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_packet_brokers_list_by_subscription(self, resource_group): + response = self.client.network_packet_brokers.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_packet_brokers_operations_async.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_packet_brokers_operations_async.py new file mode 100644 index 000000000000..587aa871675f --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_packet_brokers_operations_async.py @@ -0,0 +1,126 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric.aio import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricNetworkPacketBrokersOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_packet_brokers_get(self, resource_group): + response = await self.client.network_packet_brokers.get( + resource_group_name=resource_group.name, + network_packet_broker_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_packet_brokers_begin_create(self, resource_group): + response = await ( + await self.client.network_packet_brokers.begin_create( + resource_group_name=resource_group.name, + network_packet_broker_name="str", + body={ + "location": "str", + "properties": { + "networkFabricId": "str", + "configurationState": "str", + "lastOperation": {"details": "str"}, + "neighborGroupIds": ["str"], + "networkDeviceIds": ["str"], + "networkTapIds": ["str"], + "provisioningState": "str", + "sourceInterfaceIds": ["str"], + }, + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_packet_brokers_begin_update(self, resource_group): + response = await ( + await self.client.network_packet_brokers.begin_update( + resource_group_name=resource_group.name, + network_packet_broker_name="str", + body={ + "identity": { + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "tags": {"str": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_packet_brokers_begin_delete(self, resource_group): + response = await ( + await self.client.network_packet_brokers.begin_delete( + resource_group_name=resource_group.name, + network_packet_broker_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_packet_brokers_list_by_resource_group(self, resource_group): + response = self.client.network_packet_brokers.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_packet_brokers_list_by_subscription(self, resource_group): + response = self.client.network_packet_brokers.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_racks_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_racks_operations.py new file mode 100644 index 000000000000..11c58ac4a2eb --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_racks_operations.py @@ -0,0 +1,106 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricNetworkRacksOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_racks_get(self, resource_group): + response = self.client.network_racks.get( + resource_group_name=resource_group.name, + network_rack_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_racks_begin_create(self, resource_group): + response = self.client.network_racks.begin_create( + resource_group_name=resource_group.name, + network_rack_name="str", + body={ + "location": "str", + "properties": { + "networkFabricId": "str", + "annotation": "str", + "configurationState": "str", + "lastOperation": {"details": "str"}, + "networkDevices": ["str"], + "networkRackType": "str", + "provisioningState": "str", + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_racks_begin_update(self, resource_group): + response = self.client.network_racks.begin_update( + resource_group_name=resource_group.name, + network_rack_name="str", + body={"tags": {"str": "str"}}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_racks_begin_delete(self, resource_group): + response = self.client.network_racks.begin_delete( + resource_group_name=resource_group.name, + network_rack_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_racks_list_by_resource_group(self, resource_group): + response = self.client.network_racks.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_racks_list_by_subscription(self, resource_group): + response = self.client.network_racks.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_racks_operations_async.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_racks_operations_async.py new file mode 100644 index 000000000000..a3845a07e445 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_racks_operations_async.py @@ -0,0 +1,113 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric.aio import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricNetworkRacksOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_racks_get(self, resource_group): + response = await self.client.network_racks.get( + resource_group_name=resource_group.name, + network_rack_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_racks_begin_create(self, resource_group): + response = await ( + await self.client.network_racks.begin_create( + resource_group_name=resource_group.name, + network_rack_name="str", + body={ + "location": "str", + "properties": { + "networkFabricId": "str", + "annotation": "str", + "configurationState": "str", + "lastOperation": {"details": "str"}, + "networkDevices": ["str"], + "networkRackType": "str", + "provisioningState": "str", + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_racks_begin_update(self, resource_group): + response = await ( + await self.client.network_racks.begin_update( + resource_group_name=resource_group.name, + network_rack_name="str", + body={"tags": {"str": "str"}}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_racks_begin_delete(self, resource_group): + response = await ( + await self.client.network_racks.begin_delete( + resource_group_name=resource_group.name, + network_rack_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_racks_list_by_resource_group(self, resource_group): + response = self.client.network_racks.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_racks_list_by_subscription(self, resource_group): + response = self.client.network_racks.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_tap_rules_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_tap_rules_operations.py new file mode 100644 index 000000000000..5377b31d43d3 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_tap_rules_operations.py @@ -0,0 +1,258 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricNetworkTapRulesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_tap_rules_get(self, resource_group): + response = self.client.network_tap_rules.get( + resource_group_name=resource_group.name, + network_tap_rule_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_tap_rules_begin_create(self, resource_group): + response = self.client.network_tap_rules.begin_create( + resource_group_name=resource_group.name, + network_tap_rule_name="str", + body={ + "location": "str", + "properties": { + "configurationType": "str", + "administrativeState": "str", + "annotation": "str", + "configurationState": "str", + "dynamicMatchConfigurations": [ + { + "ipGroups": [{"ipAddressType": "str", "ipPrefixes": ["str"], "name": "str"}], + "portGroups": [{"name": "str", "ports": ["str"]}], + "vlanGroups": [{"name": "str", "vlans": ["str"]}], + } + ], + "globalNetworkTapRuleActions": {"enableCount": "str", "truncate": "str"}, + "identitySelector": {"identityType": "str", "userAssignedIdentityResourceId": "str"}, + "lastOperation": {"details": "str"}, + "lastSyncedTime": "2020-02-20 00:00:00", + "matchConfigurations": [ + { + "actions": [ + { + "destinationId": "str", + "isTimestampEnabled": "str", + "matchConfigurationName": "str", + "truncate": "str", + "type": "str", + } + ], + "ipAddressType": "str", + "matchConditions": [ + { + "encapsulationType": "str", + "ipCondition": { + "ipGroupNames": ["str"], + "ipPrefixValues": ["str"], + "prefixType": "str", + "type": "str", + }, + "portCondition": { + "layer4Protocol": "str", + "portGroupNames": ["str"], + "portType": "str", + "ports": ["str"], + }, + "protocolTypes": ["str"], + "vlanMatchCondition": { + "innerVlans": ["str"], + "vlanGroupNames": ["str"], + "vlans": ["str"], + }, + } + ], + "matchConfigurationName": "str", + "sequenceNumber": 0, + } + ], + "networkFabricIds": ["str"], + "networkTapId": "str", + "networkTapIds": ["str"], + "pollingIntervalInSeconds": 0, + "provisioningState": "str", + "tapRulesUrl": "str", + }, + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_tap_rules_begin_update(self, resource_group): + response = self.client.network_tap_rules.begin_update( + resource_group_name=resource_group.name, + network_tap_rule_name="str", + body={ + "identity": { + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "annotation": "str", + "configurationType": "str", + "dynamicMatchConfigurations": [ + { + "ipGroups": [{"ipAddressType": "str", "ipPrefixes": ["str"], "name": "str"}], + "portGroups": [{"name": "str", "ports": ["str"]}], + "vlanGroups": [{"name": "str", "vlans": ["str"]}], + } + ], + "globalNetworkTapRuleActions": {"enableCount": "str", "truncate": "str"}, + "identitySelector": {"identityType": "str", "userAssignedIdentityResourceId": "str"}, + "matchConfigurations": [ + { + "actions": [ + { + "destinationId": "str", + "isTimestampEnabled": "str", + "matchConfigurationName": "str", + "truncate": "str", + "type": "str", + } + ], + "ipAddressType": "str", + "matchConditions": [ + { + "encapsulationType": "str", + "ipCondition": { + "ipGroupNames": ["str"], + "ipPrefixValues": ["str"], + "prefixType": "str", + "type": "str", + }, + "portCondition": { + "layer4Protocol": "str", + "portGroupNames": ["str"], + "portType": "str", + "ports": ["str"], + }, + "protocolTypes": ["str"], + "vlanMatchCondition": { + "innerVlans": ["str"], + "vlanGroupNames": ["str"], + "vlans": ["str"], + }, + } + ], + "matchConfigurationName": "str", + "sequenceNumber": 0, + } + ], + "tapRulesUrl": "str", + }, + "tags": {"str": "str"}, + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_tap_rules_begin_delete(self, resource_group): + response = self.client.network_tap_rules.begin_delete( + resource_group_name=resource_group.name, + network_tap_rule_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_tap_rules_list_by_resource_group(self, resource_group): + response = self.client.network_tap_rules.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_tap_rules_list_by_subscription(self, resource_group): + response = self.client.network_tap_rules.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_tap_rules_begin_update_administrative_state(self, resource_group): + response = self.client.network_tap_rules.begin_update_administrative_state( + resource_group_name=resource_group.name, + network_tap_rule_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_tap_rules_begin_resync(self, resource_group): + response = self.client.network_tap_rules.begin_resync( + resource_group_name=resource_group.name, + network_tap_rule_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_tap_rules_begin_validate_configuration(self, resource_group): + response = self.client.network_tap_rules.begin_validate_configuration( + resource_group_name=resource_group.name, + network_tap_rule_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_tap_rules_operations_async.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_tap_rules_operations_async.py new file mode 100644 index 000000000000..22f5e176b2dd --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_tap_rules_operations_async.py @@ -0,0 +1,271 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric.aio import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricNetworkTapRulesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_tap_rules_get(self, resource_group): + response = await self.client.network_tap_rules.get( + resource_group_name=resource_group.name, + network_tap_rule_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_tap_rules_begin_create(self, resource_group): + response = await ( + await self.client.network_tap_rules.begin_create( + resource_group_name=resource_group.name, + network_tap_rule_name="str", + body={ + "location": "str", + "properties": { + "configurationType": "str", + "administrativeState": "str", + "annotation": "str", + "configurationState": "str", + "dynamicMatchConfigurations": [ + { + "ipGroups": [{"ipAddressType": "str", "ipPrefixes": ["str"], "name": "str"}], + "portGroups": [{"name": "str", "ports": ["str"]}], + "vlanGroups": [{"name": "str", "vlans": ["str"]}], + } + ], + "globalNetworkTapRuleActions": {"enableCount": "str", "truncate": "str"}, + "identitySelector": {"identityType": "str", "userAssignedIdentityResourceId": "str"}, + "lastOperation": {"details": "str"}, + "lastSyncedTime": "2020-02-20 00:00:00", + "matchConfigurations": [ + { + "actions": [ + { + "destinationId": "str", + "isTimestampEnabled": "str", + "matchConfigurationName": "str", + "truncate": "str", + "type": "str", + } + ], + "ipAddressType": "str", + "matchConditions": [ + { + "encapsulationType": "str", + "ipCondition": { + "ipGroupNames": ["str"], + "ipPrefixValues": ["str"], + "prefixType": "str", + "type": "str", + }, + "portCondition": { + "layer4Protocol": "str", + "portGroupNames": ["str"], + "portType": "str", + "ports": ["str"], + }, + "protocolTypes": ["str"], + "vlanMatchCondition": { + "innerVlans": ["str"], + "vlanGroupNames": ["str"], + "vlans": ["str"], + }, + } + ], + "matchConfigurationName": "str", + "sequenceNumber": 0, + } + ], + "networkFabricIds": ["str"], + "networkTapId": "str", + "networkTapIds": ["str"], + "pollingIntervalInSeconds": 0, + "provisioningState": "str", + "tapRulesUrl": "str", + }, + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_tap_rules_begin_update(self, resource_group): + response = await ( + await self.client.network_tap_rules.begin_update( + resource_group_name=resource_group.name, + network_tap_rule_name="str", + body={ + "identity": { + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "annotation": "str", + "configurationType": "str", + "dynamicMatchConfigurations": [ + { + "ipGroups": [{"ipAddressType": "str", "ipPrefixes": ["str"], "name": "str"}], + "portGroups": [{"name": "str", "ports": ["str"]}], + "vlanGroups": [{"name": "str", "vlans": ["str"]}], + } + ], + "globalNetworkTapRuleActions": {"enableCount": "str", "truncate": "str"}, + "identitySelector": {"identityType": "str", "userAssignedIdentityResourceId": "str"}, + "matchConfigurations": [ + { + "actions": [ + { + "destinationId": "str", + "isTimestampEnabled": "str", + "matchConfigurationName": "str", + "truncate": "str", + "type": "str", + } + ], + "ipAddressType": "str", + "matchConditions": [ + { + "encapsulationType": "str", + "ipCondition": { + "ipGroupNames": ["str"], + "ipPrefixValues": ["str"], + "prefixType": "str", + "type": "str", + }, + "portCondition": { + "layer4Protocol": "str", + "portGroupNames": ["str"], + "portType": "str", + "ports": ["str"], + }, + "protocolTypes": ["str"], + "vlanMatchCondition": { + "innerVlans": ["str"], + "vlanGroupNames": ["str"], + "vlans": ["str"], + }, + } + ], + "matchConfigurationName": "str", + "sequenceNumber": 0, + } + ], + "tapRulesUrl": "str", + }, + "tags": {"str": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_tap_rules_begin_delete(self, resource_group): + response = await ( + await self.client.network_tap_rules.begin_delete( + resource_group_name=resource_group.name, + network_tap_rule_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_tap_rules_list_by_resource_group(self, resource_group): + response = self.client.network_tap_rules.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_tap_rules_list_by_subscription(self, resource_group): + response = self.client.network_tap_rules.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_tap_rules_begin_update_administrative_state(self, resource_group): + response = await ( + await self.client.network_tap_rules.begin_update_administrative_state( + resource_group_name=resource_group.name, + network_tap_rule_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_tap_rules_begin_resync(self, resource_group): + response = await ( + await self.client.network_tap_rules.begin_resync( + resource_group_name=resource_group.name, + network_tap_rule_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_tap_rules_begin_validate_configuration(self, resource_group): + response = await ( + await self.client.network_tap_rules.begin_validate_configuration( + resource_group_name=resource_group.name, + network_tap_rule_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_taps_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_taps_operations.py new file mode 100644 index 000000000000..9df635a8ee51 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_taps_operations.py @@ -0,0 +1,165 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricNetworkTapsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_taps_get(self, resource_group): + response = self.client.network_taps.get( + resource_group_name=resource_group.name, + network_tap_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_taps_begin_create(self, resource_group): + response = self.client.network_taps.begin_create( + resource_group_name=resource_group.name, + network_tap_name="str", + body={ + "location": "str", + "properties": { + "destinations": [ + { + "destinationId": "str", + "destinationType": "str", + "name": "str", + "destinationTapRuleId": "str", + "isolationDomainProperties": {"encapsulation": "str", "neighborGroupIds": ["str"]}, + } + ], + "networkPacketBrokerId": "str", + "administrativeState": "str", + "annotation": "str", + "configurationState": "str", + "lastOperation": {"details": "str"}, + "networkFabricIds": ["str"], + "pollingType": "str", + "provisioningState": "str", + "sourceTapRuleId": "str", + }, + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_taps_begin_update(self, resource_group): + response = self.client.network_taps.begin_update( + resource_group_name=resource_group.name, + network_tap_name="str", + body={ + "identity": { + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "annotation": "str", + "destinations": [ + { + "destinationId": "str", + "destinationTapRuleId": "str", + "destinationType": "str", + "isolationDomainProperties": {"encapsulation": "str", "neighborGroupIds": ["str"]}, + "name": "str", + } + ], + "pollingType": "str", + }, + "tags": {"str": "str"}, + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_taps_begin_delete(self, resource_group): + response = self.client.network_taps.begin_delete( + resource_group_name=resource_group.name, + network_tap_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_taps_list_by_resource_group(self, resource_group): + response = self.client.network_taps.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_taps_list_by_subscription(self, resource_group): + response = self.client.network_taps.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_taps_begin_update_administrative_state(self, resource_group): + response = self.client.network_taps.begin_update_administrative_state( + resource_group_name=resource_group.name, + network_tap_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_taps_begin_resync(self, resource_group): + response = self.client.network_taps.begin_resync( + resource_group_name=resource_group.name, + network_tap_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_taps_operations_async.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_taps_operations_async.py new file mode 100644 index 000000000000..55b1995fb26a --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_taps_operations_async.py @@ -0,0 +1,176 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric.aio import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricNetworkTapsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_taps_get(self, resource_group): + response = await self.client.network_taps.get( + resource_group_name=resource_group.name, + network_tap_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_taps_begin_create(self, resource_group): + response = await ( + await self.client.network_taps.begin_create( + resource_group_name=resource_group.name, + network_tap_name="str", + body={ + "location": "str", + "properties": { + "destinations": [ + { + "destinationId": "str", + "destinationType": "str", + "name": "str", + "destinationTapRuleId": "str", + "isolationDomainProperties": {"encapsulation": "str", "neighborGroupIds": ["str"]}, + } + ], + "networkPacketBrokerId": "str", + "administrativeState": "str", + "annotation": "str", + "configurationState": "str", + "lastOperation": {"details": "str"}, + "networkFabricIds": ["str"], + "pollingType": "str", + "provisioningState": "str", + "sourceTapRuleId": "str", + }, + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_taps_begin_update(self, resource_group): + response = await ( + await self.client.network_taps.begin_update( + resource_group_name=resource_group.name, + network_tap_name="str", + body={ + "identity": { + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "annotation": "str", + "destinations": [ + { + "destinationId": "str", + "destinationTapRuleId": "str", + "destinationType": "str", + "isolationDomainProperties": {"encapsulation": "str", "neighborGroupIds": ["str"]}, + "name": "str", + } + ], + "pollingType": "str", + }, + "tags": {"str": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_taps_begin_delete(self, resource_group): + response = await ( + await self.client.network_taps.begin_delete( + resource_group_name=resource_group.name, + network_tap_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_taps_list_by_resource_group(self, resource_group): + response = self.client.network_taps.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_taps_list_by_subscription(self, resource_group): + response = self.client.network_taps.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_taps_begin_update_administrative_state(self, resource_group): + response = await ( + await self.client.network_taps.begin_update_administrative_state( + resource_group_name=resource_group.name, + network_tap_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_taps_begin_resync(self, resource_group): + response = await ( + await self.client.network_taps.begin_resync( + resource_group_name=resource_group.name, + network_tap_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_to_network_interconnects_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_to_network_interconnects_operations.py new file mode 100644 index 000000000000..d35ce971eb33 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_to_network_interconnects_operations.py @@ -0,0 +1,231 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricNetworkToNetworkInterconnectsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_to_network_interconnects_get(self, resource_group): + response = self.client.network_to_network_interconnects.get( + resource_group_name=resource_group.name, + network_fabric_name="str", + network_to_network_interconnect_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_to_network_interconnects_begin_create(self, resource_group): + response = self.client.network_to_network_interconnects.begin_create( + resource_group_name=resource_group.name, + network_fabric_name="str", + network_to_network_interconnect_name="str", + body={ + "properties": { + "useOptionB": "str", + "administrativeState": "str", + "conditionalDefaultRouteConfiguration": { + "ipv4Routes": [{"nextHop": ["str"], "prefix": "str"}], + "ipv6Routes": [{"nextHop": ["str"], "prefix": "str"}], + }, + "configurationState": "str", + "egressAclId": "str", + "exportRoutePolicy": {"exportIpv4RoutePolicyId": "str", "exportIpv6RoutePolicyId": "str"}, + "importRoutePolicy": {"importIpv4RoutePolicyId": "str", "importIpv6RoutePolicyId": "str"}, + "ingressAclId": "str", + "isManagementType": "str", + "lastOperation": {"details": "str"}, + "layer2Configuration": {"interfaces": ["str"], "mtu": 0}, + "microBfdState": "str", + "nniType": "str", + "npbStaticRouteConfiguration": { + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "ipv4Routes": [{"nextHop": ["str"], "prefix": "str"}], + "ipv6Routes": [{"nextHop": ["str"], "prefix": "str"}], + }, + "optionBLayer3Configuration": { + "peerASN": 0, + "vlanId": 0, + "bmpConfiguration": {"configurationState": "str"}, + "fabricASN": 0, + "peLoopbackIpAddress": ["str"], + "prefixLimits": [{"maximumRoutes": 0}], + "primaryIpv4Prefix": "str", + "primaryIpv6Prefix": "str", + "secondaryIpv4Prefix": "str", + "secondaryIpv6Prefix": "str", + }, + "provisioningState": "str", + "staticRouteConfiguration": { + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "ipv4Routes": [{"nextHop": ["str"], "prefix": "str"}], + "ipv6Routes": [{"nextHop": ["str"], "prefix": "str"}], + }, + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_to_network_interconnects_begin_update(self, resource_group): + response = self.client.network_to_network_interconnects.begin_update( + resource_group_name=resource_group.name, + network_fabric_name="str", + network_to_network_interconnect_name="str", + body={ + "id": "str", + "properties": { + "egressAclId": "str", + "exportRoutePolicy": {"exportIpv4RoutePolicyId": "str", "exportIpv6RoutePolicyId": "str"}, + "importRoutePolicy": {"importIpv4RoutePolicyId": "str", "importIpv6RoutePolicyId": "str"}, + "ingressAclId": "str", + "layer2Configuration": {"interfaces": ["str"], "mtu": 0}, + "microBfdState": "str", + "npbStaticRouteConfiguration": { + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "ipv4Routes": [{"nextHop": ["str"], "prefix": "str"}], + "ipv6Routes": [{"nextHop": ["str"], "prefix": "str"}], + }, + "optionBLayer3Configuration": { + "bmpConfiguration": {"configurationState": "str"}, + "fabricASN": 0, + "peLoopbackIpAddress": ["str"], + "peerASN": 0, + "prefixLimits": [{"maximumRoutes": 0}], + "primaryIpv4Prefix": "str", + "primaryIpv6Prefix": "str", + "secondaryIpv4Prefix": "str", + "secondaryIpv6Prefix": "str", + "vlanId": 0, + }, + "staticRouteConfiguration": { + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "ipv4Routes": [{"nextHop": ["str"], "prefix": "str"}], + "ipv6Routes": [{"nextHop": ["str"], "prefix": "str"}], + }, + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_to_network_interconnects_begin_delete(self, resource_group): + response = self.client.network_to_network_interconnects.begin_delete( + resource_group_name=resource_group.name, + network_fabric_name="str", + network_to_network_interconnect_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_to_network_interconnects_list_by_network_fabric(self, resource_group): + response = self.client.network_to_network_interconnects.list_by_network_fabric( + resource_group_name=resource_group.name, + network_fabric_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_to_network_interconnects_begin_update_npb_static_route_bfd_administrative_state( + self, resource_group + ): + response = self.client.network_to_network_interconnects.begin_update_npb_static_route_bfd_administrative_state( + resource_group_name=resource_group.name, + network_fabric_name="str", + network_to_network_interconnect_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_to_network_interconnects_begin_update_administrative_state(self, resource_group): + response = self.client.network_to_network_interconnects.begin_update_administrative_state( + resource_group_name=resource_group.name, + network_fabric_name="str", + network_to_network_interconnect_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_network_to_network_interconnects_begin_update_bfd_administrative_state(self, resource_group): + response = self.client.network_to_network_interconnects.begin_update_bfd_administrative_state( + resource_group_name=resource_group.name, + network_fabric_name="str", + network_to_network_interconnect_name="str", + body={"administrativeState": "str", "routeType": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_to_network_interconnects_operations_async.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_to_network_interconnects_operations_async.py new file mode 100644 index 000000000000..aa653e5302ff --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_network_to_network_interconnects_operations_async.py @@ -0,0 +1,244 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric.aio import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricNetworkToNetworkInterconnectsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_to_network_interconnects_get(self, resource_group): + response = await self.client.network_to_network_interconnects.get( + resource_group_name=resource_group.name, + network_fabric_name="str", + network_to_network_interconnect_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_to_network_interconnects_begin_create(self, resource_group): + response = await ( + await self.client.network_to_network_interconnects.begin_create( + resource_group_name=resource_group.name, + network_fabric_name="str", + network_to_network_interconnect_name="str", + body={ + "properties": { + "useOptionB": "str", + "administrativeState": "str", + "conditionalDefaultRouteConfiguration": { + "ipv4Routes": [{"nextHop": ["str"], "prefix": "str"}], + "ipv6Routes": [{"nextHop": ["str"], "prefix": "str"}], + }, + "configurationState": "str", + "egressAclId": "str", + "exportRoutePolicy": {"exportIpv4RoutePolicyId": "str", "exportIpv6RoutePolicyId": "str"}, + "importRoutePolicy": {"importIpv4RoutePolicyId": "str", "importIpv6RoutePolicyId": "str"}, + "ingressAclId": "str", + "isManagementType": "str", + "lastOperation": {"details": "str"}, + "layer2Configuration": {"interfaces": ["str"], "mtu": 0}, + "microBfdState": "str", + "nniType": "str", + "npbStaticRouteConfiguration": { + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "ipv4Routes": [{"nextHop": ["str"], "prefix": "str"}], + "ipv6Routes": [{"nextHop": ["str"], "prefix": "str"}], + }, + "optionBLayer3Configuration": { + "peerASN": 0, + "vlanId": 0, + "bmpConfiguration": {"configurationState": "str"}, + "fabricASN": 0, + "peLoopbackIpAddress": ["str"], + "prefixLimits": [{"maximumRoutes": 0}], + "primaryIpv4Prefix": "str", + "primaryIpv6Prefix": "str", + "secondaryIpv4Prefix": "str", + "secondaryIpv6Prefix": "str", + }, + "provisioningState": "str", + "staticRouteConfiguration": { + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "ipv4Routes": [{"nextHop": ["str"], "prefix": "str"}], + "ipv6Routes": [{"nextHop": ["str"], "prefix": "str"}], + }, + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_to_network_interconnects_begin_update(self, resource_group): + response = await ( + await self.client.network_to_network_interconnects.begin_update( + resource_group_name=resource_group.name, + network_fabric_name="str", + network_to_network_interconnect_name="str", + body={ + "id": "str", + "properties": { + "egressAclId": "str", + "exportRoutePolicy": {"exportIpv4RoutePolicyId": "str", "exportIpv6RoutePolicyId": "str"}, + "importRoutePolicy": {"importIpv4RoutePolicyId": "str", "importIpv6RoutePolicyId": "str"}, + "ingressAclId": "str", + "layer2Configuration": {"interfaces": ["str"], "mtu": 0}, + "microBfdState": "str", + "npbStaticRouteConfiguration": { + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "ipv4Routes": [{"nextHop": ["str"], "prefix": "str"}], + "ipv6Routes": [{"nextHop": ["str"], "prefix": "str"}], + }, + "optionBLayer3Configuration": { + "bmpConfiguration": {"configurationState": "str"}, + "fabricASN": 0, + "peLoopbackIpAddress": ["str"], + "peerASN": 0, + "prefixLimits": [{"maximumRoutes": 0}], + "primaryIpv4Prefix": "str", + "primaryIpv6Prefix": "str", + "secondaryIpv4Prefix": "str", + "secondaryIpv6Prefix": "str", + "vlanId": 0, + }, + "staticRouteConfiguration": { + "bfdConfiguration": { + "administrativeState": "str", + "intervalInMilliSeconds": 0, + "multiplier": 0, + }, + "ipv4Routes": [{"nextHop": ["str"], "prefix": "str"}], + "ipv6Routes": [{"nextHop": ["str"], "prefix": "str"}], + }, + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_to_network_interconnects_begin_delete(self, resource_group): + response = await ( + await self.client.network_to_network_interconnects.begin_delete( + resource_group_name=resource_group.name, + network_fabric_name="str", + network_to_network_interconnect_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_to_network_interconnects_list_by_network_fabric(self, resource_group): + response = self.client.network_to_network_interconnects.list_by_network_fabric( + resource_group_name=resource_group.name, + network_fabric_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_to_network_interconnects_begin_update_npb_static_route_bfd_administrative_state( + self, resource_group + ): + response = await ( + await self.client.network_to_network_interconnects.begin_update_npb_static_route_bfd_administrative_state( + resource_group_name=resource_group.name, + network_fabric_name="str", + network_to_network_interconnect_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_to_network_interconnects_begin_update_administrative_state(self, resource_group): + response = await ( + await self.client.network_to_network_interconnects.begin_update_administrative_state( + resource_group_name=resource_group.name, + network_fabric_name="str", + network_to_network_interconnect_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_network_to_network_interconnects_begin_update_bfd_administrative_state(self, resource_group): + response = await ( + await self.client.network_to_network_interconnects.begin_update_bfd_administrative_state( + resource_group_name=resource_group.name, + network_fabric_name="str", + network_to_network_interconnect_name="str", + body={"administrativeState": "str", "routeType": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_operations.py new file mode 100644 index 000000000000..52364f12b21b --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_operations.py @@ -0,0 +1,27 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_operations_list(self, resource_group): + response = self.client.operations.list() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_operations_async.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_operations_async.py new file mode 100644 index 000000000000..06062bff7670 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_operations_async.py @@ -0,0 +1,28 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric.aio import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_operations_list(self, resource_group): + response = self.client.operations.list() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_route_policies_operations.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_route_policies_operations.py new file mode 100644 index 000000000000..5c7ab16a458a --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_route_policies_operations.py @@ -0,0 +1,198 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricRoutePoliciesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_route_policies_get(self, resource_group): + response = self.client.route_policies.get( + resource_group_name=resource_group.name, + route_policy_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_route_policies_begin_create(self, resource_group): + response = self.client.route_policies.begin_create( + resource_group_name=resource_group.name, + route_policy_name="str", + body={ + "location": "str", + "properties": { + "networkFabricId": "str", + "statements": [ + { + "action": { + "actionType": "str", + "ipCommunityProperties": { + "add": {"ipCommunityIds": ["str"]}, + "delete": {"ipCommunityIds": ["str"]}, + "set": {"ipCommunityIds": ["str"]}, + }, + "ipExtendedCommunityProperties": { + "add": {"ipExtendedCommunityIds": ["str"]}, + "delete": {"ipExtendedCommunityIds": ["str"]}, + "set": {"ipExtendedCommunityIds": ["str"]}, + }, + "localPreference": 0, + }, + "condition": { + "ipCommunityIds": ["str"], + "ipExtendedCommunityIds": ["str"], + "ipPrefixId": "str", + "type": "str", + }, + "sequenceNumber": 0, + "annotation": "str", + } + ], + "addressFamilyType": "str", + "administrativeState": "str", + "annotation": "str", + "configurationState": "str", + "defaultAction": "str", + "lastOperation": {"details": "str"}, + "provisioningState": "str", + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_route_policies_begin_update(self, resource_group): + response = self.client.route_policies.begin_update( + resource_group_name=resource_group.name, + route_policy_name="str", + body={ + "properties": { + "defaultAction": "str", + "statements": [ + { + "action": { + "actionType": "str", + "ipCommunityProperties": { + "add": {"ipCommunityIds": ["str"]}, + "delete": {"ipCommunityIds": ["str"]}, + "set": {"ipCommunityIds": ["str"]}, + }, + "ipExtendedCommunityProperties": { + "add": {"ipExtendedCommunityIds": ["str"]}, + "delete": {"ipExtendedCommunityIds": ["str"]}, + "set": {"ipExtendedCommunityIds": ["str"]}, + }, + "localPreference": 0, + }, + "condition": { + "ipCommunityIds": ["str"], + "ipExtendedCommunityIds": ["str"], + "ipPrefixId": "str", + "type": "str", + }, + "sequenceNumber": 0, + "annotation": "str", + } + ], + }, + "tags": {"str": "str"}, + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_route_policies_begin_delete(self, resource_group): + response = self.client.route_policies.begin_delete( + resource_group_name=resource_group.name, + route_policy_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_route_policies_list_by_resource_group(self, resource_group): + response = self.client.route_policies.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_route_policies_list_by_subscription(self, resource_group): + response = self.client.route_policies.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_route_policies_begin_update_administrative_state(self, resource_group): + response = self.client.route_policies.begin_update_administrative_state( + resource_group_name=resource_group.name, + route_policy_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_route_policies_begin_validate_configuration(self, resource_group): + response = self.client.route_policies.begin_validate_configuration( + resource_group_name=resource_group.name, + route_policy_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_route_policies_begin_commit_configuration(self, resource_group): + response = self.client.route_policies.begin_commit_configuration( + resource_group_name=resource_group.name, + route_policy_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_route_policies_operations_async.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_route_policies_operations_async.py new file mode 100644 index 000000000000..3109ea30d4b4 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/generated_tests/test_managed_network_fabric_route_policies_operations_async.py @@ -0,0 +1,211 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.managednetworkfabric.aio import ManagedNetworkFabricClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestManagedNetworkFabricRoutePoliciesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ManagedNetworkFabricClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_route_policies_get(self, resource_group): + response = await self.client.route_policies.get( + resource_group_name=resource_group.name, + route_policy_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_route_policies_begin_create(self, resource_group): + response = await ( + await self.client.route_policies.begin_create( + resource_group_name=resource_group.name, + route_policy_name="str", + body={ + "location": "str", + "properties": { + "networkFabricId": "str", + "statements": [ + { + "action": { + "actionType": "str", + "ipCommunityProperties": { + "add": {"ipCommunityIds": ["str"]}, + "delete": {"ipCommunityIds": ["str"]}, + "set": {"ipCommunityIds": ["str"]}, + }, + "ipExtendedCommunityProperties": { + "add": {"ipExtendedCommunityIds": ["str"]}, + "delete": {"ipExtendedCommunityIds": ["str"]}, + "set": {"ipExtendedCommunityIds": ["str"]}, + }, + "localPreference": 0, + }, + "condition": { + "ipCommunityIds": ["str"], + "ipExtendedCommunityIds": ["str"], + "ipPrefixId": "str", + "type": "str", + }, + "sequenceNumber": 0, + "annotation": "str", + } + ], + "addressFamilyType": "str", + "administrativeState": "str", + "annotation": "str", + "configurationState": "str", + "defaultAction": "str", + "lastOperation": {"details": "str"}, + "provisioningState": "str", + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_route_policies_begin_update(self, resource_group): + response = await ( + await self.client.route_policies.begin_update( + resource_group_name=resource_group.name, + route_policy_name="str", + body={ + "properties": { + "defaultAction": "str", + "statements": [ + { + "action": { + "actionType": "str", + "ipCommunityProperties": { + "add": {"ipCommunityIds": ["str"]}, + "delete": {"ipCommunityIds": ["str"]}, + "set": {"ipCommunityIds": ["str"]}, + }, + "ipExtendedCommunityProperties": { + "add": {"ipExtendedCommunityIds": ["str"]}, + "delete": {"ipExtendedCommunityIds": ["str"]}, + "set": {"ipExtendedCommunityIds": ["str"]}, + }, + "localPreference": 0, + }, + "condition": { + "ipCommunityIds": ["str"], + "ipExtendedCommunityIds": ["str"], + "ipPrefixId": "str", + "type": "str", + }, + "sequenceNumber": 0, + "annotation": "str", + } + ], + }, + "tags": {"str": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_route_policies_begin_delete(self, resource_group): + response = await ( + await self.client.route_policies.begin_delete( + resource_group_name=resource_group.name, + route_policy_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_route_policies_list_by_resource_group(self, resource_group): + response = self.client.route_policies.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_route_policies_list_by_subscription(self, resource_group): + response = self.client.route_policies.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_route_policies_begin_update_administrative_state(self, resource_group): + response = await ( + await self.client.route_policies.begin_update_administrative_state( + resource_group_name=resource_group.name, + route_policy_name="str", + body={"resourceIds": ["str"], "state": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_route_policies_begin_validate_configuration(self, resource_group): + response = await ( + await self.client.route_policies.begin_validate_configuration( + resource_group_name=resource_group.name, + route_policy_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_route_policies_begin_commit_configuration(self, resource_group): + response = await ( + await self.client.route_policies.begin_commit_configuration( + resource_group_name=resource_group.name, + route_policy_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/pyproject.toml b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/pyproject.toml index 540da07d41af..3f944bb376dd 100644 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/pyproject.toml +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/pyproject.toml @@ -1,6 +1,88 @@ +[build-system] +requires = [ + "setuptools>=77.0.3", + "wheel", +] +build-backend = "setuptools.build_meta" + +[project] +name = "azure-mgmt-managednetworkfabric" +authors = [ + { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, +] +description = "Microsoft Azure Managednetworkfabric Management Client Library for Python" +license = "MIT" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", +] +requires-python = ">=3.9" +keywords = [ + "azure", + "azure sdk", +] +dependencies = [ + "isodate>=0.6.1", + "azure-mgmt-core>=1.6.0", + "typing-extensions>=4.6.0", +] +dynamic = [ + "version", + "readme", +] + +[project.urls] +repository = "https://github.com/Azure/azure-sdk-for-python" + +[tool.setuptools.dynamic.version] +attr = "azure.mgmt.managednetworkfabric._version.VERSION" + +[tool.setuptools.dynamic.readme] +file = [ + "README.md", + "CHANGELOG.md", +] +content-type = "text/markdown" + +[tool.setuptools.packages.find] +exclude = [ + "tests*", + "generated_tests*", + "samples*", + "generated_samples*", + "doc*", + "azure", + "azure.mgmt", +] + +[tool.setuptools.package-data] +pytyped = [ + "py.typed", +] + [tool.azure-sdk-build] breaking = false mypy = false pyright = false type_check_samples = false verifytypes = false + +[packaging] +package_name = "azure-mgmt-managednetworkfabric" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Managednetworkfabric Management" +package_doc_id = "" +is_stable = true +is_arm = true +need_msrestazure = false +need_azuremgmtcore = true +sample_link = "" +title = "ManagedNetworkFabricMgmtClient" +exclude_folders = "" diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/sdk_packaging.toml b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/sdk_packaging.toml deleted file mode 100644 index c89fab30ee36..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/sdk_packaging.toml +++ /dev/null @@ -1,11 +0,0 @@ -[packaging] -package_name = "azure-mgmt-managednetworkfabric" -package_nspkg = "azure-mgmt-nspkg" -package_pprint_name = "Managednetworkfabric Management" -package_doc_id = "" -is_stable = true -is_arm = true -need_msrestazure = false -need_azuremgmtcore = true -sample_link = "" -title = "ManagedNetworkFabricMgmtClient" diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/setup.py b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/setup.py deleted file mode 100644 index a222ce417493..000000000000 --- a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/setup.py +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env python - -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- - -import re -import os.path -from io import open -from setuptools import find_packages, setup - -# Change the PACKAGE_NAME only to change folder and different name -PACKAGE_NAME = "azure-mgmt-managednetworkfabric" -PACKAGE_PPRINT_NAME = "Managednetworkfabric Management" - -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") -# a-b-c => a.b.c -namespace_name = PACKAGE_NAME.replace("-", ".") - -# Version extraction inspired from 'requests' -with open( - os.path.join(package_folder_path, "version.py") - if os.path.exists(os.path.join(package_folder_path, "version.py")) - else os.path.join(package_folder_path, "_version.py"), - "r", -) as fd: - version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) - -if not version: - raise RuntimeError("Cannot find version information") - -with open("README.md", encoding="utf-8") as f: - readme = f.read() -with open("CHANGELOG.md", encoding="utf-8") as f: - changelog = f.read() - -setup( - name=PACKAGE_NAME, - version=version, - description="Microsoft Azure {} Client Library for Python".format(PACKAGE_PPRINT_NAME), - long_description=readme + "\n\n" + changelog, - long_description_content_type="text/markdown", - license="MIT License", - author="Microsoft Corporation", - author_email="azpysdkhelp@microsoft.com", - url="https://github.com/Azure/azure-sdk-for-python", - keywords="azure, azure sdk", # update with search keywords relevant to the azure service / product - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Programming Language :: Python", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "License :: OSI Approved :: MIT License", - ], - zip_safe=False, - packages=find_packages( - exclude=[ - "tests", - # Exclude packages that will be covered by PEP420 or nspkg - "azure", - "azure.mgmt", - ] - ), - include_package_data=True, - package_data={ - "pytyped": ["py.typed"], - }, - install_requires=[ - "isodate<1.0.0,>=0.6.1", - "azure-common~=1.1", - "azure-mgmt-core>=1.3.2,<2.0.0", - "typing-extensions>=4.3.0; python_version<'3.8.0'", - ], - python_requires=">=3.7", -) diff --git a/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/tsp-location.yaml b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/tsp-location.yaml new file mode 100644 index 000000000000..55a204ff20a0 --- /dev/null +++ b/sdk/managednetworkfabric/azure-mgmt-managednetworkfabric/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/managednetworkfabric/ManagedNetworkFabric.ResourceManager.Management +commit: 1a3542f46375ced453982cf69f035d9a9a3924d5 +repo: Azure/azure-rest-api-specs +additionalDirectories: